Repository: kubernetes-sigs/external-dns (language: go)

Issue:
Helm Chart: Allow specifying init containers to Deployment spec.
<!-- Please only use this template for submitting enhancement requests. This can be something like a new provider or a new gateway.  -->

**What would you like to be added**:

Allow the helm chart to accept an initContainers option that will be injected into the Deployment. 

**Why is this needed**:

We use AWS Route53, and are running into the Throttling issues. One of the suggestions in https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials/aws.md#throttling is to add some random jitter on startup, however the helm chart doesn't allow specifying initContainers. 


Discussion / hints:

Fix patch:
diff --git a/charts/external-dns/CHANGELOG.md b/charts/external-dns/CHANGELOG.md
index 5c18948e0d..6e46d9f928 100644
--- a/charts/external-dns/CHANGELOG.md
+++ b/charts/external-dns/CHANGELOG.md
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 
 - Disallowed privilege escalation in container security context and set the seccomp profile type to `RuntimeDefault`. ([#3689](https://github.com/kubernetes-sigs/external-dns/pull/3689)) [@nrvnrvn](https://github.com/nrvnrvn)
 - Added RBAC for Traefik to ClusterRole. ([#3325](https://github.com/kubernetes-sigs/external-dns/pull/3325)) [@ThomasK33](https://github.com/thomask33)
+- Support initContainers. ([#3325](https://github.com/kubernetes-sigs/external-dns/pull/3838)) [@calvinbui](https://github.com/calvinbui)
 
 ## [v1.13.0] - 2023-03-30
 
diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md
index 145cc78037..4ea6f4fe74 100644
--- a/charts/external-dns/README.md
+++ b/charts/external-dns/README.md
@@ -34,6 +34,7 @@ The following table lists the configurable parameters of the _ExternalDNS_ chart
 | `serviceAccount.name`              | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the full name template.                                                                                                                                                                                       | `""`                                        |
 | `rbac.create`                      | If `true`, create the RBAC resources.                                                                                                                                                                                                                                                                                 | `true`                                      |
 | `rbac.additionalPermissions`       | Additional permissions to be added to the cluster role.                                                                                                                                                                                                                                                               | `{}`                                        |
+| `initContainers`                   | Add init containers to the pod.                                                                                                                                                                                                                                                                                       | `[]`                                        |
 | `deploymentAnnotations`            | Annotations to add to the Deployment.                                                                                                                                                                                                                                                                                 | `{}`                                        |
 | `podLabels`                        | Labels to add to the pod.                                                                                                                                                                                                                                                                                             | `{}`                                        |
 | `podAnnotations`                   | Annotations to add to the pod.                                                                                                                                                                                                                                                                                        | `{}`                                        |
diff --git a/charts/external-dns/templates/deployment.yaml b/charts/external-dns/templates/deployment.yaml
index a175dbf643..c05d50df42 100644
--- a/charts/external-dns/templates/deployment.yaml
+++ b/charts/external-dns/templates/deployment.yaml
@@ -54,6 +54,10 @@ spec:
       {{- with .Values.dnsPolicy }}
       dnsPolicy: {{ . }}
       {{- end }}
+      {{- with .Values.initContainers }}
+      initContainers:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
       containers:
         - name: external-dns
           {{- with .Values.securityContext }}
diff --git a/charts/external-dns/values.yaml b/charts/external-dns/values.yaml
index 5a2d22d9b2..fdcd421ac4 100644
--- a/charts/external-dns/values.yaml
+++ b/charts/external-dns/values.yaml
@@ -31,6 +31,8 @@ rbac:
   create: true
   additionalPermissions: []
 
+initContainers: []
+
 # Annotations to add to the Deployment
 deploymentAnnotations: {}
 


Test patch: