无法在本地minikube设置中安装分er

时间:2019-07-07 14:56:30

标签: kubernetes dns kubectl minikube dnsmasq

我使用hyperkit VM进行了本地minikube设置。我在系统上安装了头盔,并且客户端已成功安装,但分er未在群集中安装。窗格的状态为ImagePullBackOff

我尝试使用--tiller-image标志安装映像的不同版本,但仍然失败。如果我在系统中对同一张图片进行正常的docker pull操作,它将起作用。

命令helm version给出以下结果:

Client: &version.Version{SemVer:"v2.12.1", GitCommit:"02a47c7249b1fc6d8fd3b94e6b4babf9d818144e", GitTreeState:"clean"}
Error: could not find a ready tiller pod

命令kubectl -n kube-system get pods给出以下结果:

NAME                               READY   STATUS             RESTARTS   AGE
coredns-fb8b8dccf-bh6w7            1/1     Running            0          146m
coredns-fb8b8dccf-gskc8            1/1     Running            1          146m
etcd-minikube                      1/1     Running            0          145m
kube-addon-manager-minikube        1/1     Running            0          145m
kube-apiserver-minikube            1/1     Running            0          145m
kube-controller-manager-minikube   1/1     Running            0          145m
kube-proxy-jqb9b                   1/1     Running            0          146m
kube-scheduler-minikube            1/1     Running            0          145m
storage-provisioner                1/1     Running            0          146m
tiller-deploy-548df79d66-xsngk     0/1     ImagePullBackOff   0          27m

命令kubectl -n kube-system describe pod tiller-deploy-548df79d66-xsngk使以下结果五分之一:

Name:               tiller-deploy-548df79d66-xsngk
Namespace:          kube-system
Priority:           0
PriorityClassName:  <none>
Node:               minikube/192.168.64.56
Start Time:         Sat, 06 Jul 2019 22:41:54 +0530
Labels:             app=helm
                    name=tiller
                    pod-template-hash=548df79d66
Annotations:        <none>
Status:             Pending
IP:                 172.17.0.5
Controlled By:      ReplicaSet/tiller-deploy-548df79d66
Containers:
  tiller:
    Container ID:   
    Image:          gcr.io/kubernetes-helm/tiller:v2.12.1
    Image ID:       
    Ports:          44134/TCP, 44135/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Liveness:       http-get http://:44135/liveness delay=1s timeout=1s period=10s #success=1 #failure=3
    Readiness:      http-get http://:44135/readiness delay=1s timeout=1s period=10s #success=1 #failure=3
    Environment:
      TILLER_NAMESPACE:    kube-system
      TILLER_HISTORY_MAX:  0
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-6w54d (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  default-token-6w54d:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-6w54d
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason     Age                  From               Message
  ----     ------     ----                 ----               -------
  Normal   Scheduled  21h                  default-scheduler  Successfully assigned kube-system/tiller-deploy-548df79d66-xsngk to minikube
  Warning  Failed     21h                  kubelet, minikube  Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.12.1": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.56:46818->192.168.64.1:53: read: connection refused
  Warning  Failed     21h                  kubelet, minikube  Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.12.1": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.56:32929->192.168.64.1:53: read: connection refused
  Warning  Failed     21h                  kubelet, minikube  Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.12.1": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.56:59446->192.168.64.1:53: read: connection refused
  Warning  Failed     21h (x4 over 21h)    kubelet, minikube  Error: ErrImagePull
  Normal   Pulling    21h (x4 over 21h)    kubelet, minikube  Pulling image "gcr.io/kubernetes-helm/tiller:v2.12.1"
  Warning  Failed     21h                  kubelet, minikube  Failed to pull image "gcr.io/kubernetes-helm/tiller:v2.12.1": rpc error: code = Unknown desc = Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.56:58643->192.168.64.1:53: read: connection refused
  Warning  Failed     21h (x7 over 21h)    kubelet, minikube  Error: ImagePullBackOff
  Normal   BackOff    21h (x110 over 21h)  kubelet, minikube  Back-off pulling image "gcr.io/kubernetes-helm/tiller:v2.12.1"

只要有帮助,我就不会落后于任何代理人。

更新1:

我ssh-ed进入minikube并尝试手动拉出docker映像,但出现错误:

Error response from daemon: Get https://gcr.io/v2/: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.56:46912->192.168.64.1:53: read: connection refused

更新2:

此问题不仅适用于掌舵,而且适用于任何图像。我使用Quay.io来获取图像,并且群集也无法达到该目标,因此我尝试了kafka,但这也失败了。 如果我使用ssh进入minikube,请更新resolv,然后在minikube中手动执行docker pull,以使pod旋转。

1 个答案:

答案 0 :(得分:0)

Reuse the docker daemon for minikube和命令

eval $(minikube docker-env)

然后像这样拉分till图像,

docker pull gcr.io/kubernetes-helm/tiller:v2.12.1

现在minikube将下载图像。使用此命令删除现有的分pod荚,

kubectl delete pod tiller-deploy-548df79d66-xsngk -n kube-system

解释是这样。由于分till部署中似乎未提及ImagePullPolicy,并且默认ImagePullPolicy为IfNotPresent,因此minikube可能不会下载该图像,而是会尝试使用已下载的图像。

更新:helm无法安装分er的原因是,minikube容器的resolv.conf文件中有nameserver 192.168.64.1来自他在创建时连接到的先前网络集群。因此minikube无法拉分till docker映像。可能是由于Docker根据您所连接的网络设置了名称服务器的原因。

link可能会有帮助。