• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

kubectl apply 적용 시 status "imagepullbackoff, errimagepull" 상태

24.04.23 15:58 작성 조회수 40

0

안녕하세요

kubectl apply -f wordpress-k8s.yml 적용시 이미지들이
제대로 불러와지지 않습니다.

확인 부탁드립니다 감사합니다 (__ )

 

kubectl get all.PNGkubectl get all 사진과 아래

kubectl describe pod 명령어 출력 내용 전달 드립니다.

 

Name: wordpress-746bd6d54b-glpjq

Namespace: default

Priority: 0

Service Account: default

Node: minikube/172.22.59.104

Start Time: Tue, 23 Apr 2024 15:41:01 +0900

Labels: app=wordpress

pod-template-hash=746bd6d54b

tier=frontend

Annotations: <none>

Status: Pending

IP: 10.244.0.10

IPs:

IP: 10.244.0.10

Controlled By: ReplicaSet/wordpress-746bd6d54b

Containers:

wordpress:

Container ID:

Image: wordpress:5.9.1-php8.1-apache

Image ID:

Port: 80/TCP

Host Port: 0/TCP

State: Waiting

Reason: ImagePullBackOff

Ready: False

Restart Count: 0

Environment:

WORDPRESS_DB_HOST: wordpress-mysql

WORDPRESS_DB_NAME: wordpress

WORDPRESS_DB_USER: root

WORDPRESS_DB_PASSWORD: password

Mounts:

/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-v6cfh (ro)

Conditions:

Type Status

Initialized True

Ready False

ContainersReady False

PodScheduled True

Volumes:

kube-api-access-v6cfh:

Type: Projected (a volume that contains injected data from multiple sources)

TokenExpirationSeconds: 3607

ConfigMapName: kube-root-ca.crt

ConfigMapOptional: <nil>

DownwardAPI: true

QoS Class: BestEffort

Node-Selectors: <none>

Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s

node.kubernetes.io/unreachable:NoExecute op=Exists for 300s

Events:

Type Reason Age From Message

---- ------ ---- ---- -------

Normal Scheduled 7m50s default-scheduler Successfully assigned default/wordpress-746bd6d54b-glpjq to minikube

Warning Failed 7m9s kubelet Failed to pull image "wordpress:5.9.1-php8.1-apache": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:33889->172.22.48.1:53: i/o timeout

Warning Failed 6m29s kubelet Failed to pull image "wordpress:5.9.1-php8.1-apache": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:46061->172.22.48.1:53: i/o timeout

Warning Failed 5m46s kubelet Failed to pull image "wordpress:5.9.1-php8.1-apache": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:39787->172.22.48.1:53: i/o timeout

Normal Pulling 4m58s (x4 over 7m49s) kubelet Pulling image "wordpress:5.9.1-php8.1-apache"

Warning Failed 4m35s (x4 over 7m9s) kubelet Error: ErrImagePull

Warning Failed 4m35s kubelet Failed to pull image "wordpress:5.9.1-php8.1-apache": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:39383->172.22.48.1:53: i/o timeout

Warning Failed 4m23s (x6 over 7m9s) kubelet Error: ImagePullBackOff

Normal BackOff 4m9s (x7 over 7m9s) kubelet Back-off pulling image "wordpress:5.9.1-php8.1-apache"

Warning Failed 2m40s kubelet Failed to pull image "wordpress:5.9.1-php8.1-apache": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:45684->172.22.48.1:53: i/o timeout

Name: wordpress-mysql-78488dd7d5-t9mz5

Namespace: default

Priority: 0

Service Account: default

Node: minikube/172.22.59.104

Start Time: Tue, 23 Apr 2024 15:41:01 +0900

Labels: app=wordpress

pod-template-hash=78488dd7d5

tier=mysql

Annotations: <none>

Status: Pending

IP: 10.244.0.9

IPs:

IP: 10.244.0.9

Controlled By: ReplicaSet/wordpress-mysql-78488dd7d5

Containers:

mysql:

Container ID:

Image: mariadb:10.7

Image ID:

Port: 3306/TCP

Host Port: 0/TCP

State: Waiting

Reason: ImagePullBackOff

Ready: False

Restart Count: 0

Environment:

MYSQL_DATABASE: wordpress

