diff --git a/helm/aws-load-balancer-controller/README.md b/helm/aws-load-balancer-controller/README.md index 1ef234304..b80a5d3f1 100644 --- a/helm/aws-load-balancer-controller/README.md +++ b/helm/aws-load-balancer-controller/README.md @@ -172,6 +172,7 @@ The default values set by the application itself can be confirmed [here](https:/ | `serviceAccount.name` | Service account to be used | None | | `terminationGracePeriodSeconds` | Time period for controller pod to do a graceful shutdown | 10 | | `ingressClass` | The ingress class to satisfy | alb | +| `createIngressClassResource` | Create ingressClass resource | false | | `region` | The AWS region for the kubernetes cluster | None | | `vpcId` | The VPC ID for the Kubernetes cluster | None | | `awsMaxRetries` | Maximum retries for AWS APIs | None | diff --git a/helm/aws-load-balancer-controller/templates/ingressclass.yaml b/helm/aws-load-balancer-controller/templates/ingressclass.yaml new file mode 100644 index 000000000..0620957f4 --- /dev/null +++ b/helm/aws-load-balancer-controller/templates/ingressclass.yaml @@ -0,0 +1,10 @@ +{{- if .Values.createIngressClassResource }} +apiVersion: networking.k8s.io/v1 +kind: IngressClass +metadata: + name: {{ .Values.ingressClass }} + labels: + {{- include "aws-load-balancer-controller.labels" . | nindent 4 }} +spec: + controller: ingress.k8s.aws/alb +{{- end }} diff --git a/helm/aws-load-balancer-controller/test.yaml b/helm/aws-load-balancer-controller/test.yaml index 529303c6e..c426db355 100644 --- a/helm/aws-load-balancer-controller/test.yaml +++ b/helm/aws-load-balancer-controller/test.yaml @@ -74,6 +74,10 @@ enableCertManager: false # ingresses without ingress class annotation and ingresses of type alb ingressClass: alb +# To use IngressClass resource instead of annotation, before you need to install the IngressClass resource pointing to controller. +# If specified as true, the IngressClass resource will be created. +createIngressClassResource: true + # The AWS region for the kubernetes cluster. Set to use KIAM or kube2iam for example. region: diff --git a/helm/aws-load-balancer-controller/values.yaml b/helm/aws-load-balancer-controller/values.yaml index 6d6214f5a..32706c9fa 100644 --- a/helm/aws-load-balancer-controller/values.yaml +++ b/helm/aws-load-balancer-controller/values.yaml @@ -87,6 +87,10 @@ enableCertManager: false # ingresses without ingress class annotation and ingresses of type alb ingressClass: alb +# To use IngressClass resource instead of annotation, before you need to install the IngressClass resource pointing to controller. +# If specified as true, the IngressClass resource will be created. +createIngressClassResource: false + # The AWS region for the kubernetes cluster. Set to use KIAM or kube2iam for example. region: