Deploy an IPv6 Kubernetes LoadBalancer Service on Amazon EKS

273 Views Asked by At

Based on the AWS doc, with the following annotation, we can have an IPv6 LoadBalancer service!

service.beta.kubernetes.io/aws-load-balancer-ip-address-type: "dualstack"

However, after deploying the below file, it creates IPv4 ELB. Although, we can change the IP address type manually from the ELB dashboard! The question is How to deploy an IPv6 Kubernetes Loadbalancer Service without any manual changes.

Note. The VPC is Dual Stack (which contains both IPv4 and IPv6 subnets), and Amazon EKS deployed with IPv6!

For more information regarding available annotations, check here!

Sample file:

apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-internal: "true"
    service.beta.kubernetes.io/aws-load-balancer-scheme: "internal"
    service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
    service.beta.kubernetes.io/aws-load-balancer-ip-address-type: "dualstack"
spec:
  ports:
  - name: nginx
    port: 80
    targetPort: 80
  type: LoadBalancer
  selector:
    app: nginx

ELB dashboard after deploying service

1

There are 1 best solutions below

0
adp7 On

You to need to use IP target for dualstack (https://docs.aws.amazon.com/eks/latest/userguide/network-load-balancing.html) So in your case it should be something like that :

service.beta.kubernetes.io/aws-load-balancer-scheme: "internal"
service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: "ip"
service.beta.kubernetes.io/aws-load-balancer-ip-address-type: dualstack

and you might want/need to specify subnets :

service.beta.kubernetes.io/aws-load-balancer-subnets: subnet-1, subnet-2