From 7355174f216eabee85e049c384c859d0c12f151f Mon Sep 17 00:00:00 2001 From: Katarzyna Kujawa Date: Tue, 23 Mar 2021 10:40:17 +0100 Subject: [PATCH] chart: expose webhook configuration: - failurePolicy, - reinvocationPolicy - objectSelector - namespaceSelector --- .../_operator-webhook-with-cert-manager.tpl | 7 ++++++- .../templates/_operator-webhook.tpl | 9 +++++++-- helm/tailing-sidecar-operator/values.yaml | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/helm/tailing-sidecar-operator/templates/_operator-webhook-with-cert-manager.tpl b/helm/tailing-sidecar-operator/templates/_operator-webhook-with-cert-manager.tpl index ff2b5b08..97b6ea72 100644 --- a/helm/tailing-sidecar-operator/templates/_operator-webhook-with-cert-manager.tpl +++ b/helm/tailing-sidecar-operator/templates/_operator-webhook-with-cert-manager.tpl @@ -13,7 +13,12 @@ webhooks: name: {{ include "tailing-sidecar-operator.fullname" . }} namespace: {{ .Release.Namespace }} path: /add-tailing-sidecars-v1-pod - failurePolicy: Ignore + failurePolicy: {{ .Values.webhook.failurePolicy }} + reinvocationPolicy: {{ .Values.webhook.reinvocationPolicy }} + objectSelector: + {{- toYaml .Values.webhook.objectSelector | nindent 4 }} + namespaceSelector: + {{- toYaml .Values.webhook.namespaceSelector | nindent 4 }} name: tailing-sidecar.sumologic.com rules: - apiGroups: diff --git a/helm/tailing-sidecar-operator/templates/_operator-webhook.tpl b/helm/tailing-sidecar-operator/templates/_operator-webhook.tpl index 0f9ec821..ae8734a3 100644 --- a/helm/tailing-sidecar-operator/templates/_operator-webhook.tpl +++ b/helm/tailing-sidecar-operator/templates/_operator-webhook.tpl @@ -14,8 +14,13 @@ webhooks: name: {{ include "tailing-sidecar-operator.fullname" . }} namespace: {{ .Release.Namespace }} path: /add-tailing-sidecars-v1-pod - failurePolicy: Ignore - name: tailing-sidecar.sumologic.com + failurePolicy: {{ .Values.webhook.failurePolicy }} + reinvocationPolicy: {{ .Values.webhook.reinvocationPolicy }} + objectSelector: + {{- toYaml .Values.webhook.objectSelector | nindent 4 }} + namespaceSelector: + {{- toYaml .Values.webhook.namespaceSelector | nindent 4 }} + name: tailing-sidecar.sumologic.com rules: - apiGroups: - "" diff --git a/helm/tailing-sidecar-operator/values.yaml b/helm/tailing-sidecar-operator/values.yaml index 6edcfb93..0b072085 100644 --- a/helm/tailing-sidecar-operator/values.yaml +++ b/helm/tailing-sidecar-operator/values.yaml @@ -19,5 +19,20 @@ sidecar: repository: ghcr.io/sumologic/tailing-sidecar tag: 0.2.0 +# Configuration for MutatingWebhook which is used by tailing sidecar operator +# for details please see Kubernetes API Reference Docs +# e.g. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#mutatingwebhookconfiguration-v1-admissionregistration-k8s-io +webhook: + failurePolicy: Ignore + reinvocationPolicy: IfNeeded + + objectSelector: {} + # matchLabels: + # tailing-sidecar: "true" + + namespaceSelector: {} + # matchLabels: + # tailing-sidecar: "true" + certManager: enabled: false