AWS EKS - eksctl命令整理


命令整理

創建集群

指定文件創建

eksctl create cluster -f cluster.yaml

指定名稱與節點數量

eksctl create cluster --name=cluster-1 --nodes=4

指定版本創建

eksctl create cluster --version=1.12

指定集群名稱與節點數量范圍

eksctl create cluster --name=cluster-5 --nodes-min=3 --nodes-max=5

刪除集群

eksctl delete cluster -f cluster.yaml
eksctl delete cluster --name=<name>
eksctl delete cluster --name basic-cluster ##basic-cluster 集群名稱

查看集群信息

eksctl get cluster
NAME		REGION
basic-cluster	ap-northeast-1
eksctl get nodegroup --cluster=basic-cluster
CLUSTER		NODEGROUP	CREATED			MIN SIZE	MAX SIZE	DESIRED CAPACITY	INSTANCE TYPE	IMAGE ID
basic-cluster	ng-1		2020-09-01T09:00:07Z	10		10		10			m5.large	ami-0b6f41e05739de6f7
basic-cluster	ng-2		2020-09-01T09:00:08Z	2		2		2			m5.xlarge	ami-0b6f41e05739de6f7

創建nodegroup

eksctl create nodegroup --cluster=<clusterName>[--name=<nodegroupname>]

列出所有nodegroup

eksctl get nodegroup --cluster=<clustername>[--name=<nodegroupname>]

伸縮nodegroup

ekscli scale nodegroup --cluster=<clustername> --nodes=<desiredcount> --name=<nodegroupname>

刪除nodegroup

eksctl delete nodegroup --cluster=<clustername> --name=<nodegroupname>

drain nodegroup

如果nodegroup節點需要關機處理故障,此命令可以平穩的把nodegroup上面的節點自動遷移到其他nodegroup

eksctl drain nodegroup --cluster=<clustername> --name=<nodegroupname>

升級控制平面

eksctl update cluster --name=<clustername>

替換group,創建新的nodegroup

eksctl create nodegroup --cluster=<ClusterName> --name=<NewNodeGroupName>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM