ingress-nginx ConfigurationSnippet 검증 오류 해결하기
원문은 Ellie Huxtable님이 에 게재했습니다. 이 블로그 구독하기
오늘 ingress-nginx를 설정할 일이 생겼다. 특정 경로의 상태 코드를 재작성하기 위해 nginx 설정을 조금 추가해야 했다.
예를 들면 다음과 같다.
nginx.ingress.kubernetes.io/configuration-snippet: |-
location /metrics {
return 404;
}예전에도 여러 번 이렇게 해봤는데, 오늘은 다음과 같은 오류가 발생했다.
Error: UPGRADE FAILED: cannot patch "xyz" with kind Ingress: admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: annotation group ConfigurationSnippet contains risky annotation based on ingress configuration이미
allowSnippetAnnotations: true설정이 되어 있어서 당황스러웠다!
알고 보니 최근 릴리스(controller 1.12)에서는 어노테이션에 위험도 등급이 매겨진다. 관련 표는 여기에서 확인할 수 있다.
이제 다음과 같이 지정해야 한다.
annotations-risk-level: CriticalConfigMap에 추가하면 된다. Helm 차트를 사용하고 있다면 다음과 같이 추가할 수 있다.
controller:
config:
annotations-risk-level: Critical참고로 이번 변경은 보안 이슈에 대응하기 위한 것이다. 주로 멀티 테넌트 클러스터를 사용하는 경우에 문제가 된다.
관련 이슈: https://github.com/kubernetes/ingress-nginx/issues/12618, https://github.com/kubernetes/kubernetes/issues/126811
글을 무작위로 읽기
댓글
로그인하고 댓글 남기기