# t3 타입의 정보(필터) 확인 aws ec2 describe-instance-types --filters Name=instance-type,Values=t3.* \ --query "InstanceTypes[].{Type: InstanceType, MaxENI: NetworkInfo.MaximumNetworkInterfaces, IPv4addr: NetworkInfo.Ipv4AddressesPerInterface}" \ --output table +----------+----------+--------------+ # c5 타입의 정보(필터) 확인 aws ec2 describe-instance-types --filters Name=instance-type,Values=c5*.* \ --query "InstanceTypes[].{Type: InstanceType, MaxENI: NetworkInfo.MaximumNetworkInterfaces, IPv4addr: NetworkInfo.Ipv4AddressesPerInterface}" \ --output table # 파드 사용 가능 계산 예시 : aws-node 와 kube-proxy 파드는 host-networking 사용으로 IP 2개 남음 ((MaxENI * (IPv4addr-1)) + 2) t3.medium 경우 : ((3 * (6 - 1) + 2 ) = 17개 >> aws-node 와 kube-proxy 2개 제외하면 15개 # 워커노드 상세 정보 확인 : 노드 상세 정보의 Allocatable 에 pods 에 17개 정보 확인 kubectl describe node | grep Allocatable: -A7 Allocatable: attachable-volumes-aws-ebs: 25 cpu: 1930m ephemeral-storage: 27905944324 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 3388360Ki pods: 17 # 워커 노드 EC2 - 모니터링 while true; do ip -br -c addr show && echo "--------------" ; date "+%Y-%m-%d %H:%M:%S" ; sleep 1; done # 작업용 EC2 - 터미널1 watch -d 'kubectl get pods -o wide' # 작업용 EC2 - 터미널2 # 디플로이먼트 생성 curl -s -O https://raw.githubusercontent.com/gasida/PKOS/main/2/nginx-dp.yaml kubectl apply -f nginx-dp.yaml # 파드 확인 kubectl get pod -o wide kubectl get pod -o=custom-columns=NAME:.metadata.name,IP:.status.podIP # 파드 증가 테스트 >> 파드 정상 생성 확인, 워커 노드에서 eth, eni 갯수 확인 >> 어떤일이 벌어졌는가? kubectl scale deployment nginx-deployment --replicas=60 # 파드 생성 실패! kubectl get pods | grep Pending nginx-deployment-7fb7fd49b4-d4bk9 0/1 Pending 0 3m37s nginx-deployment-7fb7fd49b4-qpqbm 0/1 Pending 0 3m37s ... kubectl describe pod | grep Events: -A5 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedScheduling 45s default-scheduler 0/3 nodes are available: 1 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }, 2 Too many pods. preemption: 0/3 nodes are available: 1 Preemption is not helpful for scheduling, 2 No preemption victims found for incoming pod. # 디플로이먼트 삭제 kubectl delete deploy nginx-deployment