Recently started to study kubernetes, the operation of the container, the discovery has been in the containercreating state, sad a reminder, just started to encounter a bit of trouble, the following talk about how to find the problem and solve the
To run the container command:
KUBECTL-F Create Redis.yaml
Kubectl Get pod Redis
NAME Ready STATUS Restarts
REDIS-MASTER-6JGSL 0/1 containercreating 0 12s
Always in containercreating, not in running state
View related logs
Kubectl describe pod Redis-6jgsl
Name:redis-master-6jgsl
Namespace:default
node:127.0.0.1/127.0.0.1
Start time:wed, Sep 2017 09:07:39 +0800
Labels:name=redis-master
Status:pending
Ip:
Controllers:replicationcontroller/redis-master
Containers:
Master
Container ID:
Image:kubeguide/redis-master
Image ID:
Port:6379/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
--------- -------- ----- ---- ------------- -------- ------ -------
1m 1m 1 {default-scheduler} Normal scheduled successfully assigned REDIS-MASTER-6JG SL to 127.0.0.1
1m 47s 3 {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 because there is no credentials on the this request. Details: (open/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt:no such file or directory) "
1m 10s 4 {kubelet 127.0.0.1} Warning failedsync Error syncing pod, skipping:failed to "Startcontain Er "for" POD "with Imagepullbackoff:" Back-off pulling image \ "Registry.access.redhat.com/rhel7/pod-infrastructure: Latest\ ""
See Registry.access.redhat.com/rhel7/pod-infrastructure:latest feel very strange, I set the warehouse is Grc.io, why go to pull this image, suspect is not what is not installed well. Try running Docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest, prompting redhat-ca.crt:no such file or directory. LS View change file is a soft connection, link target is/ETC/RHSM, see no RHSM, try to install Yum install *rhsm*, the related software, feel more in line with, so installation view produced/etc/rhsm folder.
Run Kubectl get Pods again
NAME Ready STATUS Restarts
Redis-master-qhd12 1/1 Running 0 13m
Kubernetes Create Yaml,pod service has been in containercreating state for reasons of finding and resolving