參考官方文檔:https://eksctl.io/usage/managing-nodegroups/
創建nodegroup命令
eksctl create nodegroup --cluster=<clusterName> [--name=<nodegroupName>]
例如
eksctl create nodegroup --cluster=faberbeta --name=high-memory-group
看樣子這個方式不是很好,因為不能詳細配置nodegroup服務器的配置
推薦使用--config-file指定配置文件來創建nodegroup
命令:
eksctl create nodegroup --config-file=high-memory-cluster.yaml
high-memory-cluster.yaml的配置文件
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: faberbeta
region: ap-east-1
managedNodeGroups:
- name: high-mem-nodegroup
instanceType: r5.large
minSize: 3
maxSize: 6
desiredCapacity: 3
volumeSize: 30
ssh:
allow: true
publicKeyPath: /root/.ssh/id_rsa.pub
labels: {role: worker}
tags:
nodegroup-role: worker
iam:
withAddonPolicies:
imageBuilder: true
autoScaler: true
externalDNS: true
certManager: true
appMesh: true
appMeshPreview: true
ebs: true
fsx: true
efs: true
albIngress: true
xRay: true
cloudWatch: true