Skip to content

Commit 7b24e4e

Browse files
agaffneykishorj
andauthored
Support specifying TLS certs/key for webhook in helm chart (#2198)
Co-authored-by: Kishor Joshi <[email protected]>
1 parent eb042f3 commit 7b24e4e

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
name: aws-load-balancer-controller
33
description: AWS Load Balancer Controller Helm chart for Kubernetes
4-
version: 1.2.7
4+
version: 1.2.8
55
appVersion: v2.2.4
66
home: https://github.com/aws/eks-charts
77
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ The default values set by the application itself can be confirmed [here](https:/
177177
| `logLevel` | Set the controller log level - info, debug | None |
178178
| `metricsBindAddr` | The address the metric endpoint binds to | "" |
179179
| `webhookBindPort` | The TCP port the Webhook server binds to | None |
180+
| `webhookTLS.caCert` | TLS CA certificate for webhook (auto-generated if not provided) | "" |
181+
| `webhookTLS.cert` | TLS certificate for webhook (auto-generated if not provided) | "" |
182+
| `webhookTLS.key` | TLS private key for webhook (auto-generated if not provided) | "" |
180183
| `serviceMaxConcurrentReconciles` | Maximum number of concurrently running reconcile loops for service | None |
181184
| `targetgroupbindingMaxConcurrentReconciles` | Maximum number of concurrently running reconcile loops for targetGroupBinding | None |
182185
| `targetgroupbindingMaxExponentialBackoffDelay` | Maximum duration of exponential backoff for targetGroupBinding reconcile failures | None |

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ Create the name of the service account to use
7575
{{/*
7676
Generate certificates for webhook
7777
*/}}
78-
{{- define "aws-load-balancer-controller.gen-certs" -}}
78+
{{- define "aws-load-balancer-controller.webhook-certs" -}}
79+
{{- if (and .Values.webhookTLS.caCert .Values.webhookTLS.cert .Values.webhookTLS.key) -}}
80+
caCert: {{ .Values.webhookTLS.caCert | b64enc }}
81+
clientCert: {{ .Values.webhookTLS.cert | b64enc }}
82+
clientKey: {{ .Values.webhookTLS.key | b64enc }}
83+
{{- else -}}
7984
{{- $namePrefix := ( include "aws-load-balancer-controller.namePrefix" . ) -}}
8085
{{- $altNames := list ( printf "%s-%s.%s" $namePrefix "webhook-service" .Release.Namespace ) ( printf "%s-%s.%s.svc" $namePrefix "webhook-service" .Release.Namespace ) -}}
8186
{{- $ca := genCA "aws-load-balancer-controller-ca" 3650 -}}
@@ -84,6 +89,7 @@ caCert: {{ $ca.Cert | b64enc }}
8489
clientCert: {{ $cert.Cert | b64enc }}
8590
clientKey: {{ $cert.Key | b64enc }}
8691
{{- end -}}
92+
{{- end -}}
8793

8894
{{/*
8995
Convert map to comma separated key=value string

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{ $tls := fromYaml ( include "aws-load-balancer-controller.gen-certs" . ) }}
1+
{{ $tls := fromYaml ( include "aws-load-balancer-controller.webhook-certs" . ) }}
22
---
33
{{- if .Capabilities.APIVersions.Has "admissionregistration.k8s.io/v1" }}
44
apiVersion: admissionregistration.k8s.io/v1

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ metricsBindAddr: ""
117117
# The TCP port the Webhook server binds to. (default 9443)
118118
webhookBindPort:
119119

120+
# webhookTLS specifies TLS cert/key for the webhook
121+
webhookTLS:
122+
caCert:
123+
cert:
124+
key:
125+
120126
# Maximum number of concurrently running reconcile loops for service (default 3)
121127
serviceMaxConcurrentReconciles:
122128

0 commit comments

Comments
 (0)