问题描述
使用CentOS7的 yum 包管理器安装了 Kubernetes 集群,使用 kubectl 创建服务成功后,执行 kubectl get pods
,发现AGE虽然在不断增加,但状态始终不变
本文内容
- 分析问题原因
- 给出直接解决此问题的方式 (不完美)
- 给出其他方案
且听我娓娓道来~
问题分析与解决
kubectl 提供了 describe 子命令来输出指定的一个/多个资源的详细信息。
执行 kubectl describe pod mytomcat-9lcq5
,查看问题 Pod 的状态信息,输出如下:
[root@kube-master app]# kubectl describe pod mytomcat-9lcq5
Name: mytomcat-9lcq5
Namespace: default
Node: kube-node-2/192.168.87.145
Start Time: Fri, 17 Apr 2020 15:53:50 +0800
Labels: app=mytomcat
Status: Pending
IP:
Controllers: ReplicationController/mytomcat
Containers:
mytomcat:
Container ID:
Image: tomcat:9-jre8-alpine
Image ID:
Port: 8080/TCP
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Volume Mounts: <none>
Environment Variables: <none>
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
--------- -------- ----- ---- ------------- -------- ------ -------
5m 5m 1 {default-scheduler } Normal Scheduled Successfully assigned mytomcat-9lcq5 to kube-node-2
4m 4m 1 {kubelet kube-node-2} Wa