eksctl custom ami 설정하는 방법 yaml 파일에 user data넣기
Nodegroup Bootstrap Override For Custom AMIs
/etc/eks/bootstrap.sh 에 부트스트랩 관련된 shell파일이 있음
이 쉘파일을 실행할때 해당 값을 넣어줘야만, 제대로 노드그룹이 만들어짐.
필수적인건 custom ami 값이나, 노드 이름 같은 것들? 필요한거같음.
overrideBootstrapCommand: |
#!/bin/bash
source /var/lib/cloud/scripts/eksctl/bootstrap.helper.sh
# Note "--node-labels=${NODE_LABELS}" needs the above helper sourced to work, otherwise will have to be defined manually.
/etc/eks/bootstrap.sh ${CLUSTER_NAME} --container-runtime containerd --kubelet-extra-args "--node-labels=${NODE_LABELS}"
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: yusa-eks-cluster
region: ap-northeast-2
version: "1.24"
managedNodeGroups:
- name: test
instanceType: t3.large
ami: ${custom_ami_id}
availabilityZones:
- ap-northeast-2a
privateNetworking: true
taints:
- key: special
value: "test"
effect: NoExecute
desiredCapacity: 1
minSize: 1
maxSize: 1
ssh:
allow: true
publicKeyName: yusa-key-pair-eks
iam:
withAddonPolicies:
imageBuilder: true
albIngress: true
cloudWatch: true
autoScaler: true
instanceName: yusa-ec2-eks-test
volumeSize: 30
overrideBootstrapCommand: |
#!/bin/bash
/etc/eks/bootstrap.sh yusa-eks-cluster(클러스터이름) --kubelet-extra-args '--node-labels=eks.amazonaws.com/nodegroup=test(노드이름),eks.amazonaws.com/nodegroup-image=${custom_ami_id}'
# 실행해야하는 유저 데이터 넣기