MYSQL_ROOT_PASSWORD: password

Mounts:

/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-7hxcx (ro)

Conditions:

Type Status

Initialized True

Ready False

ContainersReady False

PodScheduled True

Volumes:

kube-api-access-7hxcx:

Type: Projected (a volume that contains injected data from multiple sources)

TokenExpirationSeconds: 3607

ConfigMapName: kube-root-ca.crt

ConfigMapOptional: <nil>

DownwardAPI: true

QoS Class: BestEffort

Node-Selectors: <none>

Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s

node.kubernetes.io/unreachable:NoExecute op=Exists for 300s

Events:

Type Reason Age From Message

---- ------ ---- ---- -------

Normal Scheduled 7m50s default-scheduler Successfully assigned default/wordpress-mysql-78488dd7d5-t9mz5 to minikube

Warning Failed 7m29s kubelet Failed to pull image "mariadb:10.7": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:50523->172.22.48.1:53: i/o timeout

Warning Failed 6m49s kubelet Failed to pull image "mariadb:10.7": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:42046->172.22.48.1:53: i/o timeout

Warning Failed 6m7s kubelet Failed to pull image "mariadb:10.7": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:51638->172.22.48.1:53: i/o timeout

Normal Pulling 5m15s (x4 over 7m49s) kubelet Pulling image "mariadb:10.7"

Warning Failed 4m55s (x4 over 7m29s) kubelet Error: ErrImagePull

Warning Failed 4m55s kubelet Failed to pull image "mariadb:10.7": Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 172.22.48.1:53: read udp 172.22.59.104:42815->172.22.48.1:53: i/o timeout

Warning Failed 4m40s (x6 over 7m29s) kubelet Error: ImagePullBackOff

Normal BackOff 2m47s (x12 over 7m29s) kubelet Back-off pulling image "mariadb:10.7"

 

 

 

답변 1

답변을 작성해보세요.

0

인프런 AI 인턴님의 프로필

인프런 AI 인턴

2024.04.23

안녕하세요, 인프런 AI 인턴입니다.

Junhwan님께서 겪고 계신 kubectl apply -f 명령어 적용 시 ImagePullBackOffErrImagePull 상태 문제는 Kubernetes 클러스터 내에서 컨테이너 이미지를 가져오는데 실패하는 경우 발생합니다. 문제의 핵심은 Kubernetes가 지정된 컨테이너 이미지를 Docker Hub나 다른 컨테이너 레지스트리에서 성공적으로 가져오지 못함에 있습니다. 이는 네트워크 문제, 이미지 이름 실수, 또는 인증 문제일 수 있습니다.

Junhwan님의 경우, ImagePullBackOffErrImagePull 상태의 주된 원인은 컨테이너 이미지를 가져오려고 시도할 때 발생하는 “i/o timeout”으로, Kubernetes가 Docker Hub에 접근하려고 할 때 네트워크 연결 문제가 발생하는 것을 나타냅니다. 이는 종종 DNS 설정 문제, 인터넷 연결 문제, 또는 네트워크 보안 설정(예: 방화벽)에 의해 발생할 수 있습니다.

이와 관련된 질문으로, DNS 설정 문제나 네트워크 연결 문제로 인해 이미지를 정상적으로 가져오지 못하는 경우를 설명하는 ImagePullBackOff 오류가 발생합니다. 게시물을 참조하시면 도움이 될 수 있습니다.

해명된 내용과 유사한 상황에서는 다음과 같은 접근 방법을 고려할 수 있습니다:
- DNS 설정을 확인: Kubernetes 클러스터가 Docker 이미지를 불러오기 위해 사용하는 DNS 서버 설정을 확인합니다. Minikube나 기타 Kubernetes 환경에서 DNS 설정을 점검하여 올바르게 구성되었는지 확인합니다.
- 네트워크 연결 검사: Kubernetes 클러스터가 인터넷에 접속할 수 있도록 네트워크 연결 및 설정을 점검합니다. 특히, Docker Hub에 접근할 수 있는지 확인이 필요합니다.
- 방화벽 및 네트워크 보안 설정 검토: 방화벽 또는 네트워크 보안 설정이 Docker Hub 접근을 방해하지 않도록 설정을 검토합니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏
추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.