diff --git a/charts/mysql-operator/templates/deployment.yaml b/charts/mysql-operator/templates/deployment.yaml index f0ffa561..3f2cb0f6 100644 --- a/charts/mysql-operator/templates/deployment.yaml +++ b/charts/mysql-operator/templates/deployment.yaml @@ -21,6 +21,7 @@ spec: spec: securityContext: runAsNonRoot: true + {{- if .Values.manager.enableWebhooks }} volumes: - name: cert secret: @@ -54,6 +55,7 @@ spec: - containerPort: 9443 name: webhook-server protocol: TCP + {{- if .Values.manager.enableWebhooks }} volumeMounts: - name: cert mountPath: /tmp/k8s-webhook-server/serving-certs/ @@ -75,8 +77,8 @@ spec: env: - name: IMAGE_PREFIX value: {{ .Values.imagePrefix }} - - name: ENABLED_WEBHOOKS - value: {{ .Values.manager.enabledWebhooks | quote }} + - name: ENABLE_WEBHOOKS + value: {{ .Values.manager.enableWebhooks | quote }} securityContext: allowPrivilegeEscalation: false livenessProbe: diff --git a/charts/mysql-operator/templates/webhook_configuration.yaml b/charts/mysql-operator/templates/webhook_configuration.yaml index 96d966f6..8eb1ca8f 100644 --- a/charts/mysql-operator/templates/webhook_configuration.yaml +++ b/charts/mysql-operator/templates/webhook_configuration.yaml @@ -1,3 +1,4 @@ +{{- if .Values.manager.enableWebhooks }} {{- $certManagerEnabled := .Values.webhook.certManager.enabled -}} {{- $caCertPEM := include "webhook.caBundleCertPEM" . -}} {{- $tlsCertPEM := include "webhook.certPEM" . -}} @@ -71,3 +72,4 @@ data: tls.crt: {{ b64enc $tlsCertPEM }} tls.key: {{ b64enc $tlsKeyPEM }} {{- end }} +{{- end }} diff --git a/charts/mysql-operator/values.yaml b/charts/mysql-operator/values.yaml index b0abac3b..349b21dc 100644 --- a/charts/mysql-operator/values.yaml +++ b/charts/mysql-operator/values.yaml @@ -22,7 +22,7 @@ tolerationSeconds: 30 manager: image: radondb/mysql-operator tag: v2.2.0 - enabledWebhooks: true + enableWebhooks: true resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little