From 42b2dfd5ce797a152f9aeb91f5b4b2ee3d4f147a Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Fri, 6 Mar 2020 15:31:52 +0000 Subject: [PATCH] Add empty caBundle field to webhooks on Kubernetes 1.12 and below Signed-off-by: James Munnelly --- .../cert-manager/templates/webhook-mutating-webhook.yaml | 5 +++++ .../cert-manager/templates/webhook-validating-webhook.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml index 7852dd894..5bc1878c3 100644 --- a/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-mutating-webhook.yaml @@ -27,6 +27,11 @@ webhooks: failurePolicy: Fail sideEffects: None clientConfig: +{{- if (semverCompare "<=1.12-0" .Capabilities.KubeVersion.GitVersion) }} + # Set caBundle to empty to avoid https://github.com/kubernetes/kubernetes/pull/70138 + # in Kubernetes 1.12 and below. + caBundle: "" +{{- end }} service: name: {{ .Values.webhook.serviceName }} namespace: {{ .Release.Namespace | quote }} diff --git a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml index f709692f5..9978da8a3 100644 --- a/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml +++ b/deploy/charts/cert-manager/templates/webhook-validating-webhook.yaml @@ -37,6 +37,11 @@ webhooks: failurePolicy: Fail sideEffects: None clientConfig: +{{- if (semverCompare "<=1.12-0" .Capabilities.KubeVersion.GitVersion) }} + # Set caBundle to empty to avoid https://github.com/kubernetes/kubernetes/pull/70138 + # in Kubernetes 1.12 and below. + caBundle: "" +{{- end }} service: name: {{ .Values.webhook.serviceName }} namespace: {{ .Release.Namespace | quote }}