kube-dns手动安装 - 找不到请求的资源

时间:2018-03-22 18:21:19

标签: kubernetes kube-dns

我正在尝试在Kubernetes The Hard Way for AWS之后手动安装kube-dns插件。

从此yaml创建kube-dns服务时出现错误:

apiVersion: v1
kind: Service
metadata:
  name: kube-dns
  namespace: kube-system
  labels:
    k8s-app: kube-dns
    kubernetes.io/cluster-service: "true"
    kubernetes.io/name: "KubeDNS"
spec:
  selector:
    k8s-app: kube-dns
  clusterIP: 10.32.0.10 
  ports:
    - name: dns
      port: 53
      protocol: UDP
    - name: dns-tcp
      port: 53
      protocol: TCP

执行: kubectl create -f services/kubedns.yaml Error from server (NotFound): the server could not find the requested resource

知道什么是kubectl找不到的缺失资源?

更新--v=8

的详细输出
$ ~/aws/hardway  kubectl --v=8 create -f services/kubedns.yaml
I0323 09:21:40.408869   94700 loader.go:357] Config loaded from file /Users/aplsek/.kube/config
I0323 09:21:40.410962   94700 round_trippers.go:414] GET https://kubernetes-***********.amazonaws.com:6443/swagger-2.0.0.pb-v1
I0323 09:21:40.410986   94700 round_trippers.go:421] Request Headers:
I0323 09:21:40.410998   94700 round_trippers.go:424]     Accept: application/json, */*
I0323 09:21:40.411008   94700 round_trippers.go:424]     User-Agent: kubectl/v1.9.4 (darwin/amd64) kubernetes/bee2d15
I0323 09:21:40.931119   94700 round_trippers.go:439] Response Status: 404 Not Found in 520 milliseconds
I0323 09:21:40.931141   94700 round_trippers.go:442] Response Headers:
I0323 09:21:40.931147   94700 round_trippers.go:445]     Date: Fri, 23 Mar 2018 16:21:40 GMT
I0323 09:21:40.931153   94700 round_trippers.go:445]     Content-Type: application/json
I0323 09:21:40.931159   94700 round_trippers.go:445]     Content-Length: 1307
I0323 09:21:40.938145   94700 request.go:873] Response Body: {
  "paths": [
    "/api",
    "/api/v1",
    "/apis",
    "/apis/apps",
    "/apis/apps/v1beta1",
    "/apis/authentication.k8s.io",
    "/apis/authentication.k8s.io/v1",
    "/apis/authentication.k8s.io/v1beta1",
    "/apis/authorization.k8s.io",
    "/apis/authorization.k8s.io/v1",
    "/apis/authorization.k8s.io/v1beta1",
    "/apis/autoscaling",
    "/apis/autoscaling/v1",
    "/apis/autoscaling/v2alpha1",
    "/apis/batch",
    "/apis/batch/v1",
    "/apis/batch/v2alpha1",
    "/apis/certificates.k8s.io",
    "/apis/certificates.k8s.io/v1beta1",
    "/apis/extensions",
    "/apis/extensions/v1beta1",
    "/apis/policy",
    "/apis/policy/v1beta1",
    "/apis/rbac.authorization.k8s.io",
    "/apis/rbac.authorization.k8s.io/v1alpha1",
    "/apis/rbac.authorization.k8s.io/v1beta1",
    "/apis/settings.k8s.io",
    "/apis/settings.k8s.io/v1alpha1",
    "/apis/storage.k8s.io",
    "/apis/storage.k8s.io/v1",
    "/apis/storage.k8s.io/v1beta1",
    "/healthz",
    "/healthz/ping",
    "/healthz/poststarthook/b [truncated 283 chars]
I0323 09:21:40.939987   94700 helpers.go:201] server response object: [{
  "metadata": {},
  "status": "Failure",
  "message": "the server could not find the requested resource",
  "reason": "NotFound",
  "details": {
    "causes": [
      {
        "reason": "UnexpectedServerResponse",
        "message": "unknown"
      }
    ]
  },
  "code": 404
}]
F0323 09:21:40.940029   94700 helpers.go:119] Error from server (NotFound): the server could not find the requested resource

0 个答案:

没有答案