본문 바로가기
IT Knowledge/Kubernetes

failed to pull image k8s.gcr.io (Proxy Setting)

by Seok. 2021. 12. 24.
반응형

Kubernetes cluster를 구성하다

kubeadm init을 통해 cluster를 구성하다보면 아래와 같은 오류를 받을 수 있다. 

[오류]

 [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-apiserver:v1.22.3: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager:v1.22.3: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler:v1.22.3: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy:v1.22.3: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.5: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.5.0-0: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
, error: exit status 1
        [ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns/coredns:v1.8.4: output: Error response from daemon: Get "https://k8s.gcr.io/v2/": dial tcp 142.250.157.82:443: i/o timeout (Client.Timeout exceeded while awaiting headers)

 

[오류내용]

k8s.gcr.io 에서 kube-apiserver / kube-controller-manager / kube-scheduler / kube-proxy / pause / etcd / coredns 컨테이너를 가져오다(pull)다가 실패한 내용이다. 

 

[원인확인]

개발환경이 Proxy를 사용해야 인터넷이 가능한 환경이라. Proxy 세팅이 필요하다. 

 

[조치방법]

Proxy 세팅

2021.12.22 - [IT Knowledge/Kubernetes] - 컨테이너 런타임별 Proxy 설정방법(CRI-O, containerd)

 

컨테이너 런타임별 Proxy 설정방법(CRI-O, containerd)

Kubernetes 를 설치하면서, 컨테이너 런타임별로 Proxy를 설정하는 방법에 대해 작성합니다. 예시 Proxy : http://example.proxy.co.kr:3128 [Yum Proxy 설정] 설정파일 위치 : /etc/yum.conf 설정 추가 : proxy=h..

lifeplan-b.tistory.com

 

[CRI-O Proxy 설정]

sudo mkdir -p /etc/systemd/system/crio.service.d

Create a file http-proxy.conf

cat /etc/systemd/system/crio.service.d/http-proxy.conf

 

[Service]

Environment=”HTTP_PROXY=http://example.proxy.co.kr:3128"

Environment=”HTTPS_PROXY=http://example.proxy.co.kr:3128"

Restart the crio daemon

systemctl daemon-reload

systemctl restart crio

 

 

반응형

댓글