From c35d92ab081507822d6ba2b4d8f3ee589dabb56f Mon Sep 17 00:00:00 2001 From: Stevo Slavic Date: Wed, 7 May 2025 17:28:55 +0200 Subject: [PATCH] feat(chart): support configuring dnsConfig Signed-off-by: Stevo Slavic --- helm/aws-load-balancer-controller/README.md | 1 + .../templates/deployment.yaml | 4 ++++ helm/aws-load-balancer-controller/test.yaml | 17 +++++++++++++++++ helm/aws-load-balancer-controller/values.yaml | 14 ++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/helm/aws-load-balancer-controller/README.md b/helm/aws-load-balancer-controller/README.md index 6da919857e..16e0b623ad 100644 --- a/helm/aws-load-balancer-controller/README.md +++ b/helm/aws-load-balancer-controller/README.md @@ -249,6 +249,7 @@ The default values set by the application itself can be confirmed [here](https:/ | `envFrom` | Environment variables to set for aws-load-balancer-controller pod from configMap or Secret | None | | `envSecretName` | AWS credentials as environment variables from Secret (Secret keys `key_id` and `access_key`). | None | | `hostNetwork` | If `true`, use hostNetwork | `false` | +| `dnsConfig` | Set dnsConfig if required | `{}` | | `dnsPolicy` | Set dnsPolicy if required | `ClusterFirst` | | `extraVolumeMounts` | Extra volume mounts for the pod | `[]` | | `extraVolumes` | Extra volumes for the pod | `[]` | diff --git a/helm/aws-load-balancer-controller/templates/deployment.yaml b/helm/aws-load-balancer-controller/templates/deployment.yaml index 42e6db5188..1152958b2a 100644 --- a/helm/aws-load-balancer-controller/templates/deployment.yaml +++ b/helm/aws-load-balancer-controller/templates/deployment.yaml @@ -58,6 +58,10 @@ spec: {{- if .Values.hostNetwork }} hostNetwork: true {{- end }} + {{- with .Values.dnsConfig }} + dnsConfig: + {{- toYaml . | nindent 8 }} + {{- end }} {{- if .Values.dnsPolicy }} dnsPolicy: {{ .Values.dnsPolicy }} {{- end }} diff --git a/helm/aws-load-balancer-controller/test.yaml b/helm/aws-load-balancer-controller/test.yaml index 892691a613..79a7b93653 100644 --- a/helm/aws-load-balancer-controller/test.yaml +++ b/helm/aws-load-balancer-controller/test.yaml @@ -243,6 +243,23 @@ env: # recommended if using the Amazon VPC CNI plugin. hostNetwork: false +# Specifies the dnsConfig that should be used for pods in the deployment +# +# Tuning dnsConfig specifically ndots may be used to reduce unnecessary DNS query expansion over search domains, +# e.g. reduce ndots to avoid having requests for EC2 `ec2.eu-west-2.amazonaws.com` with default ndots of 5 get expanded to +# `ec2.eu-west-2.amazonaws.com.eu-west-2.compute.internal`. +# See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config +dnsConfig: {} + # nameservers: + # - 1.2.3.4 + # searches: + # - ns1.svc.cluster-domain.example + # - my.dns.search.suffix + # options: + # - name: ndots + # value: "2" + # - name: edns0 + # Specifies the dnsPolicy that should be used for pods in the deployment # # This may need to be used to be changed given certain conditions. For instance, if one uses the cilium CNI diff --git a/helm/aws-load-balancer-controller/values.yaml b/helm/aws-load-balancer-controller/values.yaml index 8585416aa3..31daa4572f 100644 --- a/helm/aws-load-balancer-controller/values.yaml +++ b/helm/aws-load-balancer-controller/values.yaml @@ -308,6 +308,20 @@ env: # recommended if using the Amazon VPC CNI plugin. hostNetwork: false +# Specifies the dnsConfig that should be used for pods in the deployment +# +# See https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config +dnsConfig: {} + # nameservers: + # - 1.2.3.4 + # searches: + # - ns1.svc.cluster-domain.example + # - my.dns.search.suffix + # options: + # - name: ndots + # value: "2" + # - name: edns0 + # Specifies the dnsPolicy that should be used for pods in the deployment # # This may need to be used to be changed given certain conditions. For instance, if one uses the cilium CNI