部署k8s时遇到一个报错。

查询pod时

[root@ml ~]#  kubectl  get pod 

状态一直处于ContainerCreating的状态。

NAME                                      READY                STATUS                       RESTARTS                      AGE
mysql-2261771434-13554       0/ 1          ContainerCreating                             0                          3m

然后我查询了一下pod信息

[root@ml ~]# kubectl describe pod mysql-2261771434-13554
Name: mysql-2261771434-13554
Namespace: default
Node: node2/192.168.1.7
Start Time: Sun, 29 Mar 2020 20:22:54 +0800
Labels: name=mysql
pod-template-hash=2261771434
Status: Pending
IP:
Controllers: ReplicaSet/mysql-2261771434
Containers:
mysql:
Container ID:
Image: docker.io/mysql/mysql-server
Image ID:
Port: 3306/TCP
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Volume Mounts: <none>
Environment Variables:
MYSQL_ROOT_PASSWORD: hello123
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
No volumes.
QoS Class: BestEffort
Tolerations: <none>
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
4m 4m 1 {default-scheduler } Normal Scheduled Successfully assigned mysql-2261771434-13554 to node2
4m 7s 5 {kubelet node2} Warning MissingClusterDNS kubelet does not have ClusterDNS IP configured and cannot create Pod using "ClusterFirst" policy. Falling back to DNSDefault policy.
3m 7s 4 {kubelet node2} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with RunContainerError: "runContainer: Error response from daemon: {\"message\":\"oci runtime error: error running hook: exit status 1, stdout: , stderr: \"}"

翻译了一下这个报错,意思好像说守护进程出了问题。

我再查询了一下节点状态。发现node1出现了问题。

[root@ml ~]# kubectl get nodes
NAME STATUS AGE
node1 NotReady 7h
node2 Ready 7h

过滤了一下,只给了我三个running。证明有一个服务是启动失败了的。

[root@6 ~]# systemctl status flanneld kube-proxy kubelet docker | grep running
Active: active (running) since 日 2020-03-29 13:14:11 CST; 7h ago
Active: active (running) since 日 2020-03-29 13:10:38 CST; 7h ago
Active: active (running) since 日 2020-03-29 13:45:20 CST; 6h ago

具体查了一下是kubelet的问题。

[root@6 ~]# systemctl status kubelet

重新重启一遍。就好了。

[root@6 ~]# systemctl restart  kubelet

再去maser去查状态。发现已经running了。

猜你喜欢

转载自www.cnblogs.com/meml/p/12594830.html