카테고리 없음
[k8s][cri-o]insecure-registries 설정
피타챈
2025. 4. 2. 10:51
제작된 이미지를 가져와야하는데 내부망 저장소가 http 라 insecure-registries 설정이 필요하게 되었다.
컨테이너 런타임으로 CRI-O 를 사용하는 환경에서 insecoure-registries 설정 방법을 기록한다.
- insecure-registries는 HTTPS 인증서 없이 동작하는 프라이빗 컨테이너 레지스트리(Private Container Registry) 를 사용할 때 설정함.
- Kubernetes에서 프라이빗 레지스트리를 사용하는 경우, 기본적으로 kubelet과 컨테이너 런타임(CRI-O, containerd 등)은 HTTPS를 요구함
- 하지만 레지스트리가 SSL 인증서 없이 HTTP 로 동작하면, 다음과 같은 오류가 발생할 수 있음
Failed to pull image "192.168.11.27:5000/my-image:latest":
pinging container registry 192.168.11.27:5000: Get "https://192.168.11.27:5000/v2/": http: server gave HTTP response to HTTPS client
- 쿠버네티스 노드에서 사용하는 컨테이너 런타임(CRI-O, containerd, Docker 등)에 insecure-registries 설정을 추가해야함
1. CRIO 설정 파일
보통은 위치가 /etc/crio/crio.conf 이다. [registry] 섹션을 찾아서, insecure_registries 항목에 추가한다.
# List of registries to skip TLS verification for pulling images. Please
# consider configuring the registries via /etc/containers/registries.conf before
# changing them here.
insecure_registries = ["{ip}:{port}"]
2. CRI-O 서비스 재시작
sudo systemctl restart crio
master노드와 worker 노드에서 각각 설정 / 재시작 이후로 이미지 pull 시 정상동작하는 것을 확인하였다.