Skip to content

Commit e5c3eae

Browse files
author
Fawad Khaliq
committed
Add aws-load-balancer-controller Helm chart
1 parent 9bbb027 commit e5c3eae

File tree

16 files changed

+1448
-0
lines changed

16 files changed

+1448
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
crds/kustomization.yaml
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: v1
2+
name: aws-load-balancer-controller
3+
description: AWS Load Balancer Controller Helm chart for Kubernetes
4+
version: 1.2.2
5+
appVersion: v2.2.0
6+
home: https://github.com/aws/eks-charts
7+
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
8+
sources:
9+
- https://github.com/aws/eks-charts
10+
maintainers:
11+
- name: kishorj
12+
url: https://github.com/kishorj
13+
14+
- name: m00nf1sh
15+
url: https://github.com/m00nf1sh
16+
17+
keywords:
18+
- eks
19+
- alb
20+
- load balancer
21+
- ingress
22+
- nlb

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

Lines changed: 195 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--set clusterName=k8s-ci-cluster
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# CI testing values for aws-load-balancer-controller
2+
3+
region: us-west-2
4+
image:
5+
repository: kishorj/aws-load-balancer-controller
6+
tag: v2.0.0-rc1
7+
pullPolicy: Always

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

Lines changed: 451 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- crds.yaml
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AWS Load Balancer controller installed!
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "aws-load-balancer-controller.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "aws-load-balancer-controller.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "aws-load-balancer-controller.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Chart name prefix for resource names
36+
Strip the "-controller" suffix from the default .Chart.Name if the nameOverride is not specified.
37+
This enables using a shorter name for the resources, for example aws-load-balancer-webhook.
38+
*/}}
39+
{{- define "aws-load-balancer-controller.namePrefix" -}}
40+
{{- $defaultNamePrefix := .Chart.Name | trimSuffix "-controller" -}}
41+
{{- default $defaultNamePrefix .Values.nameOverride | trunc 42 | trimSuffix "-" -}}
42+
{{- end -}}
43+
44+
{{/*
45+
Common labels
46+
*/}}
47+
{{- define "aws-load-balancer-controller.labels" -}}
48+
helm.sh/chart: {{ include "aws-load-balancer-controller.chart" . }}
49+
{{ include "aws-load-balancer-controller.selectorLabels" . }}
50+
{{- if .Chart.AppVersion }}
51+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
52+
{{- end }}
53+
app.kubernetes.io/managed-by: {{ .Release.Service }}
54+
{{- end -}}
55+
56+
{{/*
57+
Selector labels
58+
*/}}
59+
{{- define "aws-load-balancer-controller.selectorLabels" -}}
60+
app.kubernetes.io/name: {{ include "aws-load-balancer-controller.name" . }}
61+
app.kubernetes.io/instance: {{ .Release.Name }}
62+
{{- end -}}
63+
64+
{{/*
65+
Create the name of the service account to use
66+
*/}}
67+
{{- define "aws-load-balancer-controller.serviceAccountName" -}}
68+
{{- if .Values.serviceAccount.create -}}
69+
{{ default (include "aws-load-balancer-controller.fullname" .) .Values.serviceAccount.name }}
70+
{{- else -}}
71+
{{ default "default" .Values.serviceAccount.name }}
72+
{{- end -}}
73+
{{- end -}}
74+
75+
{{/*
76+
Generate certificates for webhook
77+
*/}}
78+
{{- define "aws-load-balancer-controller.gen-certs" -}}
79+
{{- $namePrefix := ( include "aws-load-balancer-controller.namePrefix" . ) -}}
80+
{{- $altNames := list ( printf "%s-%s.%s" $namePrefix "webhook-service" .Release.Namespace ) ( printf "%s-%s.%s.svc" $namePrefix "webhook-service" .Release.Namespace ) -}}
81+
{{- $ca := genCA "aws-load-balancer-controller-ca" 3650 -}}
82+
{{- $cert := genSignedCert ( include "aws-load-balancer-controller.fullname" . ) nil $altNames 3650 $ca -}}
83+
caCert: {{ $ca.Cert | b64enc }}
84+
clientCert: {{ $cert.Cert | b64enc }}
85+
clientKey: {{ $cert.Key | b64enc }}
86+
{{- end -}}
87+
88+
{{/*
89+
Convert map to comma separated key=value string
90+
*/}}
91+
{{- define "aws-load-balancer-controller.convert-map-to-csv" -}}
92+
{{- range $key, $value := . -}} {{ $key }}={{ $value }}, {{- end -}}
93+
{{- end -}}
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "aws-load-balancer-controller.fullname" . }}
5+
namespace: {{ .Release.Namespace }}
6+
labels:
7+
{{- include "aws-load-balancer-controller.labels" . | nindent 4 }}
8+
spec:
9+
replicas: {{ .Values.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "aws-load-balancer-controller.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
labels:
16+
{{- include "aws-load-balancer-controller.selectorLabels" . | nindent 8 }}
17+
{{- if .Values.podLabels }}
18+
{{- toYaml .Values.podLabels | nindent 8 }}
19+
{{- end }}
20+
annotations:
21+
prometheus.io/scrape: "true"
22+
prometheus.io/port: "{{ (split ":" .Values.metricsBindAddr)._1 | default 8080 }}"
23+
{{- if .Values.podAnnotations }}
24+
{{- toYaml .Values.podAnnotations | nindent 8 }}
25+
{{- end }}
26+
spec:
27+
{{- with .Values.imagePullSecrets }}
28+
imagePullSecrets:
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
31+
serviceAccountName: {{ include "aws-load-balancer-controller.serviceAccountName" . }}
32+
volumes:
33+
- name: cert
34+
secret:
35+
defaultMode: 420
36+
secretName: {{ template "aws-load-balancer-controller.namePrefix" . }}-tls
37+
{{- with .Values.extraVolumes }}
38+
{{ toYaml . | nindent 6 }}
39+
{{- end }}
40+
securityContext:
41+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
42+
{{- if .Values.hostNetwork }}
43+
hostNetwork: true
44+
{{- end }}
45+
containers:
46+
- name: {{ .Chart.Name }}
47+
args:
48+
- --cluster-name={{ required "Chart cannot be installed without a valid clusterName!" .Values.clusterName }}
49+
{{- if .Values.ingressClass }}
50+
- --ingress-class={{ .Values.ingressClass }}
51+
{{- end }}
52+
{{- if .Values.region }}
53+
- --aws-region={{ .Values.region }}
54+
{{- end }}
55+
{{- if .Values.vpcId }}
56+
- --aws-vpc-id={{ .Values.vpcId }}
57+
{{- end }}
58+
{{- if .Values.awsMaxRetries }}
59+
- --aws-max-retries={{ .Values.awsMaxRetries }}
60+
{{- end }}
61+
{{- if kindIs "bool" .Values.enablePodReadinessGateInject }}
62+
- --enable-pod-readiness-gate-inject={{ .Values.enablePodReadinessGateInject }}
63+
{{- end }}
64+
{{- if kindIs "bool" .Values.enableShield }}
65+
- --enable-shield={{ .Values.enableShield }}
66+
{{- end }}
67+
{{- if kindIs "bool" .Values.enableWaf }}
68+
- --enable-waf={{ .Values.enableWaf }}
69+
{{- end }}
70+
{{- if kindIs "bool" .Values.enableWafv2 }}
71+
- --enable-wafv2={{ .Values.enableWafv2 }}
72+
{{- end }}
73+
{{- if .Values.metricsBindAddr }}
74+
- --metrics-bind-addr={{ .Values.metricsBindAddr }}
75+
{{- end }}
76+
{{- if .Values.ingressMaxConcurrentReconciles }}
77+
- --ingress-max-concurrent-reconciles={{ .Values.ingressMaxConcurrentReconciles }}
78+
{{- end }}
79+
{{- if .Values.serviceMaxConcurrentReconciles }}
80+
- --service-max-concurrent-reconciles={{ .Values.serviceMaxConcurrentReconciles }}
81+
{{- end }}
82+
{{- if .Values.targetgroupbindingMaxConcurrentReconciles }}
83+
- --targetgroupbinding-max-concurrent-reconciles={{ .Values.targetgroupbindingMaxConcurrentReconciles }}
84+
{{- end }}
85+
{{- if .Values.logLevel }}
86+
- --log-level={{ .Values.logLevel }}
87+
{{- end }}
88+
{{- if .Values.webhookBindPort }}
89+
- --webhook-bind-port={{ .Values.webhookBindPort }}
90+
{{- end }}
91+
{{- if .Values.syncPeriod }}
92+
- --sync-period={{ .Values.syncPeriod }}
93+
{{- end }}
94+
{{- if .Values.watchNamespace }}
95+
- --watch-namespace={{ .Values.watchNamespace }}
96+
{{- end }}
97+
{{- if kindIs "bool" .Values.disableIngressClassAnnotation }}
98+
- --disable-ingress-class-annotation={{ .Values.disableIngressClassAnnotation }}
99+
{{- end }}
100+
{{- if kindIs "bool" .Values.disableIngressGroupNameAnnotation }}
101+
- --disable-ingress-group-name-annotation={{ .Values.disableIngressGroupNameAnnotation }}
102+
{{- end }}
103+
{{- if .Values.defaultSSLPolicy }}
104+
- --default-ssl-policy={{ .Values.defaultSSLPolicy }}
105+
{{- end }}
106+
{{- if .Values.externalManagedTags }}
107+
- --external-managed-tags={{ join "," .Values.externalManagedTags }}
108+
{{- end }}
109+
{{- if .Values.defaultTags }}
110+
- --default-tags={{ include "aws-load-balancer-controller.convert-map-to-csv" .Values.defaultTags | trimSuffix "," }}
111+
{{- end }}
112+
{{- if .Values.env }}
113+
env:
114+
{{- range $key, $value := .Values.env }}
115+
- name: {{ $key }}
116+
value: "{{ $value }}"
117+
{{- end }}
118+
{{- end }}
119+
command:
120+
- /controller
121+
securityContext:
122+
{{- toYaml .Values.securityContext | nindent 10 }}
123+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
124+
imagePullPolicy: {{ .Values.image.pullPolicy }}
125+
volumeMounts:
126+
- mountPath: /tmp/k8s-webhook-server/serving-certs
127+
name: cert
128+
readOnly: true
129+
{{- with .Values.extraVolumeMounts }}
130+
{{ toYaml . | nindent 8 }}
131+
{{- end }}
132+
ports:
133+
- name: webhook-server
134+
containerPort: {{ .Values.webhookBindPort | default 9443 }}
135+
protocol: TCP
136+
- name: metrics-server
137+
containerPort: {{ (split ":" .Values.metricsBindAddr)._1 | default 8080 }}
138+
protocol: TCP
139+
resources:
140+
{{- toYaml .Values.resources | nindent 10 }}
141+
{{- with .Values.livenessProbe }}
142+
livenessProbe:
143+
{{- toYaml . | nindent 10 }}
144+
{{- end }}
145+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
146+
{{- with .Values.nodeSelector }}
147+
nodeSelector:
148+
{{- toYaml . | nindent 8 }}
149+
{{- end }}
150+
{{- if .Values.affinity }}
151+
affinity:
152+
{{- toYaml .Values.affinity | nindent 8 }}
153+
{{- else }}
154+
affinity:
155+
podAntiAffinity:
156+
preferredDuringSchedulingIgnoredDuringExecution:
157+
- weight: 100
158+
podAffinityTerm:
159+
labelSelector:
160+
matchExpressions:
161+
- key: app.kubernetes.io/name
162+
operator: In
163+
values:
164+
- {{ include "aws-load-balancer-controller.name" . }}
165+
topologyKey: kubernetes.io/hostname
166+
{{- end }}
167+
{{- with .Values.tolerations }}
168+
tolerations:
169+
{{- toYaml . | nindent 8 }}
170+
{{- end }}
171+
{{- if .Values.priorityClassName }}
172+
priorityClassName: {{ .Values.priorityClassName | quote }}
173+
{{- end }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{{- if and .Values.podDisruptionBudget (gt (int .Values.replicaCount) 1) }}
2+
apiVersion: policy/v1beta1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: {{ include "aws-load-balancer-controller.fullname" . }}
6+
labels:
7+
{{- include "aws-load-balancer-controller.labels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
matchLabels:
11+
{{- include "aws-load-balancer-controller.selectorLabels" . | nindent 6 }}
12+
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
13+
{{- end }}

0 commit comments

Comments
 (0)