0
votes

I use docker pull command can pull mirror image correctly,But when I use the kubectl run command,my pod is in ContainerCreating state.How can I fix it.

[root@centos-master etc]# kubectl run my-nginx --image=nginx

deployment "my-nginx" created

[root@centos-master etc]# kubectl get pods

NAME                             READY     STATUS              RESTARTS   AGE
my-nginx-2723453542-5s33f        0/1       ContainerCreating   0          7s

[root@centos-master etc]# kubectl describe pod my-nginx-2723453542-5s33f

Name:       my-nginx-2723453542-5s33f
Namespace:  default
Node:       centos-minion-2/104.21.51.35
Start Time: Fri, 30 Aug 2019 16:11:57 +0800
Labels:     pod-template-hash=2723453542
        run=my-nginx
Status:     Pending
IP:     
Controllers:    ReplicaSet/my-nginx-2723453542
Containers:
  my-nginx:
    Container ID:       
    Image:          nginx
    Image ID:           
    Port:           
    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 my-nginx-2723453542-5s33f to centos-minion-2
  <invalid> <invalid>   5   {kubelet centos-minion-2}           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: (Get https://registry.access.redhat.com/v1/_ping: proxyconnect tcp: net/http: TLS handshake timeout)"

  <invalid> <invalid>   11  {kubelet centos-minion-2}       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\""
1
You seem to have set KUBELET_POD_INFRA_CONTAINER="--pod-infra-containerimage=registry.access.redhat.com/rhel7/pod-infrastructure:latest" somewhere for your kubelets on your worker nodes. How did you provision the nodes?char
char is right, please take a look here: access.redhat.com/documentation/en-us/… (1.3.2. Starting Kubernetes subitem 3)prometherion

1 Answers

0
votes

As was recommended by @char and @prometherion, in order to sort out this issue you probably need to supply KUBELET_ARGS parameters with appropriate --pod-infra-container-image flag as per link provided :

KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest"

You can also take into the consideration solution mentioned by @Matthew installing subscription-manager package and subscribe host OS, as described here.