Tutorials#

Updating a Kubernetes cluster to support an ALB#

If your Kubernetes cluster was created before 27.05.2025, you can update its configuration to support an ALB.

  1. On the cluster’s master node, add the IngressClass object to the manifest and specify its parameters:

    A manifest example for an ALB provider
    kubectl apply -f - <<EOF
    apiVersion: elbv2.k8s.aws/v1beta1
    kind: IngressClassParams
    metadata:
    labels:
        app.kubernetes.io/name: aws-load-balancer-controller
    name: alb
    ---
    apiVersion: networking.k8s.io/v1
    kind: IngressClass
    metadata:
    labels:
        app.kubernetes.io/name: aws-load-balancer-controller
    name: alb
    spec:
    controller: ingress.k8s.aws/alb
    parameters:
        apiGroup: elbv2.k8s.aws
        kind: IngressClassParams
        name: alb
    EOF
    
  2. Using a command:

    kubectl edit deployment aws-load-balancer-controller -n kube-system
    

    edit the Deployment object in the controller-manager manifest by adding the following fields:

    spec:
    template:
          spec:
          containers:
          - name: controller
             args:
             - --cluster-name=production
             - --aws-api-endpoints=ec2=https://ec2.k2.cloud:443,elasticloadbalancing=https://elb.k2.cloud:443
             - --ingress-class=alb
             - --enable-shield=false
             - --aws-region=k2
             - --enable-backend-security-group=false
             - --feature-gates=NLBSecurityGroup=false,WeightedTargetGroups=false
             - --enable-waf=false
             - --enable-wafv2=false
             - --tolerate-non-existent-backend-service=false
    
    spec:
    template:
          spec:
          containers:
          - name: controller
             args:
             - --cluster-name=production
             - --aws-api-endpoints=ec2=https://ec2.ru-spb.k2.cloud:443,elasticloadbalancing=https://elb.ru-spb.k2.cloud:443
             - --ingress-class=alb
             - --enable-shield=false
             - --aws-region=k2
             - --enable-backend-security-group=false
             - --feature-gates=NLBSecurityGroup=false,WeightedTargetGroups=false
             - --enable-waf=false
             - --enable-wafv2=false
             - --tolerate-non-existent-backend-service=false
    

    Also, specify the latest current image as the controller image.

  3. Apply changes using the command:

    kubectl rollout restart deployment aws-load-balancer-controller -n kube-system