Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/external-dns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add value `.service.enabled` to enable the creation of the Kubernetes service.
- Add value `replicaCount` to set the number of `external-dns` replicas (bounded to `0` or `1`, since external-dns does not support leader election). [#6503](https://github.com/kubernetes-sigs/external-dns/pull/6503) _@yugstar_
- Add value `.crds.install` to control whether the `DNSEndpoint` `CustomResourceDefinition` is installed. Defaults to `true`; set to `false` on all but one release when running multiple `external-dns` releases (e.g. one per provider) in the same cluster to avoid the CRD being installed more than once. Note: because the CRD is now rendered from `templates/`, Helm may attempt to update it on upgrade and will delete it on uninstall unless it is marked with `helm.sh/resource-policy: keep`.

### Changed

Expand Down
1 change: 1 addition & 0 deletions charts/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ If `namespaced` is set to `true`, please ensure that `sources` only contains sup
| annotationPrefix | string | `nil` | Annotation prefix for external-dns annotations (useful for split horizon DNS with multiple instances). |
| automountServiceAccountToken | bool | `true` | Set this to `false` to [opt out of API credential automounting](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#opt-out-of-api-credential-automounting) for the `Pod`. |
| commonLabels | object | `{}` | Labels to add to all chart resources. |
| crds.install | bool | `true` | If `true`, install the `DNSEndpoint` `CustomResourceDefinition`. Set this to `false` on all but one release when running multiple `external-dns` releases (e.g. one per provider) in the same cluster, to avoid the CRD being installed more than once. |
| deploymentAnnotations | object | `{}` | Annotations to add to the `Deployment`. |
| deploymentStrategy | object | `{"type":"Recreate"}` | [Deployment Strategy](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy). |
| dnsConfig | object | `nil` | [DNS config](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config) for the pod, if not set the default will be used. |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{{- if .Values.crds.install -}}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
api-approved.kubernetes.io: https://github.com/kubernetes-sigs/external-dns/pull/2007
name: dnsendpoints.externaldns.k8s.io
labels:
{{- include "external-dns.labels" . | nindent 4 }}
spec:
group: externaldns.k8s.io
names:
Expand Down Expand Up @@ -94,3 +97,4 @@ spec:
storage: true
subresources:
status: {}
{{- end }}
25 changes: 25 additions & 0 deletions charts/external-dns/tests/crds_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
suite: CRD configuration
set:
policy: upsert-only
templates:
- dnsendpoint-crd.yaml
release:
namespace: default
tests:
- it: should install the DNSEndpoint CRD by default
asserts:
- hasDocuments:
count: 1
- isKind:
of: CustomResourceDefinition
- equal:
path: metadata.name
value: dnsendpoints.externaldns.k8s.io

- it: should not install the CRD when crds.install is false
set:
crds:
install: false
asserts:
- hasDocuments:
count: 0
9 changes: 9 additions & 0 deletions charts/external-dns/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
"description": "Labels to add to all chart resources.",
"type": "object"
},
"crds": {
"type": "object",
"properties": {
"install": {
"description": "If `true`, install the `DNSEndpoint` `CustomResourceDefinition`. Set this to `false` on all but one release when running multiple `external-dns` releases (e.g. one per provider) in the same cluster, to avoid the CRD being installed more than once.",
"type": "boolean"
}
}
},
"deploymentAnnotations": {
"description": "Annotations to add to the `Deployment`.",
"type": "object"
Expand Down
4 changes: 4 additions & 0 deletions charts/external-dns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ rbac: # @schema additionalProperties: true
# -- Additional rules to add to the `ClusterRole`.
additionalPermissions: []

crds:
# -- If `true`, install the `DNSEndpoint` `CustomResourceDefinition`. Set this to `false` on all but one release when running multiple `external-dns` releases (e.g. one per provider) in the same cluster, to avoid the CRD being installed more than once.
install: true

# -- Number of replicas of the `external-dns` `Deployment`. external-dns does not
# support leader election, so this must be `0` or `1` to avoid duplicate or
# conflicting DNS record updates. Set to `0` to scale the `Deployment` down.
Expand Down