[helm] Move cert-manager.io/disable-validation to values

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke 2024-01-13 16:21:49 +01:00
parent 64909f5688
commit 7fdea152eb
No known key found for this signature in database
3 changed files with 26 additions and 24 deletions

View File

@ -15,6 +15,10 @@ metadata:
{{- end }}
webhooks:
- name: webhook.cert-manager.io
{{- with .Values.webhook.mutatingWebhookConfiguration.namespaceSelector }}
namespaceSelector:
{{- toYaml . | nindent 6 }}
{{- end }}
rules:
- apiGroups:
- "cert-manager.io"
@ -41,8 +45,4 @@ webhooks:
name: {{ template "webhook.fullname" . }}
namespace: {{ include "cert-manager.namespace" . }}
path: /mutate
{{- end }}
namespaceSelector:
{{- with .Values.webhook.webhookConfigurationNamespaceSelector }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}

View File

@ -15,18 +15,10 @@ metadata:
{{- end }}
webhooks:
- name: webhook.cert-manager.io
{{- with .Values.webhook.validatingWebhookConfiguration.namespaceSelector }}
namespaceSelector:
{{- with (omit .Values.webhook.webhookConfigurationNamespaceSelector "matchExpressions") }}
{{- toYaml . | nindent 6 }}
{{- end }}
matchExpressions:
- key: "cert-manager.io/disable-validation"
operator: "NotIn"
values:
- "true"
{{- with .Values.webhook.webhookConfigurationNamespaceSelector.matchExpressions }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
rules:
- apiGroups:
- "cert-manager.io"

View File

@ -401,15 +401,25 @@ webhook:
# Optional additional annotations to add to the webhook ValidatingWebhookConfiguration
# validatingWebhookConfigurationAnnotations: {}
# Configure spec.namespaceSelector for mutating and validating webhooks.
webhookConfigurationNamespaceSelector: {}
# matchLabels:
# key: value
# matchExpressions:
# - key: kubernetes.io/metadata.name
# operator: NotIn
# values:
# - kube-system
validatingWebhookConfiguration:
# Configure spec.namespaceSelector for validating webhooks.
namespaceSelector:
matchExpressions:
- key: "cert-manager.io/disable-validation"
operator: "NotIn"
values:
- "true"
mutatingWebhookConfiguration:
# Configure spec.namespaceSelector for mutating webhooks.
namespaceSelector: {}
# matchLabels:
# key: value
# matchExpressions:
# - key: kubernetes.io/metadata.name
# operator: NotIn
# values:
# - kube-system
# Additional command line flags to pass to cert-manager webhook binary.