AWS

[EKS] nodegroup 생성, 삭제, 조회 명령어

ansmoon 2023. 5. 23. 10:43

 

1. NodeGroup 생성 

# eksctl create nodegroup --cluster <MY CLUSTER> --name <NG NAME> --node-type t3.medium --nodes 2 --nodes-min 2 --nodes-max 2 --ssh-access --ssh-public-key <KEY> --node-private-networking

eksctl create nodegroup --cluster moon-0404 --name moon-0404-ng-04 --node-type t3.medium --nodes 2 --nodes-min 2 --nodes-max 2 --ssh-access --ssh-public-key MY_Key --node-private-networking

## 프라이빗 서브넷에만 노드를 생성할 때 필요한 옵션 --node-private-networking
## --node-private-networking 추가하지 않으면 CloudFormation이 노드 그룹을 생성할 때 No export named eksctl-<your-cluster-name>-cluster::SubnetsPublic found. Rollback requested by user. 에러가 발생하면서 노드 그룹이 생성되지 않는다.
## 자체관리형으로 생성 시 필요한 옵션 --managed=false

 

 ## 오류

 Resource handler returned message: "[Issue(Code=NodeCreationFailure, Message=Instances failed to join the kubernetes cluster, ResourceIds=[i-0aec0bc1b011fb4c3, i-0b8ae985b9279837a])] (Service: null, Status Code: 0, Request ID: null)" (RequestToken: 210497ea-fa83-02bc-2e71-45bb1e44b21a, HandlerErrorCode: GeneralServiceException)

 

## 해결

 -  NAT Gateway가 없어서 추가해줌

 (참고 링크 : https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/troubleshooting.html )

'

 

 

 

 

 

 

2. NodeGroup 삭제

# eksctl delete nodegroup --cluster [CLUSTER NAME] --region ap-northeast-2 --name [NODEGROUP NAME]

 

 

 

3. NodeGroup 조회

# eksctl get nodegroups --cluster [CLUSTER NAME]