반응형

배경 상황
istio를 Helm으로 배포했는데 istio ingressgateway Pod에서 다음과 같은 에러가 발생하면서 제대로 동작을 하지 않았다.
Error creating: Internal error occurred: failed calling webhook "object.sidecar-injector.istio.io": failed to call webhook: Post "<https://istiod.istio-system.svc:443/inject?timeout=10s>": context deadline exceeded
문제를 추적하다보니 istiod Pod에서도 다음과 같은 에러가 발생하고 있었다.
error controllers error handling istiod-default-validator, retrying (retry count: ): webhook is not ready, retry controller=validation
해결 방법
처음에는 ingressgateway pod에서 context deadline exceeded가 발생해서 노드끼리의 보안 그룹 문제인가 했는데 아니었고, validatingwebhookconfigurations CRD가 뭔가 잘못 설정 되었나 했는데 그것도 아니었다.
먼저 웹훅 설정(ValidatingWebhookConfiguration CR의 매니페스트)을 살펴보면 다음과 같이 istiod 서비스의 443 포트를 요청 하도록 구성되어있다.
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
caBundle:
service:
name: istiod
namespace: istio-system
path: /validate
port: 443
그리고 istiod 서비스 매니페스트를 확인하면 port 443로 요청이 들어올 경우 15017 포트로 포워딩하도록 구성 되어있다.
- name: https-webhook
port: 443
protocol: TCP
targetPort: 15017
따라서 Kubernetes API 서버가 웹훅 validate 요청을 할 수 있도록 node security group에 다음과 같이 inbound 허용 룰을 추가해주어야 한다.
- 소스: kube-apiserver (또는 Control Plane 보안 그룹)
- 포트: 15017/TCP