From fe7054ac97061f2747bcdf57c6ce16a035b8a136 Mon Sep 17 00:00:00 2001 From: Eric Ace <24485843+aceeric@users.noreply.github.com> Date: Sat, 28 Jun 2025 20:36:52 -0400 Subject: [PATCH] Allow the webhook sidecar to be optional in case the webhook is outside the cluster --- charts/external-dns/README.md | 1 + charts/external-dns/templates/deployment.yaml | 2 ++ charts/external-dns/values.schema.json | 4 ++++ charts/external-dns/values.yaml | 2 ++ 4 files changed, 9 insertions(+) diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 33286d914..1a9cfcc94 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -143,6 +143,7 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | provider.webhook.securityContext | object | See _values.yaml_ | [Pod security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) for the `webhook` container. | | provider.webhook.service.port | int | `8080` | Webhook exposed HTTP port for the service. | | provider.webhook.serviceMonitor | object | See _values.yaml_ | Optional [Service Monitor](https://prometheus-operator.dev/docs/operator/design/#servicemonitor) configuration for the `webhook` container. | +| provider.webhook.sidecar | bool | `true` | If false, then do not add a webhook sidecar to the `external-dns` deployment. | | rbac.additionalPermissions | list | `[]` | Additional rules to add to the `ClusterRole`. | | rbac.create | bool | `true` | If `true`, create a `ClusterRole` & `ClusterRoleBinding` with access to the Kubernetes API. | | readinessProbe | object | See _values.yaml_ | [Readiness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) configuration for the `external-dns` container. | diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index 7db118370..2229616fd 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -173,6 +173,7 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- if eq $providerName "webhook" }} + {{- if .Values.provider.webhook.sidecar }} {{- with .Values.provider.webhook }} - name: webhook image: {{ include "external-dns.webhookImage" . }} @@ -209,6 +210,7 @@ spec: {{- end }} {{- end }} {{- end }} + {{- end }} {{- if or .Values.secretConfiguration.enabled .Values.extraVolumes }} volumes: {{- if .Values.secretConfiguration.enabled }} diff --git a/charts/external-dns/values.schema.json b/charts/external-dns/values.schema.json index 75e7fdd42..ee8fe4ea7 100644 --- a/charts/external-dns/values.schema.json +++ b/charts/external-dns/values.schema.json @@ -507,6 +507,10 @@ "type": "object" } } + }, + "sidecar": { + "description": "If false, then do not add a webhook sidecar to the external-dns deployment.", + "type": "boolean" } } } diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index dc5ec8d1e..e2720cb25 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -244,6 +244,8 @@ provider: # @schema type: [object, string]; # -- _ExternalDNS_ provider name; for the available providers and how to configure them see [README](https://github.com/kubernetes-sigs/external-dns/blob/master/charts/external-dns/README.md#providers). name: aws webhook: + # -- (bool) If false, then do not add a webhook sidecar to the `external-dns` deployment. + sidecar: true image: # -- (string) Image repository for the `webhook` container. repository: # @schema type:[string, null]; default: null