启动pods-kubernetes时出错。 Pod仍处于ContainerCreating状态

时间:2017-07-10 05:32:38

标签: kubernetes

我在运行ubuntu的桌面上安装了带有minikube的kubernetes试用版。然而,提出豆荚似乎存在一些问题。 Kubectl获取pods --all-namespaces显示ContainerCreating状态下的所有pod并且它不会转换为Ready。

即使我做了kubernetes-dahboard,我也得到了

  

等待,服务端点尚未准备就绪。

Minikube版本:v0.20.0

环境:

  • 操作系统(例如来自/ etc / os-release):Ubuntu 12.04.5 LTS

    VM Driver" DriverName":" virtualbox"

    ISO版本" Boot2DockerURL": "文件:///home/nszig/.minikube/cache/iso/minikube-v0.20.0.iso"

我在Ubuntu上安装了minikube和kubectl。但是,我无法通过CLI和GUI访问仪表板。

http://127.0.0.1:8001/ui给出以下错误

{ "kind": "Status", "apiVersion": "v1", "metadata": {}, "status": "Failure", "message": "no endpoints available for service "kubernetes-dashboard"", "reason": "ServiceUnavailable", "code": 503 }

CLI上的minikube仪表板无法打开仪表板:输出

Waiting, endpoint for service is not ready yet...
Waiting, endpoint for service is not ready yet... 
Waiting, endpoint for service is not ready yet... 
Waiting, endpoint for service is not ready yet...
....... 
Could not find finalized endpoint being pointed to by kubernetes-dashboard: Temporary Error: Endpoint for service is not ready yet 
Temporary Error: Endpoint for service is not ready yet 
Temporary Error: Endpoint for service is not ready yet 
Temporary Error: Endpoint for service is not ready yet

kubectl版本:Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.0", GitCommit:"d3ada0119e776222f11ec7945e6d860061339aad", GitTreeState:"clean", BuildDate:"2017-06-29T23:15:59Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

minikube logs还会报告以下错误: .....

Jul 10 08:46:12 minikube localkube[3237]: I0710 08:46:12.901880 3237 kuberuntime_manager.go:458] Container {Name:php-redis Image:gcr.io/google-samples/gb-frontend:v4 Command:[] Args:[] WorkingDir: Ports:[{Name: HostPort:0 ContainerPort:80 Protocol:TCP HostIP:}] EnvFrom:[] Env:[{Name:GET_HOSTS_FROM Value:dns ValueFrom:nil}] Resources:{Limits:map[] Requests:map[cpu:{i:{value:100 scale:-3} d:{Dec:} s:100m Format:DecimalSI} memory:{i:{value:104857600 scale:0} d:{Dec:} s:100Mi Format:BinarySI}]} VolumeMounts:[{Name:default-token-gqtvf ReadOnly:true MountPath:/var/run/secrets/kubernetes.io/serviceaccount SubPath:}] LivenessProbe:nil ReadinessProbe:nil Lifecycle:nil TerminationMessagePath:/dev/termination-log TerminationMessagePolicy:File ImagePullPolicy:IfNotPresent SecurityContext:nil Stdin:false StdinOnce:false TTY:false} is dead, but RestartPolicy says that we should restart it. Jul 10 08:46:14 minikube localkube[3237]: E0710 08:46:14.139555 3237 remote_runtime.go:86] RunPodSandbox from runtime service failed: rpc error: code = 2 desc = unable to pull sandbox image "gcr.io/google_containers/pause-amd64:3.0": Error response from daemon: Get https://gcr.io/v1/_ping: x509: certificate signed by unknown authority ....
  

名称:kubernetes-dashboard-2039414953-czptd命名空间:kube-system   节点:minikube / 192.168.99.102开始时间:2017年7月14日星期五09:31:58   +0530标签:k8s-app = kubernetes-dashboard pod-template-hash = 2039414953   注释:kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1",&#34 ;参考" {"种类":" ReplicaSet""命名空间":" KUBE系统""名称& #34;:" kubernetes仪表板-2039414953"" UID":" 2eb39682-6849-11e7-8 ...   状态:待定IP:已创建   作者:ReplicaSet / kubernetes-dashboard-2039414953受控制   By:ReplicaSet / kubernetes-dashboard-2039414953容器:
  kubernetes仪表板:       货柜编号:       图片:gcr.io/google_containers/kubernetes-dashboard-amd64:v1.6.1       图片ID:
      端口:9090 / TCP       州:等待         原因:ContainerCreating       准备好了:错了       重启次数:0       活跃度:http-get http://:9090/延迟= 30秒超时= 30秒时间= 10秒#success = 1#failure = 3       环境:       坐骑:         来自kubernetes-dashboard-token-12gdj(ro)的/var/run/secrets/kubernetes.io/serviceaccount条件:类型状态
  已初始化的True Ready False PodScheduled True Volumes:
  kubernetes-仪表板令牌12gdj:       类型:秘密(由秘密填充的卷)       SecretName:kubernetes-dashboard-token-12gdj       可选:false QoS类:BestEffort节点选择器:Tolerations:node-role.kubernetes.io/master:NoSchedule事件:
  FirstSeen LastSeen从SubObjectPath类型计数原因消息
  --------- -------- ----- ---- ------------- -------- --- --- ------- 1h 11s 443 kubelet,minikube警告FailedSync同步错误   pod,skipping:未能" CreatePodSandbox"对于   " kubernetes-仪表板2039414953-czptd_kube系统(2eb57d9b-6849-11e7-8a56-080027206461)"   使用CreatePodSandboxError:"用于pod的CreatePodSandbox   \" kubernetes-仪表板2039414953-czptd_kube系统(2eb57d9b-6849-11e7-8a56-080027206461)\"   失败:rpc错误:代码= 2 desc =无法拉沙箱图像   \" gcr.io/google_containers/pause-amd64:3.0 \":来自的错误回复   守护进程:获取https://gcr.io/v1/_ping:x509:签署的证书   未知的权威"

3 个答案:

答案 0 :(得分:2)

很有可能正在下载Pod容器图像。图像不是很大,所以图像应该在一个体面的互联网连接上很快下载。

您可以使用kubectl describe pod --namespace kube-system <pod-name>了解有关pod提升状态的更多详细信息。看一下输出的Events部分。

kube-system命名空间中的所有kubernetes组件都处于READY状态之前,您将无法访问仪表板。

您也可以SSH尝试使用minikube ssh进入minikube vm来调试问题。

答案 1 :(得分:0)

我能够通过使用VPN连接进行全新安装来解决此问题,因为我在公司网络中有限制。这阻止了安装尝试拉沙盒映像的站点。

答案 2 :(得分:0)

尝试使用:

kubectl config use-context minikube

..可能已启动预先存在的配置。