Skip to content

Commit 3b25a4b

Browse files
authored
Allow configuring the actual cluster DNS domain for the TLS certificate (#2770)
* Use actual cluster DNS domain for the TLS certificate * Rename clusterDomain to cluster.dnsDomain Signed-off-by: Stephan Austermühle <[email protected]> Signed-off-by: Stephan Austermühle <[email protected]>
1 parent 0d91884 commit 3b25a4b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

helm/aws-load-balancer-controller/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/
8080

8181
If you are setting `enableCertManager: true` you need to have installed cert-manager and it's CRDs before installing this chart; to install [cert-manager](https://artifacthub.io/packages/helm/cert-manager/cert-manager) follow the installation guide.
8282

83+
Set `cluster.dnsDomain` (default: `cluster.local`) to the actual DNS domain of your cluster to include the FQDN in requested TLS certificates.
84+
8385
#### Installing the Prometheus Operator
8486

8587
If you are setting `serviceMonitor.enabled: true` you need to have installed the Prometheus Operator ServiceMonitor CRD before installing this chart and have the operator running to collect the metrics. The easiest way to do this is to install the [kube-prometheus-stack](https://artifacthub.io/packages/helm/prometheus-community/kube-prometheus-stack) Helm chart using the installation guide.
@@ -171,6 +173,7 @@ The default values set by the application itself can be confirmed [here](https:/
171173
| `image.tag` | image tag | `<VERSION>` |
172174
| `image.pullPolicy` | image pull policy | `IfNotPresent` |
173175
| `clusterName` | Kubernetes cluster name | None |
176+
| `cluster.dnsDomain` | DNS domain of the Kubernetes cluster, included in TLS certificate requests | `cluster.local` |
174177
| `securityContext` | Set to security context for pod | `{}` |
175178
| `resources` | Controller pod resource requests & limits | `{}` |
176179
| `priorityClassName` | Controller pod priority class | system-cluster-critical |

helm/aws-load-balancer-controller/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ caCert: {{ index $secret.data "ca.crt" }}
105105
clientCert: {{ index $secret.data "tls.crt" }}
106106
clientKey: {{ index $secret.data "tls.key" }}
107107
{{- else -}}
108-
{{- $altNames := list (printf "%s.%s" $serviceName .Release.Namespace) (printf "%s.%s.svc" $serviceName .Release.Namespace) (printf "%s.%s.svc.cluster.local" $serviceName .Release.Namespace) -}}
108+
{{- $altNames := list (printf "%s.%s" $serviceName .Release.Namespace) (printf "%s.%s.svc" $serviceName .Release.Namespace) (printf "%s.%s.svc.%s" $serviceName .Release.Namespace .Values.cluster.dnsDomain) -}}
109109
{{- $ca := genCA "aws-load-balancer-controller-ca" 3650 -}}
110110
{{- $cert := genSignedCert (include "aws-load-balancer-controller.fullname" .) nil $altNames 3650 $ca -}}
111111
caCert: {{ $ca.Cert | b64enc }}

helm/aws-load-balancer-controller/templates/webhook.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ metadata:
167167
spec:
168168
dnsNames:
169169
- {{ template "aws-load-balancer-controller.webhookService" . }}.{{ .Release.Namespace }}.svc
170-
- {{ template "aws-load-balancer-controller.webhookService" . }}.{{ .Release.Namespace }}.svc.cluster.local
170+
- {{ template "aws-load-balancer-controller.webhookService" . }}.{{ .Release.Namespace }}.svc.{{ .Values.cluster.dnsDomain }}
171171
issuerRef:
172172
kind: Issuer
173173
name: {{ template "aws-load-balancer-controller.namePrefix" . }}-selfsigned-issuer

helm/aws-load-balancer-controller/values.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ imagePullSecrets: []
1313
nameOverride: ""
1414
fullnameOverride: ""
1515

16-
# The name of the Kubernetes cluster. A non-empty value is required
17-
clusterName:
18-
1916
serviceAccount:
2017
# Specifies whether a service account should be created
2118
create: true
@@ -78,7 +75,7 @@ configureDefaultAffinity: true
7875
# topologySpreadConstraints is a stable feature of k8s v1.19 which provides the ability to
7976
# control how Pods are spread across your cluster among failure-domains such as regions, zones,
8077
# nodes, and other user-defined topology domains.
81-
#
78+
#
8279
# more details here: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
8380
topologySpreadConstraints: {}
8481

@@ -104,6 +101,14 @@ additionalLabels: {}
104101
# Enable cert-manager
105102
enableCertManager: false
106103

104+
# The name of the Kubernetes cluster. A non-empty value is required
105+
clusterName:
106+
107+
# cluster contains configurations specific to the kubernetes cluster
108+
cluster:
109+
# Cluster DNS domain (required for requesting TLS certificates)
110+
dnsDomain: cluster.local
111+
107112
# The ingress class this controller will satisfy. If not specified, controller will match all
108113
# ingresses without ingress class annotation and ingresses of type alb
109114
ingressClass: alb

0 commit comments

Comments
 (0)