[root@master work]# kubectl get pods NAME READY STATUS RESTARTS AGE mysql-1pzqd 0/1 ContainerCreating 0 21s
登录很久还是这个创建中状态。原因定位:
1
kubectl describe pod mysql-1pzqd
发现了如下的事件异常:
1 2 3 4 5 6
Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 55m 55m 1 {default-scheduler } Normal Scheduled Successfully assigned mysql-1pzqd to 127.0.0.1 55m 3m 15 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request. details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)" 54m 15s 241 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest\""
[root@master work]# kubectl get pods NAME READY STATUS RESTARTS AGE mysql-1ckgt 0/1 ErrImagePull 0 1m
继续查看日志:
1 2 3 4 5 6 7 8 9 10 11 12 13
kubectl describe pod mysql-1ckgt
Events: FirstSeen LastSeen Count From SubObjectPath Type Reason Message --------- -------- ----- ---- ------------- -------- ------ ------- 2m 2m 1 {default-scheduler } Normal Scheduled Successfully assigned mysql-1ckgt to 127.0.0.1 2m 2m 1 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request. details: (Error: image rhel7/pod-infrastructure:latest not found)" 1m 1m 1 {kubelet 127.0.0.1} Warning MissingClusterDNS kubelet does not have ClusterDNS IP configured and cannot create Pod using "ClusterFirst" policy. Falling back to DNSDefault policy. 1m 37s 3 {kubelet 127.0.0.1} spec.containers{mysql} Normal Pulling pulling image "mysql" 1m 35s 3 {kubelet 127.0.0.1} spec.containers{mysql} Warning Failed Failed to pull image "mysql": error pulling image configuration: Get http://dao-booster.daocloud.io/sha256:e3fcc9e1cc046c92cfcea0d66cdb00fcb7747e87dde96dfc958bd80be37af117: dial tcp: lookup dao-booster.daocloud.io on 114.114.114.114:53: no such host 1m 35s 3 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "mysql" with ErrImagePull: "error pulling image configuration: Get http://dao-booster.daocloud.io/sha256:e3fcc9e1cc046c92cfcea0d66cdb00fcb7747e87dde96dfc958bd80be37af117: dial tcp: lookup dao-booster.daocloud.io on 114.114.114.114:53: no such host" 1m 7s 4 {kubelet 127.0.0.1} spec.containers{mysql} Normal BackOff Back-off pulling image "mysql" 1m 7s 4 {kubelet 127.0.0.1} Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "mysql" with ImagePullBackOff: "Back-off pulling image \"mysql\""
[root@master work]# kubectl get svc NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE kubernetes 10.254.0.1 <none> 443/TCP 27d mysql 10.254.41.85 <none> 3306/TCP 4s