eksctl创建IPv6 cluster

我们先使用eksctl创建一个IPv6的EKS集群,它会自动创建一个新的VPC,并配置好VPC的ipv6配置

创建ipv6 EKS集群

创建ipv6-cluster.yamlkubernetesNetworkConfig部分定义了使用IPv6:

cat >ipv6-cluster.yaml <<EOF
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: ipv6-cluster
  region: us-east-2
  version: "1.28"

kubernetesNetworkConfig:
  ipFamily: IPv6

addons:
  - name: vpc-cni
    version: latest
  - name: coredns
    version: latest
  - name: kube-proxy
    version: latest

iam:
  withOIDC: true

managedNodeGroups:
  - name: ng-1
    instanceType: t3.large
EOF

创建集群:

eksctl create cluster -f ipv6-cluster.yaml

创建完成后,查询pod,上面分配了IPv6地址:

kubectl get pods -n kube-system -o wide

image-20240319083300558

查看service,上面也分配了IPv6地址:

kubectl get services -n kube-system -o wide

image-20240319083313174

查看集群,它的Cluster IP address familyIPv6

image-20240319083758358

从上面的页面打开任意子网,上面分配了IPv6 CIDR,并且开启了Auto-assign IPv6 address:

image-20240319083942618

查看子网的路由表,有一条到::0的路由,指向IGW:

image-20240319083956299

查看EKS的addon,VPC CNI上绑定了一个role,role上的policy具有AssignIPv6Addresses的权限:

image-20240319084228273