cert-manager Webhook 포드 디버깅 완전 가이드
마지막 검증: 2022년 9월 8일
cert-manager webhook은 cert-manager 설치의 일부로 실행되는 포드예요. kubectl로 매니페스트를 적용할 때 Kubernetes API 서버가 TLS를 통해 cert-manager webhook을 호출해 매니페스트를 검증해요. 이 가이드에서는 Kubernetes API 서버와 cert-manager webhook 포드 사이의 통신 문제를 디버깅하는 방법을 도와드릴게요.
출처: 문서
본문
이 페이지에 나열된 오류 메시지는 cert-manager를 설치하거나 업그레이드할 때, 또는 설치/업그레이드 직후 Certificate, Issuer 또는 다른 cert-manager 커스텀 리소스를 만들려고 할 때 발생하는 것들입니다.
아래 다이어그램은 cert-manager webhook 문제를 디버깅할 때 흔히 보는 패턴을 보여줍니다: cert-manager 커스텀 리소스를 만들 때 API 서버가 TLS를 통해 cert-manager webhook 포드에 연결합니다. 빨간 십자가는 API 서버가 webhook과 통신하는 데 실패했음을 나타냅니다.
이 문서의 나머지 부분에서는 발생할 수 있는 오류 메시지를 소개합니다.
오류: connect: connection refused
이 문제는 4개의 GitHub 이슈 (#2736 (https://github.com/jetstack/cert-manager/issues/2736), #3133 (https://github.com/jetstack/cert-manager/issues/3133), #3445 (https://github.com/jetstack/cert-manager/issues/3445), #4425 (https://github.com/cert-manager/cert-manager/issues/4425)) 에 보고되었고, 외부 프로젝트의 1개 GitHub 이슈(aws-load-balancer-controller#1563 (https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/1563)), Stack Overflow (serverfault#1076563 (https://web.archive.org/web/20210903183221/https://serverfault.com/questions/1076563/creating-issuer-for-kubernetes-cert-manager-is-causing-404-and-500-error)) 에 보고되었으며, in:#cert-manager in:#cert-manager-dev ":443: connect: connection refused" 검색으로 나열할 수 있는 13개의 Slack 메시지에서 언급되었습니다. 이 오류 메시지는 webhook을 만드는 다른 프로젝트에서도 찾을 수 있습니다 (kubewarden-controller#110 (https://github.com/kubewarden/kubewarden-controller/issues/110)) .
cert-manager를 설치하거나 업그레이드한 직후 Certificate, Issuer 또는 다른 cert-manager 커스텀 리소스를 만들 때 이 오류가 발생할 수 있습니다. 예를 들어 다음 명령으로 Issuer 리소스를 만드는 경우:
kubectl apply -f-
다음 오류 메시지가 표시됩니다:
Error from server (InternalError): error when creating "STDIN":
Internal error occurred: failed calling webhook "webhook.cert-manager.io": failed to call webhook:
Post "https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s":
dial tcp 10.96.20.99:443: connect: connection refused
Helm으로 cert-manager 1.5.0 이상을 설치하거나 업그레이드할 때 helm install 또는 helm upgrade를 실행하면 매우 유사한 오류 메시지가 나타날 수 있습니다:
Error: INSTALLATION FAILED: Internal error occurred:
failed calling webhook "webhook.cert-manager.io": failed to call webhook:
Post "https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s":
dial tcp 10.96.20.99:443: connect: connection refused
"connection refused" 메시지는 API 서버가 cert-manager-webhook과 TCP 연결을 수립하려고 할 때 발생합니다. TCP 용어로, API 서버가 TCP 핸드셰이크를 시작하기 위해 SYN 패킷을 보냈고, 그 대가로 RST 패킷을 받은 것입니다.
API 서버가 실행 중인 컨트롤 플레인 노드 내부에서 tcpdump (https://www.tcpdump.org/manpages/tcpdump.1.html) 를 사용한다면 API 서버로 반환되는 패킷을 볼 수 있습니다:
192.168.1.43 (apiserver) -> 10.96.20.99 (webhook pod) TCP 59466 → 443 [SYN]
10.96.20.99 (webhook pod) -> 192.168.1.43 (apiserver) TCP 443 → 59466 [RST, ACK]
RST 패킷은 요청된 포트에 아무것도 리슨하고 있지 않을 때 Linux 커널이 보냅니다. RST 패킷은 또한 TCP 홉 중 하나(예: 방화벽)에 의해 반환될 수도 있습니다. 자세한 내용은 Stack Overflow 페이지 What can be the reasons of connection refused errors? (https://stackoverflow.com/a/2333446/3808537) 를 참조하세요.
방화벽은 보통 RST 패킷을 반환하지 않고 SYN 패킷을 완전히 버리며, 이 경우 i/o timeout 또는 context deadline exceeded 오류 메시지가 나타납니다. 그렇다면 오류: i/o timeout (연결 문제) (/docs/troubleshooting/webhook/#io-timeout) 및 오류: context deadline exceeded (/docs/troubleshooting/webhook/#context-deadline-exceeded) 섹션으로 조사를 계속하세요.
TCP 연결의 근원(API 서버)에서 목적지(포드 cert-manager-webhook)까지 가능한 원인을 순서대로 제거해 봅시다.
cert-manager-webhook.cert-manager.svc라는 이름이 10.43.183.232로 해석된다고 상상해 봅시다. 이는 클러스터 IP입니다. API 서버 프로세스가 실행되는 컨트롤 플레인 노드는 iptables를 사용해 IP 목적지를 포드 IP로 다시 작성합니다. 이것이 첫 번째 문제일 수 있습니다: 때로는 준비(rediness) 프로브가 작동하지 않는 한 kubelet이 Endpoint 리소스에 포드 IP를 채우지 않기 때문에 주어진 클러스터 IP에 연결된 포드 IP가 없습니다.
먼저 Endpoint 리소스에 문제가 있는지 확인해 봅시다:
kubectl get endpoints -n cert-manager cert-manager-webhook
유효한 출력은 다음과 같습니다:
NAME ENDPOINTS AGE
cert-manager-webhook 10.244.0.2:10250 27d ✅
이 유효한 출력이 있는데도 connect: connection refused가 발생한다면 문제는 네트워킹 스택의 더 깊은 곳에 있습니다. 이 경우를 자세히 다루지는 않지만, tcpdump와 Wireshark를 사용해 트래픽이 API 서버에서 노드의 호스트 네임스페이스로 제대로 흐르는지 확인할 수 있습니다. kubelet이 이미 준비 엔드포인트에 도달할 수 있었으므로 호스트 네임스페이스에서 포드 네임스페이스로의 트래픽은 이미 잘 작동합니다.
일반적인 문제로는 방화벽이 컨트롤 플레인에서 워커로의 트래픽을 차단하는 경우가 있습니다; 예를 들어 GKE의 API 서버는 포트 10250을 통해서만 워커 노드(cert-manager webhook이 실행되는 곳)와 통신할 수 있습니다. EKS에서는 시큐리티 그룹이 컨트롤 플레인 VPC에서 워커 VPC로 가는 TCP 10250 트래픽을 거부할 수 있습니다.
<none>이 표시되면 cert-manager webhook은 제대로 실행되고 있지만 준비 엔드포인트에 도달할 수 없다는 의미입니다:
NAME ENDPOINTS AGE
cert-manager-webhook 236d ❌
<none>을 고치려면 cert-manager-webhook 배포가 정상인지 확인해야 합니다. cert-manager-webhook이 healthy로 표시되지 않는 동안 엔드포인트는 <none>으로 유지됩니다.
kubectl get pod -n cert-manager -l app.kubernetes.io/name=webhook
포드가 Running 상태이고 준비된 컨테이너 수가 0/1인 것을 볼 수 있어야 합니다:
NAME READY STATUS RESTARTS AGE
cert-manager-76578c9687-24kmr 0/1 Running 7 (8h ago) 28d ❌
1/1 및 Running을 얻는 경우는 Kubernetes의 불일치 상태를 나타내므로 자세히 다루지 않겠습니다.
0/1을 계속 보면 준비 엔드포인트가 응답하지 않는다는 뜻입니다. 그렇게 되면 엔드포인트가 생성되지 않습니다. 다음 단계는 준비 엔드포인트가 응답하지 않는 이유를 알아내는 것입니다. kubelet이 준비 엔드포인트를 칠 때 사용하는 포트를 확인해 봅시다:
kubectl -n cert-manager get deploy cert-manager-webhook -oyaml | grep -A5 readiness
이 예제에서 kubelet이 칠 포트는 6080입니다:
readinessProbe:
failureThreshold: 3
httpGet:
path: /healthz
port: 6080 # ✨
scheme: HTTP
이제 해당 포트로 포트 포워딩을 하고 /healthz가 작동하는지 확인해 봅시다. 셸 세션에서 다음을 실행합니다:
kubectl -n cert-manager port-forward deploy/cert-manager-webhook 6080
다른 셸 세션에서 다음을 실행합니다:
curl -sS --dump-header - 127.0.0.1:6080/healthz
정상 출력은 다음과 같습니다:
HTTP/1.1 200 OK ✅
Date: Tue, 07 Jun 2022 17:16:56 GMT
Content-Length: 0
준비 엔드포인트가 작동하지 않으면 다음이 표시됩니다:
curl: (7) Failed to connect to 127.0.0.1 port 6080 after 0 ms: Connection refused ❌
이 시점에서 준비 엔드포인트가 동일한 포트에 구성되어 있는지 확인하세요. webhook이 준비 엔드포인트를 위해 6080에서 리슨하고 있는지 로그를 확인해 봅시다:
$ kubectl logs -n cert-manager -l app.kubernetes.io/name=webhook | head -10
I0607 webhook.go:129] "msg"="using dynamic certificate generating using CA stored in Secret resource"
I0607 server.go:133] "msg"="listening for insecure healthz connections" "address"=":6081" ❌
I0607 server.go:197] "msg"="listening for secure connections" "address"=":10250"
I0607 dynamic_source.go:267] "msg"="Updated serving TLS certificate"
...
위 예제에서 문제는 준비 포트의 잘못된 구성이었습니다. webhook 배포에서 --healthz-port=6081 인수가 준비 구성과 일치하지 않았습니다.
오류: i/o timeout (연결 문제)
이 오류 메시지는 Slack에 26번 보고되었습니다. 이러한 메시지를 나열하려면 in:#cert-manager in:#cert-manager-dev "443: i/o timeout"으로 검색하세요. 이 오류 메시지는 2개의 GitHub 이슈 (#2811 (https://github.com/cert-manager/cert-manager/issues/2811), #4073 (https://github.com/cert-manager/cert-manager/issues/4073)) 에 보고되었습니다.
Error from server (InternalError): error when creating "STDIN": Internal error occurred:
failed calling webhook "webhook.cert-manager.io": failed to call webhook:
Post "https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s":
dial tcp 10.0.0.69:443: i/o timeout
API 서버가 cert-manager webhook과 통신하려고 할 때 SYN 패킷에 대한 응답이 없어 연결이 타임아웃됩니다. webhook의 net 네임스페이스 내부에서 tcpdump를 실행한다면 다음을 볼 수 있습니다:
192.168.1.43 (apiserver) -> 10.0.0.69 (webhook pod) TCP 44772 → 443 [SYN]
192.168.1.43 (apiserver) -> 10.0.0.69 (webhook pod) TCP [TCP Retransmission] 44772 → 443 [SYN]
192.168.1.43 (apiserver) -> 10.0.0.69 (webhook pod) TCP [TCP Retransmission] 44772 → 443 [SYN]
192.168.1.43 (apiserver) -> 10.0.0.69 (webhook pod) TCP [TCP Retransmission] 44772 → 443 [SYN]
이 문제는 SYN 패킷이 어딘가에서 버려지기 때문에 발생합니다.
원인 1: GKE 프라이빗 클러스터
기본 Helm 구성은 GKE 프라이빗 클러스터에서 작동해야 하지만, securePort를 변경하면 문제가 생길 수 있습니다.
맥락을 위해, 공개 GKE 클러스터(컨트롤 플레인이 모든 TCP 포트에서 포드와 자유롭게 통신할 수 있는)와 달리 프라이빗 GKE 클러스터의 컨트롤 플레인은 TCP 포트 10250과 443을 통해서만 워커 노드의 포드와 통신할 수 있습니다. 이 두 개의 열린 포트는 Service 리소스의 port가 아니라 포드 내부의 containerPort를 말합니다.
작동하려면 Deployment 내부의 containerPort가 10250 또는 443과 일치해야 합니다; containerPort는 Helm 값 webhook.securePort로 구성됩니다. 기본적으로 webhook.securePort는 10250으로 설정됩니다.
containerPort에 문제가 있는지 확인하려면 Service 리소스부터 살펴봅시다:
kubectl get svc -n cert-manager cert-manager-webhook -oyaml
출력을 보면 targetPort가 "https"로 설정되어 있습니다:
apiVersion: v1
kind: Service
metadata:
name: cert-manager-webhook
spec:
ports:
- name: https
port: 443 # ❌ This port is not the cause.
protocol: TCP
targetPort: "https" # 🌟 This port might be the cause.
위 port: 443이 원인이 될 수 없는 이유는 컨트롤 플레인 노드에서도 실행되는 kube-proxy가 webhook의 클러스터 IP를 포드 IP로 변환하고, 위 port: 443도 containerPort의 값으로 변환하기 때문입니다.
타깃 포트 "https" 뒤에 무엇이 있는지 확인하려면 Deployment 리소스를 봅니다:
kubectl get deploy -n cert-manager cert-manager-webhook -oyaml | grep -A3 ports:
출력은 containerPort가 10250으로 설정되지 않았음을 보여줍니다. 즉, Google Cloud에 새 방화벽 규칙을 추가해야 합니다.
ports:
- containerPort: 12345 # 🌟 This port matches neither 10250 nor 443.
name: https
protocol: TCP
정리하면, 위 containerPort가 443 또는 10250이 아니고 containerPort를 10250으로 변경하고 싶지 않다면 새 방화벽 규칙을 추가해야 합니다. Google 문서의 GKE 프라이빗 클러스터에서 방화벽 규칙 추가 (https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters#add_firewall_rules) 섹션을 읽을 수 있습니다.
맥락을 위해 securePort를 443으로 기본 설정하지 않은 이유는 443에 바인딩하면 추가 Linux 기능(NET_BIND_SERVICE)이 하나 더 필요하기 때문입니다; 반면 10250은 추가 기능이 필요하지 않습니다.
원인 2: 커스텀 CNI의 EKS
EKS에서 Weave나 Calico 같은 커스텀 CNI를 사용하는 경우 자체 노드에 있는 Kubernetes API 서버가 webhook 포드에 도달하지 못할 수 있습니다. 이는 EKS에서 컨트롤 플레인을 커스텀 CNI에서 실행하도록 구성할 수 없어서, CNI가 API 서버와 워커 노드에서 실행 중인 포드 사이의 연결을 활성화할 수 없기 때문입니다.
Helm을 사용한다고 가정하면, 해결 방법은 values.yaml 파일에 다음 값을 추가하는 것입니다:
webhook:
hostNetwork: true
securePort: 10260
또는 커맨드라인에서 Helm을 사용한다면 다음 플래그를 사용하세요:
--set webhook.hostNetwork=true --set webhook.securePort=10260
hostNetwork를 true로 설정하면 webhook 포드가 호스트의 네트워크 네임스페이스에서 실행됩니다. 호스트의 네트워크 네임스페이스에서 실행하면 webhook 포드는 노드의 IP를 통해 접근할 수 있게 되어, kube-apiserver가 어떤 포드 IP나 클러스터 IP에도 도달할 수 없는 사실을 우회할 수 있습니다.
securePort를 기본값(10250)에 의존하는 대신 10260으로 설정하면 webhook과 kubelet 사이의 충돌을 방지할 수 있습니다. 모든 Kubernetes 워커 노드에서 실행되고 호스트에서 직접 실행되는 에이전트인 kubelet은 포트 10250을 사용해 kube-apiserver에 내부 API를 노출합니다.
hostnetwork와 securePort가 어떻게 상호 작용하는지 이해하려면 TCP 연결이 어떻게 수립되는지 살펴봐야 합니다. kube-apiserver 프로세스가 webhook 포드에 연결하려고 하면 (CNI 없이도 컨트롤 플레인 노드에서 실행되는) kube-proxy가 개입해 webhook의 클러스터 IP를 webhook의 호스트 IP로 변환합니다:
https://cert-manager-webhook.cert-manager.svc:443/validate
|
|Step 1: resolve to the cluster IP
v
https://10.43.103.211:443/validate
|
|Step 2: send TCP packet
v
src: 172.28.0.1:43021
dst: 10.43.103.211:443
|
|Step 3: kube-proxy rewrite (cluster IP to host IP)
v
src: 172.28.0.1:43021
dst: 172.28.0.2:10260
|
| control-plane node
| (host IP: 172.28.0.1)
------------|--------------------------------------------------
| (host IP: 172.28.0.2)
v worker node
+-------------------+
| webhook pod |
| listens on |
| 172.28.0.2:10260 |
+-------------------+
10250이 기본 securePort로 사용되는 이유는 위의 GKE Private Cluster (/docs/troubleshooting/webhook/#gke-private-cluster) 섹션에 자세히 설명된 대로 GKE Private Cluster의 또 다른 제한 사항을 우회하기 때문입니다.
원인 3: 네트워크 정책, Calico
Helm 차트를 사용하고 webhook.securePort의 기본값(10250)을 사용하며 Calico 같은 네트워크 정책 컨트롤러를 사용한다고 가정하면, API 서버에서 TCP 포트 10250의 webhook 포드로의 트래픽을 허용하는 정책이 존재하는지 확인하세요.
원인 4: EKS와 시큐리티 그룹
Helm 차트를 사용하고 webhook.securePort의 기본값(10250)을 사용한다고 가정하면, AWS 시큐리티 그룹이 컨트롤 플레인의 VPC에서 워커 VPC로 TCP 10250 트래픽을 허용하는지 확인해 보세요.
기타 원인
위의 원인이 모두 적용되지 않으면 webhook에 도달할 수 없는 이유를 알아내야 합니다.
도달 가능성 문제(즉, 패킷이 버려지는)를 디버깅하려면 모든 TCP 홉에서 tcpdump와 함께 Wireshark를 사용할 것을 권장합니다. kube-dns가 작동하지 않을 때 tcpdump와 Wireshark를 사용해 네트워킹 문제를 디버깅하는 방법을 배우려면 Debugging Kubernetes Networking: my kube-dns is not working! (https://maelvls.dev/debugging-kubernetes-networking/) 기사를 참조할 수 있습니다.
오류: x509: certificate is valid for xxx.internal, not cert-manager-webhook.cert-manager.svc (Fargate 포드가 있는 EKS)
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
x509: certificate is valid for ip-192-168-xxx-xxx.xxx.compute.internal,
not cert-manager-webhook.cert-manager.svc
이 문제는 게시판 #3237 (https://github.com/cert-manager/cert-manager/issues/3237) 에 처음 보고되었습니다.
이는 아마 Fargate가 활성화된 EKS에서 실행 중이기 때문입니다. Fargate는 포드당 마이크로VM을 만들고, VM의 커널이 컨테이너를 자체 네임스페이스에서 실행하는 데 사용됩니다. 문제는 각 마이크로VM이 자체 kubelet을 가진다는 점입니다. 다른 Kubernetes 노드와 마찬가지로 VM의 포트 10250은 kubelet 프로세스가 리슨합니다. 그리고 10250은 cert-manager webhook이 리슨하는 포트이기도 합니다.
하지만 그건 문제가 아닙니다: kubelet 프로세스와 cert-manager webhook 프로세스는 두 개의 분리된 네트워크 네임스페이스에서 실행되며 포트가 충돌하지 않습니다. 이는 전통적인 Kubernetes 노드와 Fargate 마이크로VM 내부 모두에서 마찬가지입니다.
API 서버가 Fargate 포드에 접근하려고 할 때 문제가 발생합니다: 마이크로VM의 호스트 net 네임스페이스는 전통적인 포드와의 최대 호환성을 위해 가능한 모든 포트를 포트 포워드하도록 구성되어 있습니다 (Stack Overflow 페이지 EKS Fargate connect to local kubelet (https://stackoverflow.com/questions/66445207) 참조). 하지만 포트 10250은 마이크로VM의 kubelet이 이미 사용하고 있으므로 이 포트에 도달하는 어떤 것도 포트 포워드되지 않고 kubelet에 도달하게 됩니다.
요약하면, cert-manager webhook은 정상으로 보이고 로그에 따르면 포트 10250에서 리슨할 수 있지만, 마이크로VM의 호스트는 10250을 webhook의 net 네임스페이스로 포트 포워드하지 않습니다. 그래서 TLS 핸드셰이크를 할 때 예상치 못한 도메인이 나타난다는 메시지가 보이는 것입니다: cert-manager webhook이 제대로 실행 중이지만 API 서버에 응답하는 것은 kubelet이기 때문입니다.
이는 Fargate 마이크로VM의 제한 사항입니다: 포드의 IP와 노드의 IP가 동일합니다. 전통적인 포드와 같은 경험을 주지만 네트워킹 문제를 제기합니다.
문제를 해결하려면 cert-manager webhook이 리슨하는 포트를 변경하는 것이 요령입니다. Helm을 사용해 webhook.securePort 매개변수를 사용할 수 있습니다:
helm install \
cert-manager oci://quay.io/jetstack/charts/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.21.2 \
--set webhook.securePort=10260
오류: service "cert-managercert-manager-webhook" not found
Error from server (InternalError): error when creating "test-resources.yaml": Internal error occurred:
failed calling webhook "webhook.cert-manager.io": failed to call webhook:
Post "https://cert-managercert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s":
service "cert-managercert-manager-webhook" not found
이 오류는 2개의 GitHub 이슈 (#3195 (https://github.com/jetstack/cert-manager/issues/3195), #4999 (https://github.com/cert-manager/cert-manager/issues/4999)) 에 보고되었습니다.
이 오류의 원인을 알지 못합니다. 이 오류가 발생한다면 위 GitHub 이슈 중 하나에 의견을 남겨주세요.
오류: no endpoints available for service "cert-manager-webhook" (OVHCloud)
Error: INSTALLATION FAILED: Internal error occurred:
failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
no endpoints available for service "cert-manager-webhook"
이 문제는 Slack에 처음 한 번 보고되었습니다 (1 (https://kubernetes.slack.com/archives/C4NV3DWUC/p1634118489064400?thread_ts=1592676867.472700&cid=C4NV3DWUC)) .
이 오류는 드물며 OVHcloud 관리형 Kubernetes 클러스터에서만 나타났습니다. 여기서는 etcd 리소스 할당량이 상당히 낮습니다. etcd는 Kubernetes 리소스(예: 포드와 배포)가 저장되는 데이터베이스입니다. OVHCloud는 etcd에서 리소스가 사용하는 디스크 공간을 제한합니다. 한도에 도달하면 전체 클러스터가 불규칙하게 동작하기 시작하며, 그 증상 중 하나는 kubelet이 Endpoint 리소스를 만들지 않는 것입니다.
실제로 할당량 문제인지 확인하려면 kube-apiserver 로그에서 다음 메시지를 볼 수 있어야 합니다:
rpc error: code = Unknown desc = ETCD storage quota exceeded
rpc error: code = Unknown desc = quota computation: etcdserver: not capable
rpc error: code = Unknown desc = The OVHcloud storage quota has been reached
해결 방법은 OVHCloud의 ETCD Quotas error, troubleshooting (https://docs.ovh.com/gb/en/kubernetes/etcd-quota-error/) 페이지에 설명된 대로 한도 미만으로 내려가기 위해 CertificateRequest 리소스 같은 일부 리소스를 제거하는 것입니다.
오류: x509: certificate has expired or is not yet valid
이 오류 메시지는 Slack에 한 번 보고되었습니다 (1 (https://kubernetes.slack.com/archives/C4NV3DWUC/p1618579222346800)) .
kubectl apply를 사용할 때:
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://kubernetes.default.svc:443/apis/webhook.cert-manager.io/v1beta1/mutations?timeout=30s:
x509: certificate has expired or is not yet valid
알려진 원인 중 하나는 시스템 일시 중지(S3/S4) 또는 VM 라이브 마이그레이션입니다. webhook은 자체 서명 서빙 인증서를 생성하고 자동으로 갱신하지만, cert-manager 1.21 이전에는 갱신 타이머가 시스템 일시 중지 동안 진행을 멈추는 Go의 단조 시계(CLOCK_MONOTONIC)에 의존했습니다. 시스템이 재개되면 타이머가 마감에 도달하지 않아 벽시계 시간이 만료를 지나쳐 진행됐음에도 인증서가 갱신되지 않습니다.
cert-manager 1.20 이하를 실행 중이고 일시 중지에서 재개한 후 또는 VM 마이그레이션 후 이 오류가 발생한다면 cert-manager 1.21로 업그레이드하면 문제가 해결됩니다 (#8464 (https://github.com/cert-manager/cert-manager/pull/8464)) . 해결 방법으로 webhook 포드를 재시작하면 서빙 인증서를 다시 생성하도록 강제됩니다.
오류: net/http: request canceled while waiting for connection
Error from server (InternalError): error when creating "STDIN":
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
이 오류 메시지는 Slack에 한 번 보고되었습니다 (1 (https://kubernetes.slack.com/archives/C4NV3DWUC/p1632849763397100)) .
오류: context deadline exceeded
이 오류 메시지는 GitHub 이슈 (2319 (https://github.com/cert-manager/cert-manager/issues/2319), 2706 (https://github.com/cert-manager/cert-manager/issues/2706) 5189 (https://github.com/cert-manager/cert-manager/issues/5189), 5004 (https://github.com/cert-manager/cert-manager/issues/5004)) 에 보고되었고, Stack Overflow에 한 번 보고되었습니다 (https://stackoverflow.com/questions/72059332/how-can-i-fix-failed-calling-webhook-webhook-cert-manager-io) .
이 오류는 cert-manager 0.12 이상에서 cert-manager를 설치하거나 업그레이드한 후 Issuer 또는 다른 cert-manager 커스텀 리소스를 적용하려고 할 때 나타납니다:
Error from server (InternalError): error when creating "STDIN":
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
context deadline exceeded
ℹ️ cert-manager의 이전 릴리스(0.11 이하)에서는 webhook이 APIService 메커니즘 (https://kubernetes.io/docs/tasks/extend-kubernetes/setup-extension-api-server/) 에 의존했고, 메시지가 조금 달랐지만 원인은 동일했습니다:
Error from server (InternalError): error when creating "STDIN":
Internal error occurred: failed calling webhook "webhook.certmanager.k8s.io":
Post https://kubernetes.default.svc:443/apis/webhook.certmanager.k8s.io/v1beta1/mutations?timeout=30s:
context deadline exceeded
ℹ️ context deadline exceeded 메시지는 cmctl check api를 사용할 때도 나타납니다. 원인은 동일하므로 이 섹션을 계속 읽고 디버깅하면 됩니다.
Not ready: Internal error occurred: failed calling webhook "webhook.cert-manager.io": failed to call webhook:
Post "https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=10s":
context deadline exceeded
context deadline exceeded 메시지의 문제는 HTTP 연결의 어느 부분이 타임아웃됐는지 모호하다는 것입니다. 이 메시지가 나타나면 HTTP 상호 작용의 어느 부분이 타임아웃됐는지 알 수 없습니다. DNS 해석, TCP 핸드셰이크, TLS 핸드셰이크, HTTP 요청 전송 또는 HTTP 응답 수신일 수 있습니다.
ℹ️ 맥락을 위해 위 오류 메시지에서 볼 수 있는 ?timeout=30s 쿼리 매개변수는 API 서버가 webhook을 호출할 때 정하는 타임아웃입니다. 종종 10초 또는 30초로 설정됩니다.
이 문제를 디버깅하는 첫 번째 단계는 cert-manager mutating/validating webhook 구성의 timeoutSeconds 필드가 30초(최대값)로 구성되어 있는지 확인하는 것입니다. 기본적으로 10초로 설정되어 있어 context deadline exceeded가 다른 타임아웃 메시지를 잠재적으로 가릴 수 있습니다. timeoutSeconds 필드의 값을 확인하려면 다음을 실행합니다:
$ kubectl get mutatingwebhookconfigurations,validatingwebhookconfigurations cert-manager-webhook \
-ojsonpath='{.items[*].webhooks[*].timeoutSeconds}'
10 10
이는 두 webhook 모두 10초의 컨텍스트 타임아웃으로 구성되었음을 의미합니다. 30초로 구성하려면 다음을 실행합니다:
kubectl patch mutatingwebhookconfigurations,validatingwebhookconfigurations cert-manager-webhook \
--type=json -p '[{"op": "replace", "path": "/webhooks/0/timeoutSeconds", "value": 30}]'
다음 다이어그램은 30초 후에 던져지는 context deadline exceeded 메시지(바깥 상자) 뒤에 숨겨질 수 있는 세 가지 오류를 보여줍니다:
context deadline exceeded
|
30 seconds |
timeout v
+-------------------------------------------------------------------------+
| |
| i/o timeout |
| | net/http: TLS handshake timeout |
| 10 seconds | | |
| timeout v | |
|------------+ 30 seconds | net/http: request canceled |
|TCP | timeout v while awaiting headers |
|handshake +---------------------+ | |
|------------| TLS | | |
| | handshake +------------+ 10 seconds | |
| +---------------------| sending | timeout v |
| | request +------------+ |
| +------------|receiving |------+ |
| |resp. header| recv.| |
| +------------+ resp.| |
| | body +-----+
| +------|other|
| |logic|
| +-----+
+-------------------------------------------------------------------------+
이 섹션의 나머지 부분에서는 세 가지 "더 구체적인" 오류 중 하나를 트리거하려고 시도할 것입니다:
-
i/o timeout은 TCP 핸드셰이크 타임아웃이며 Kubernetes apiserver의DialTimeout(https://pkg.go.dev/net#DialTimeout) 에서 비롯됩니다. 이름 해석이 원인일 수 있지만, 보통 이 메시지는 API 서버가SYN패킷을 보내고 cert-manager webhook로부터SYN-ACK패킷을 받기 위해 10초를 기다린 후에 나타납니다. -
net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)는 HTTP 응답 타임아웃이며 여기 (https://github.com/kubernetes/kubernetes/blob/abba1492f/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go#L96-L101) 에서 비롯되고 30초로 구성됩니다 (https://github.com/kubernetes/kubernetes/blob/abba1492f/staging/src/k8s.io/apiserver/pkg/util/webhook/webhook.go#L36-L38) . Kubernetes API 서버가 이미 HTTP 요청을 보냈고 HTTP 응답 헤더(예:HTTP/1.1 200 OK)를 기다리고 있습니다. -
net/http: TLS handshake timeout은 TCP 핸드셰이크가 완료된 후 Kubernetes API 서버가 초기 TLS 핸드셰이크 패킷(ClientHello)을 보내고 cert-manager webhook이ServerHello패킷으로 응답하기를 10초 동안 기다릴 때입니다.
이 세 가지 메시지는 두 범주로 나눌 수 있습니다: 연결 문제(SYN이 버려짐)이거나 webhook 문제(즉, TLS 인증서가 잘못되었거나 webhook이 HTTP 응답을 반환하지 않는)입니다:
| 타임아웃 메시지 | 범주 |
| i/o timeout | 연결 문제 |
| net/http: TLS handshake timeout | webhook 쪽 문제 |
| net/http: request canceled while awaiting headers | webhook 쪽 문제 |
첫 번째 단계는 webhook 쪽 문제를 배제하는 것입니다. 셸 세션에서 다음을 실행합니다:
kubectl -n cert-manager port-forward deploy/cert-manager-webhook 10250
다른 셸 세션에서 webhook에 도달할 수 있는지 확인합니다:
curl -vsS --resolve cert-manager-webhook.cert-manager.svc:10250:127.0.0.1 \
--service-name cert-manager-webhook-ca \
--cacert &1 -d@- //; s/
정상 출력은 다음과 같습니다:
POST /validate HTTP/1.1
Host: cert-manager-webhook.cert-manager.svc:10250
User-Agent: curl/7.83.0
Accept: */*
Content-Length: 1299
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Date: Wed, 08 Jun 2022 14:52:21 GMT
Content-Length: 2029
Content-Type: text/plain; charset=utf-8
...
"response": {
"uid": "",
"allowed": true
}
응답이 200 OK를 보여주면 webhook 쪽 문제를 배제할 수 있습니다. 초기 오류 메시지가 x509: certificate signed by unknown authority나 x509: certificate has expired or is not yet valid 같은 apiserver 쪽 문제가 아니라 context deadline exceeded였으므로, 문제가 연결 문제라고 결론지을 수 있습니다: Kubernetes API 서버가 cert-manager webhook과 TCP 연결을 수립할 수 없습니다. 위의 오류: i/o timeout (연결 문제) (/docs/troubleshooting/webhook/#io-timeout) 섹션의 지침에 따라 디버깅을 계속하세요.
오류: net/http: TLS handshake timeout
이 오류 메시지는 1개의 GitHub 이슈 (#2602 (https://github.com/cert-manager/cert-manager/issues/2602)) 에 보고되었습니다.
Error from server (InternalError): error when creating "STDIN":
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
net/http: TLS handshake timeout
위 다이어그램 (/docs/troubleshooting/webhook/#diagram) 을 보면 이 오류 메시지는 Kubernetes API 서버가 cert-manager webhook과 연관된 포드 IP와 TCP 연결을 성공적으로 수립했음을 나타냅니다. TLS 핸드셰이크 타임아웃은 cert-manager webhook 프로세스가 TCP 연결을 끝내는 쪽이 아니라는 뜻입니다: 사이에 ClientHello 패킷 대신 plain HTTP 요청을 기다리는 HTTP 프록시가 있을 것입니다.
이 오류의 원인을 알지 못합니다. 이 오류가 보이면 위 GitHub 이슈에 의견을 남겨주세요.
오류: HTTP probe failed with statuscode: 500
이 오류 메시지는 2개의 GitHub 이슈 (#3185 (https://github.com/cert-manager/cert-manager/issues/3185), #4557 (https://github.com/cert-manager/cert-manager/issues/4557)) 에 보고되었습니다.
이 오류 메시지는 cert-manager webhook의 이벤트로 표시됩니다:
Warning Unhealthy (x13 over 15s) kubelet, node83
Readiness probe failed: HTTP probe failed with statuscode: 500
이 오류의 원인을 알지 못합니다. 이 오류가 보이면 위 GitHub 이슈에 의견을 남겨주세요.
오류: Service Unavailable
이 오류는 1개의 GitHub 이슈 (#4281 (https://github.com/cert-manager/cert-manager/issues/4281)) 에 보고되었습니다.
Error from server (InternalError): error when creating "STDIN": Internal error occurred:
failed calling webhook "webhook.cert-manager.io":
Post "https://my-cert-manager-webhook.default.svc:443/mutate?timeout=10s":
Service Unavailable
위 메시지는 Weave CNI를 사용하는 Kubernetes 클러스터에 나타납니다.
이 오류의 원인을 알지 못합니다. 이 오류가 보이면 위 GitHub 이슈에 의견을 남겨주세요.
오류: failed calling admission webhook: the server is currently unable to handle the request
이 문제는 4개의 GitHub 이슈 (1369 (https://github.com/cert-manager/cert-manager/issues/1369), 1425 (https://github.com/cert-manager/cert-manager/issues/1425) 3542 (https://github.com/cert-manager/cert-manager/issues/3542), 4852 (https://github.com/cert-manager/cert-manager/issues/4852)) 에 보고되었습니다.
Error from server (InternalError): error when creating "test-resources.yaml": Internal error occurred:
failed calling admission webhook "issuers.admission.certmanager.k8s.io":
the server is currently unable to handle the request
이 오류의 원인을 알지 못합니다. 이 오류를 재현할 수 있다면 위 GitHub 이슈 중 하나에 의견을 남겨주세요.
오류: x509: certificate signed by unknown authority
GitHub 이슈 (2602 (https://github.com/cert-manager/cert-manager/issues/2602#issuecomment-606474055)) 에 보고되었습니다.
cert-manager를 설치 또는 업그레이드할 때 cert-manager가 아닌 네임스페이스를 사용하는 경우:
Error: UPGRADE FAILED: release core-l7 failed, and has been rolled back due to atomic being set:
failed to create resource: conversion webhook for cert-manager.io/v1alpha3, Kind=ClusterIssuer failed:
Post https://cert-manager-webhook.core-l7.svc:443/convert?timeout=30s:
x509: certificate signed by unknown authority
Issuer 또는 다른 cert-manager 커스텀 리소스를 만들 때 매우 유사한 오류 메시지가 표시될 수 있습니다:
Internal error occurred: failed calling webhook "webhook.cert-manager.io":
Post https://cert-manager-webhook.cert-manager.svc:443/mutate?timeout=30s:
x509: certificate signed by unknown authority`
cmctl install과 cmctl check api를 사용하면 다음 오류 메시지가 표시될 수 있습니다:
2022/06/06 15:36:30 Not ready: the cert-manager webhook CA bundle is not injected yet
(Internal error occurred: conversion webhook for cert-manager.io/v1alpha2, Kind=Certificate failed:
Post "https://-cert-manager-webhook.cert-manager.svc:443/convert?timeout=30s":
x509: certificate signed by unknown authority)
Helm과 함께 cert-manager 0.14 이하를 사용하고 cert-manager와 다른 네임스페이스에 설치한다면, CRD 매니페스트에 네임스페이스 이름 cert-manager가 하드코딩되어 있었습니다. 하드코딩된 네임스페이스는 다음 어노테이션에서 볼 수 있습니다:
kubectl get crd issuers.cert-manager.io -oyaml | grep inject
다음이 표시됩니다:
cert-manager.io/inject-ca-from-secret: cert-manager/cert-manager-webhook-ca
# ^^^^^^^^^^^^
# hardcoded
참고 1: cert-manager Helm 차트의 이 버그는 cert-manager 0.15에서 수정되었습니다 (https://github.com/cert-manager/cert-manager/commit/f33beefc) .
참고 2: cert-manager 1.6부터 이 어노테이션은 변환(conversion)이 더 이상 필요하지 않으므로 cert-manager CRD에서 더 이상 사용되지 않습니다 (https://github.com/cert-manager/cert-manager/pull/4841) .
여전히 cert-manager 0.14 이하를 사용한다면 해결책은 helm template으로 매니페스트를 렌더링한 다음 어노테이션을 올바른 네임스페이스로 편집하고, kubectl apply로 cert-manager를 설치하는 것입니다.
cert-manager 1.6 이하를 사용한다면, 문제는 cainjector가 cert-manager webhook이 만들고 cert-manager-webhook-ca Secret 리소스에 저장한 자체 서명 인증서를 cert-manager CRD의 spec.caBundle 필드에 주입하려다 멈춰 있을 수 있습니다. 첫 번째 단계는 cainjector가 문제 없이 실행되고 있는지 확인하는 것입니다:
$ kubectl -n cert-manager get pods -l app.kubernetes.io/name=cainjector
NAME READY STATUS RESTARTS AGE
cert-manager-cainjector-5c55bb7cb4-6z4cf 1/1 Running 11 (31h ago) 28d
로그를 보면 리더 선출(leader election)이 작동했는지 알 수 있습니다. 리더 선출 작업이 완료되는 데 최대 1분이 걸릴 수 있습니다.
I0608 start.go:126] "starting" version="v1.8.0" revision="e466a521bc5455def8c224599c6edcd37e86410c"
I0608 leaderelection.go:248] attempting to acquire leader lease kube-system/cert-manager-cainjector-leader-election...
I0608 leaderelection.go:258] successfully acquired lease kube-system/cert-manager-cainjector-leader-election
I0608 controller.go:186] cert-manager/secret/customresourcedefinition/controller/controller-for-secret-customresourcedefinition "msg"="Starting Controller"
I0608 controller.go:186] cert-manager/certificate/customresourcedefinition/controller/controller-for-certificate-customresourcedefinition "msg"="Starting Controller"
I0608 controller.go:220] cert-manager/secret/customresourcedefinition/controller/controller-for-secret-customresourcedefinition "msg"="Starting workers" "worker count"=1
I0608 controller.go:220] cert-manager/certificate/customresourcedefinition/controller/controller-for-certificate-customresourcedefinition "msg"="Starting workers" "worker count"=1
정상 출력에는 다음과 같은 줄이 포함됩니다:
I0608 sources.go:184] cert-manager/secret/customresourcedefinition/generic-inject-reconciler
"msg"="Extracting CA from Secret resource" "resource_name"="issuers.cert-manager.io" "secret"="cert-manager/cert-manager-webhook-ca"
I0608 controller.go:178] cert-manager/secret/customresourcedefinition/generic-inject-reconciler
"msg"="updated object" "resource_name"="issuers.cert-manager.io"
이제 cert-manager webhook이 생성한 Secret 리소스를 로드할 수 없다는 메시지가 있는지 찾아보세요. 나타날 수 있는 두 가지 오류 메시지는 다음과 같습니다:
E0608 sources.go:201] cert-manager/secret/customresourcedefinition/generic-inject-reconciler
"msg"="unable to fetch associated secret" "error"="Secret \"cert-manager-webhook-caq\" not found"
다음 메시지는 어노테이션이 없어 주어진 CRD가 건너뛰어졌음을 나타냅니다. 이 메시지는 무시해도 됩니다:
I0608 controller.go:156] cert-manager/secret/customresourcedefinition/generic-inject-reconciler
"msg"="failed to determine ca data source for injectable" "resource_name"="challenges.acme.cert-manager.io"
cainjector 로그에 문제가 없어 보인다면 validation, mutation, conversion 구성의 spec.caBundle 필드가 올바른지 확인해야 합니다. Kubernetes API 서버는 해당 필드의 내용을 사용해 cert-manager webhook을 신뢰합니다. caBundle에는 cert-manager webhook이 시작될 때 만든 자체 서명 CA가 포함되어 있습니다.
$ kubectl get validatingwebhookconfigurations cert-manager-webhook -ojson | jq '.webhooks[].clientConfig'
{
"caBundle": "LS0tLS1...LS0tLS0K",
"service": {
"name": "cert-manager-webhook",
"namespace": "cert-manager",
"path": "/validate",
"port": 443
}
}
$ kubectl get mutatingwebhookconfigurations cert-manager-webhook -ojson | jq '.webhooks[].clientConfig'
{
"caBundle": "LS0tLS1...RFLS0tLS0K",
"service": {
"name": "cert-manager-webhook",
"namespace": "cert-manager",
"path": "/validate",
"port": 443
}
}
caBundle의 내용을 살펴봅시다:
$ kubectl get mutatingwebhookconfigurations cert-manager-webhook -ojson \
| jq '.webhooks[].clientConfig.caBundle' -r | base64 -d \
| openssl x509 -noout -text -in -
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
ee:8f:4f:c8:55:7b:16:76:d8:6a:a2:e5:94:bc:7c:6b
Signature Algorithm: ecdsa-with-SHA384
Issuer: CN = cert-manager-webhook-ca
Validity
Not Before: May 10 16:13:37 2022 GMT
Not After : May 10 16:13:37 2023 GMT
Subject: CN = cert-manager-webhook-ca
caBundle의 내용이 webhook 연결에 작동하는지 확인해 봅시다:
$ kubectl -n cert-manager get secret cert-manager-webhook-ca -ojsonpath='{.data.ca\.crt}' \
| base64 -d | openssl x509 -noout -text -in -
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
ee:8f:4f:c8:55:7b:16:76:d8:6a:a2:e5:94:bc:7c:6b
Signature Algorithm: ecdsa-with-SHA384
Issuer: CN = cert-manager-webhook-ca
Validity
Not Before: May 10 16:13:37 2022 GMT
Not After : May 10 16:13:37 2023 GMT
Subject: CN = cert-manager-webhook-ca
마지막 테스트는 이 신뢰 번들(trust bundle)을 사용해 webhook에 연결해 보는 것입니다. webhook 포드로 포트 포워딩합시다:
kubectl -n cert-manager port-forward deploy/cert-manager-webhook 10250
다른 셸 세션에서 다음 명령으로 /validate HTTP 요청을 보냅니다:
curl -vsS --resolve cert-manager-webhook.cert-manager.svc:10250:127.0.0.1 \
--service-name cert-manager-webhook-ca \
--cacert &1 -d@- //; s/
성공적인 HTTP 요청과 응답이 보여야 합니다:
POST /validate HTTP/1.1
Host: cert-manager-webhook.cert-manager.svc:10250
User-Agent: curl/7.83.0
Accept: */*
Content-Length: 1299
Content-Type: application/x-www-form-urlencoded
HTTP/1.1 200 OK
Date: Wed, 08 Jun 2022 16:20:45 GMT
Content-Length: 2029
Content-Type: text/plain; charset=utf-8
...
오류: cluster scoped resource "mutatingwebhookconfigurations/" is managed and access is denied
이 메시지는 GitHub 이슈 3717 (https://github.com/cert-manager/cert-manager/issues/3717) 에 보고되었습니다.
GKE Autopilot에 cert-manager를 설치하는 동안 다음 메시지가 표시됩니다:
Error: rendered manifests contain a resource that already exists. Unable to continue with install:
could not get information about the resource:
mutatingwebhookconfigurations.admissionregistration.k8s.io "cert-manager-webhook" is forbidden:
User "XXXX" cannot get resource "mutatingwebhookconfigurations" in API group "admissionregistration.k8s.io" at the cluster scope:
GKEAutopilot authz: cluster scoped resource "mutatingwebhookconfigurations/" is managed and access is denied
이 오류 메시지는 GKE Autopilot과 함께 Kubernetes 1.20 이하를 사용할 때 나타납니다. GKE Autopilot의 mutating admission webhook 제한 (https://github.com/cert-manager/cert-manager/issues/3717) 때문입니다.
2021년 10월 기준 "rapid" Autopilot 릴리스 채널이 Kubernetes 마스터용 1.21 버전을 배포했습니다. Helm 차트를 통한 설치는 오류 메시지로 끝날 수 있지만 일부 사용자에 따르면 cert-manager는 작동한다고 보고되었습니다. 피드백과 PR을 환영합니다.
오류: the namespace "kube-system" is managed and the request's verb "create" is denied
Helm으로 GKE Autopilot에 cert-manager를 설치할 때 다음 오류 메시지가 표시됩니다:
Not ready: the cert-manager webhook CA bundle is not injected yet
이 실패 후에도 세 개의 포드가 정상적으로 실행되는 것을 볼 수 있어야 합니다:
$ kubectl get pods -n cert-manager
NAME READY STATUS RESTARTS AGE
cert-manager-76578c9687-24kmr 1/1 Running 0 47m
cert-manager-cainjector-b7d47f746-4799n 1/1 Running 0 47m
cert-manager-webhook-7f788c5b6-mspnt 1/1 Running 0 47m
하지만 로그 중 하나를 보면 다음 오류 메시지가 표시됩니다:
E0425 leaderelection.go:334] error initially creating leader election record:
leases.coordination.k8s.io is forbidden: User "system:serviceaccount:cert-manager:cert-manager-webhook"
cannot create resource "leases" in API group "coordination.k8s.io" in the namespace "kube-system":
GKEAutopilot authz: the namespace "kube-system" is managed and the request's verb "create" is denied
이는 GKE Autopilot의 제한 사항 때문입니다. kube-system 네임스페이스에 리소스를 만들 수 없으며, cert-manager는 리더 선출을 관리하기 위해 잘 알려진 kube-system을 사용합니다. 이 제한을 우회하려면 Helm에 리더 선출용으로 다른 네임스페이스를 사용하라고 지시할 수 있습니다:
helm install cert-manager oci://quay.io/jetstack/charts/cert-manager \
--version v1.21.2 \
--namespace cert-manager --create-namespace \
--set global.leaderElection.namespace=cert-manager