Kubernetes에서 이미지를 가져올 수 없습니다.

Kubernetes에서 이미지를 가져올 수 없습니다.

CentOS 7에서 Kubernetes를 실행 중인데 포드를 배포할 수 없습니다. 달리고 난 후

# kubectl run nginx --image=nginx

난 달린다

# kubectl describe pod nginx

다음과 같은 출력을 제공합니다.

Name:           nginx-701339712-8sx7m
Namespace:      default
Node:           node2/192.168.1.126
Start Time:     Fri, 27 Oct 2017 14:06:35 -0400
Labels:         pod-template-hash=701339712
                run=nginx
Status:         Pending
IP:
Controllers:    ReplicaSet/nginx-701339712
Containers:
  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
  ---------     --------        -----   ----                    -------------   --------        ------          -------
  21s           21s             1       {default-scheduler }                    Normal          Scheduled       Successfully assigned nginx-701339712-8sx7m to node2
  21s           7s              2       {kubelet node2}                         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)"

마지막 줄을 스크롤하면 redhat.com으로 이동하고 실패하는 것을 볼 수 있습니다. RedHat 저장소에서 이미지를 가져와야 하는 이유를 모르겠습니다. Docker 허브에서 가져와야 합니다.

답변1

나는 다음 줄을 주석 처리하여 문제를 해결했습니다.

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

/etc/kubernetes/kubelet에서

내 노예 하나하나에

답변2

이 오류를 해결하기 위해 /etc/kubernetes/kubelet을 편집하는 것은 권장되지 않습니다. Registry.access.redhat.com/rhel7/pod-infrastruct:latest에 대한 이미지 가져오기가 실패하면 다음 명령을 실행해 보세요.

냠 설치 -yrhsm

명령을 실행한 후 동일한 오류를 해결했습니다.

관련 정보