Skip to content

Commit 5bf1153

Browse files
haoucTimothy-Dougherty
authored andcommitted
Adding support of ingressClassParams in helm charts (kubernetes-sigs#2478)
* Adding support of ingressClassParams in helm charts * Update charts to let users to create ingressClassParams with specs * Simplying the spec in values yaml * Adding support for customer's ingressClassParams * Using values fields directly instead of function * eks1.19 doesn't allow null spec and need move if check out from spec block.
1 parent 8c532a0 commit 5bf1153

File tree

6 files changed

+43
-1
lines changed

6 files changed

+43
-1
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: v2
22
name: aws-load-balancer-controller
33
description: AWS Load Balancer Controller Helm chart for Kubernetes
4-
version: 1.3.4
4+
version: 1.3.5
55
appVersion: v2.3.1
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
@@ -185,6 +185,9 @@ The default values set by the application itself can be confirmed [here](https:/
185185
| `terminationGracePeriodSeconds` | Time period for controller pod to do a graceful shutdown | 10 |
186186
| `ingressClass` | The ingress class to satisfy | alb |
187187
| `createIngressClassResource` | Create ingressClass resource | true |
188+
| `ingressClassParams.name` | IngressClassParams resource's name, default to the aws load balancer controller's name | None
189+
| `ingressClassParams.create` | If `true`, create a new ingressClassParams | true
190+
| `ingressClassParams.spec` | IngressClassParams defined ingress specifications | {}
188191
| `region` | The AWS region for the kubernetes cluster | None |
189192
| `vpcId` | The VPC ID for the Kubernetes cluster | None |
190193
| `awsMaxRetries` | Maximum retries for AWS APIs | None |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,10 @@ Convert map to comma separated key=value string
117117
{{- define "aws-load-balancer-controller.convertMapToCsv" -}}
118118
{{- range $key, $value := . -}} {{ $key }}={{ $value }}, {{- end -}}
119119
{{- end -}}
120+
121+
{{/*
122+
Create the name of the ingressClassParams
123+
*/}}
124+
{{- define "aws-load-balancer-controller.ingressClassParamsName" -}}
125+
{{ default (include "aws-load-balancer-controller.fullname" .) .Values.ingressClassParams.name }}
126+
{{- end -}}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ metadata:
77
{{- include "aws-load-balancer-controller.labels" . | nindent 4 }}
88
spec:
99
controller: ingress.k8s.aws/alb
10+
{{- if or .Values.ingressClassParams.create .Values.ingressClassParams.name }}
11+
parameters:
12+
apiGroup: elbv2.k8s.aws
13+
kind: IngressClassParams
14+
name: {{ include "aws-load-balancer-controller.ingressClassParamsName" . }}
15+
{{- end }}
1016
{{- end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .Values.ingressClassParams.create }}
2+
apiVersion: elbv2.k8s.aws/v1beta1
3+
kind: IngressClassParams
4+
metadata:
5+
name: {{ include "aws-load-balancer-controller.ingressClassParamsName" . }}
6+
{{- if .Values.ingressClassParams.spec }}
7+
spec:
8+
{{ toYaml .Values.ingressClassParams.spec | nindent 2}}
9+
{{- end }}
10+
{{- end }}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,22 @@ enableCertManager: false
8787
# ingresses without ingress class annotation and ingresses of type alb
8888
ingressClass: alb
8989

90+
# ingressClassParams specify the IngressCLassParams that enforce settings for a set of Ingresses when using with ingress Controller.
91+
ingressClassParams:
92+
create: true
93+
# The name of ingressClassParams resource will be referred in ingressClass
94+
name:
95+
spec: {}
96+
# You always can set specifications in `helm install` command through `--set` or `--set-string`
97+
# If you do want to specify specifications in values.yaml, uncomment the following
98+
# lines, adjust them as necessary, and remove the curly braces after 'spec:'.
99+
# namespaceSelector:
100+
# matchLabels:
101+
# group:
102+
# scheme:
103+
# ipAddressType:
104+
# tags:
105+
90106
# To use IngressClass resource instead of annotation, before you need to install the IngressClass resource pointing to controller.
91107
# If specified as true, the IngressClass resource will be created.
92108
createIngressClassResource: true

0 commit comments

Comments
 (0)