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
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 :
and you might want/need to specify subnets :