install eksctl
https://docs.aws.amazon.com/eks/latest/userguide/getting-started-eksctl.html
install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl/
eksctl-cluster-ec2.yaml
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig | |
metadata: | |
name: my-cluster-ec2 | |
region: ap-southeast-1 | |
nodeGroups: | |
- name: ng-1 | |
instanceType: t3.small | |
desiredCapacity: 3 | |
ssh: | |
publickeyName: the1-cpp |
time eksctl create cluster -f eksctl-cluster-ec2.yaml
basic eksctl
eksctl get cluster
eksctl get nodegroup --cluster my-cluster-ec2
eksctl scale nodegroup --cluster=my-cluster-ec2 --nodes=5 --name=ng-1
update nodegroups
apiVersion: eksctl.io/v1alpha5 | |
kind: ClusterConfig | |
metadata: | |
name: my-cluster-ec2 | |
region: ap-southeast-1 | |
nodeGroups: | |
- name: ng-1 | |
instanceType: t3.small | |
desiredCapacity: 3 | |
ssh: | |
publickeyName: the1-cpp | |
- name: ng-mixed | |
minSize: 3 | |
maxSize: 5 | |
instancesDistribution: | |
maxPrice: 0.2 | |
instanceTypes: ["t3.small"] | |
onDemandBaseCapacity: 0 | |
onDemandPercentageAboveBaseCapacity: 50 | |
ssh: | |
publickeyName: the1-cpp |
eksctl create nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed'
delete nodegroups
eksctl delete nodegroup --config-file=cluster-ec2.yaml --include='ng-mixed' --approve
Top comments (0)