What I used here was created using the eksctl command. More information: https://eksctl.io/usage/schema/
1. Write yaml file
vim eks-cluster.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eks-test #集群名字
region: cn-north-1 #集群区域,中国北京区
version: "1.25" #kubernetes版本
vpc:
clusterEndpoints:
privateAccess: true #是否开启内网访问,作用于每个Node通过Vpc互相访问
publicAccess: true #是否开启公网访问
iam:
withOIDC: true #是否开启OIDC提供商
managedNodeGroups: #使用托管节点
- name: dev-workergroup #节点池名字
labels: {
role: workers }
instanceType: t3.2xlarge #节点规格,这个规格是8u32g
desiredCapacity: 2 #节点数量
volumeSize: 100 # 磁盘大小
privateNetworking: true #开启内网,之后做【仅出口互联网网关 】绑定vpc粒度,让他们有外网能力
ssh:
allow: true #开启ssh
publicKeyName: EC2-Key #密钥的名称,这个需要在EC2控制台提前创建下
2. Create a cluster
eksctl create cluster -f eks-cluster.yaml
3. Local management
Get the config file automatically added to~/.kube/config
aws eks update-kubeconfig --region cn-north-1 --name eks-test
Use the kubectl tool to manage the cluster. You can now use the kubectl tool to manage the cluster.
kubectl get node