From e0fce4ef618b242ad97e2eea596ae67983c47c34 Mon Sep 17 00:00:00 2001 From: Eric Ace <24485843+aceeric@users.noreply.github.com> Date: Sun, 27 Jul 2025 16:11:33 -0400 Subject: [PATCH] Finalize schema - passes unit tests --- charts/external-dns/README.md | 4 +++- charts/external-dns/templates/deployment.yaml | 4 +++- charts/external-dns/values.schema.json | 19 +++++++++++++++---- charts/external-dns/values.yaml | 16 +++++++++------- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 7c1a3a334..300eac59e 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -130,9 +130,11 @@ If `namespaced` is set to `true`, please ensure that `sources` my only contains | podSecurityContext | object | See _values.yaml_ | [Pod security context](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#podsecuritycontext-v1-core), this supports full customisation. | | policy | string | `"upsert-only"` | How DNS records are synchronized between sources and providers; available values are `create-only`, `sync`, & `upsert-only`. | | priorityClassName | string | `nil` | Priority class name for the `Pod`. | +| provider | object | `{"name":"aws","webhook":{"readTimeout":null,"sidecar":{"args":[],"env":[],"extraVolumeMounts":[],"image":{"pullPolicy":"IfNotPresent","repository":null,"tag":null},"livenessProbe":{"failureThreshold":2,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"readinessProbe":{"failureThreshold":6,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":5,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{},"securityContext":{},"service":{"port":8080},"serviceMonitor":{"bearerTokenFile":null,"interval":null,"metricRelabelings":[],"relabelings":[],"scheme":null,"scrapeTimeout":null,"tlsConfig":{}}},"url":null,"writeTimeout":null}}` | Provider configuration | | provider.name | string | `"aws"` | _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). | +| provider.webhook | object | `{"readTimeout":null,"sidecar":{"args":[],"env":[],"extraVolumeMounts":[],"image":{"pullPolicy":"IfNotPresent","repository":null,"tag":null},"livenessProbe":{"failureThreshold":2,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"readinessProbe":{"failureThreshold":6,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":5,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{},"securityContext":{},"service":{"port":8080},"serviceMonitor":{"bearerTokenFile":null,"interval":null,"metricRelabelings":[],"relabelings":[],"scheme":null,"scrapeTimeout":null,"tlsConfig":{}}},"url":null,"writeTimeout":null}` | Webhook configuration | | provider.webhook.readTimeout | integer | `nil` | Webhook read timeout | -| provider.webhook.sidecar | object | `{"args":[],"env":[],"extraVolumeMounts":[],"image":{"pullPolicy":"IfNotPresent","repository":null,"tag":null},"livenessProbe":{"failureThreshold":2,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"readinessProbe":{"failureThreshold":6,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":5,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{},"securityContext":{},"service":{"port":8080},"serviceMonitor":{"bearerTokenFile":null,"interval":null,"metricRelabelings":[],"relabelings":[],"scheme":null,"scrapeTimeout":null,"tlsConfig":{}}}` | Webhook sidecar container | +| provider.webhook.sidecar | object | `{"args":[],"env":[],"extraVolumeMounts":[],"image":{"pullPolicy":"IfNotPresent","repository":null,"tag":null},"livenessProbe":{"failureThreshold":2,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":10,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"readinessProbe":{"failureThreshold":6,"httpGet":{"path":"/healthz","port":"http-webhook"},"initialDelaySeconds":5,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":5},"resources":{},"securityContext":{},"service":{"port":8080},"serviceMonitor":{"bearerTokenFile":null,"interval":null,"metricRelabelings":[],"relabelings":[],"scheme":null,"scrapeTimeout":null,"tlsConfig":{}}}` | Webhook sidecar container configuration | | provider.webhook.sidecar.args | list | `[]` | Extra arguments to provide for the `webhook` container. | | provider.webhook.sidecar.env | list | `[]` | [Environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) for the `webhook` container. | | provider.webhook.sidecar.extraVolumeMounts | list | `[]` | Extra [volume mounts](https://kubernetes.io/docs/concepts/storage/volumes/) for the `webhook` container. | diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml index cce68d164..c57ba4857 100644 --- a/charts/external-dns/templates/deployment.yaml +++ b/charts/external-dns/templates/deployment.yaml @@ -127,7 +127,8 @@ spec: - --managed-record-types={{ . }} {{- end }} - --provider={{ $providerName }} - {{- if .Values.provider.webhook.readTimeout }} + {{- if kindIs "map" .Values.provider }} + {{- if .Values.provider.webhook.readTimeout }} - --webhook-provider-read-timeout={{ .Values.provider.webhook.readTimeout }} {{- end }} {{- if .Values.provider.webhook.writeTimeout }} @@ -136,6 +137,7 @@ spec: {{- if .Values.provider.webhook.url }} - --webhook-provider-url={{ .Values.provider.webhook.url }} {{- end }} + {{- end }} {{- if kindIs "map" .Values.extraArgs }} {{- range $key, $value := .Values.extraArgs }} {{- if not (kindIs "invalid" $value) }} diff --git a/charts/external-dns/values.schema.json b/charts/external-dns/values.schema.json index ced201d33..049e31136 100644 --- a/charts/external-dns/values.schema.json +++ b/charts/external-dns/values.schema.json @@ -1153,6 +1153,7 @@ ] }, "provider": { + "description": "Provider configuration", "type": [ "object", "string" @@ -1160,10 +1161,17 @@ "properties": { "name": { "description": "_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).", - "type": "string" + "type": [ + "string", + "null" + ] }, "webhook": { - "type": "object", + "description": "Webhook configuration", + "type": [ + "object", + "null" + ], "properties": { "readTimeout": { "description": "Webhook read timeout", @@ -1173,8 +1181,11 @@ ] }, "sidecar": { - "description": "Webhook sidecar container", - "type": "object", + "description": "Webhook sidecar container configuration", + "type": [ + "object", + "null" + ], "properties": { "args": { "description": "Extra arguments to provide for the `webhook` container.", diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml index 4abfecd33..5add96c9d 100644 --- a/charts/external-dns/values.yaml +++ b/charts/external-dns/values.yaml @@ -240,18 +240,20 @@ labelFilter: # @schema type: [string,null]; default: null # -- Record types to manage (default: A, AAAA, CNAME) managedRecordTypes: [] # @schema type: [array, null]; item: string; uniqueItems: true +# -- (object) Provider configuration 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: # @schema type: [object] + name: aws # @schema type:[string, null] + # -- (object) Webhook configuration + webhook: # @schema type: [object, null] # -- (string) Webhook URL - url: # @schema type:[string, null] + url: # @schema type:[string, null]; default: null # -- (integer) Webhook read timeout - readTimeout: # @schema type:[integer, null] + readTimeout: # @schema type:[integer, null]; default: null # -- (integer) Webhook write timeout - writeTimeout: # @schema type:[integer, null] - # -- Webhook sidecar container - sidecar: # @schema type: [object] + writeTimeout: # @schema type:[integer, null]; default: null + # -- (object) Webhook sidecar container configuration + sidecar: # @schema type: [object, null]; default: null image: # -- (string) Image repository for the `webhook` container. repository: # @schema type:[string, null]; default: null