eksctl
eksctl delete
eksctl delete cluster --name eks-demo
yaml
$ eksctl create cluster \ --name eks-demo \ --region ap-northeast-2 \ --nodes 1 \ --node-type t2.medium \ --nodegroup-name eks-demo
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eks-demo
region: ap-northeast-2
managedNodeGroups:
- name: eks-demo-spot
instanceTypes: ["t2.micro"]
spot: true
# An example of ClusterConfig showing nodegroups with mixed instances (spot and on demand):
---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eks-cluster
region: ap-northeast-2
nodeGroups:
- name: eks-ng
minSize: 1
maxSize: 10
desiredCapacity: 1
instancesDistribution:
maxPrice: 0.017
instanceTypes: ["t3.small", "t3.medium"] # At least one instance type should be specified
onDemandBaseCapacity: 0
onDemandPercentageAboveBaseCapacity: 50
spotInstancePools: 2
# spot-cluster.yaml apiVersion: eksctl.io/v1alpha5 kind: ClusterConfig metadata: name: spot-cluster region: us-west-2 managedNodeGroups: - name: spot instanceTypes: ["c3.large","c4.large","c5.large","c5d.large","c5n.large","c5a.large"] spot: true # `instanceTypes` defaults to [`m5.large`] - name: spot-2 spot: true # On-Demand instances - name: on-demand instanceTypes: ["c3.large", "c4.large", "c5.large"]
$ eksctl create cluster -f spot-cluster.yaml
설치
brew tap weaveworks/tap brew install weaveworks/tap/eksctl 업그레이드: brew upgrade eksctl && brew link --overwrite eksctl
클러스터 생성
$ eksctl create cluster \ --name eks-demo \ --region ap-northeast-2 \ --nodes 1 \ --node-type t2.medium \ --nodegroup-name eks-demo
eksctl 명령을 실행해서 Amazon EKS 클러스터를 생성한다.
$ eksctl create cluster \ --name k8s-demo \ --region ap-northeast-2 \ --with-oidc \ --ssh-access \ --ssh-public-key aws--login-key \ --nodes 3 \ --node-type t3.medium \ --node-volume-size=20 \ --managed
eksctl create cluster -f spot-cluster.yaml
spot-cluster.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: my-eks
region: ap-northeast-2
managedNodeGroups:
- name: my-eks-t2-large
minSize: 1
maxSize: 3
desiredCapacity: 1
instanceType: 't2.large'
volumeSize: 10
volumeType: gp2
spot: true