[AEWS] # 2์ฃผ์ฐจ eks vpc cni ์ดํ•ดํ•˜๊ธฐ (3)

25๋…„๋„ AWS EKS Hands-on Study ์Šคํ„ฐ๋”” ์ •๋ฆฌ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค.

 

์ตœ๋Œ€ ํŒŒ๋“œ ๊ฐฏ์ˆ˜ 

helm repo add geek-cookbook https://geek-cookbook.github.io/charts/
helm install kube-ops-view geek-cookbook/kube-ops-view --version 1.2.2 --set service.main.type=LoadBalancer --set env.TZ="Asia/Seoul" --namespace kube-system

# ์ ‘์† ๋งํฌ ํ™•์ธ
kubectl get svc -n kube-system kube-ops-view -o jsonpath='{.status.loadBalancer.ingress[0].hostname}' | awk '{ print "KUBE-OPS-VIEW URL = http://"$1":8080/#scale=1.5"}

 

 

KubeOps๋Š” ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ํด๋Ÿฌ์Šคํ„ฐ์˜ ๋ฆฌ์†Œ์Šค๋ฅผ ์‹œ๊ฐ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ๋Œ€์‹œ๋ณด๋“œ์ด๋‹ค.

 

 

 

๋ ˆํ”Œ๋ฆฌ์นด๋ฅผ ๋Š˜์—ฌ์„œ ๋ฐฐํฌํ•  ์ˆ˜๋ก ํ™”๋ฉด์— ํ™”๋ คํ•œ ํšจ๊ณผ์™€ ํ•จ๊ป˜ ๋„ค๋ชจ(ํŒŒ๋“œ)๊ฐ€ ์ถ”๊ฐ€๋œ๋‹ค.

 

aws ec2 describe-instance-types --filters Name=instance-type,Values=t3.\* \
 --query "InstanceTypes[].{Type: InstanceType, MaxENI: NetworkInfo.MaximumNetworkInterfaces, IPv4addr: NetworkInfo.Ipv4AddressesPerInterface}" \
 --output table
--------------------------------------
|        DescribeInstanceTypes       |
+----------+----------+--------------+
| IPv4addr | MaxENI   |    Type      |
+----------+----------+--------------+
|  15      |  4       |  t3.xlarge   |
|  15      |  4       |  t3.2xlarge  |
|  12      |  3       |  t3.large    |
|  6       |  3       |  t3.medium   |
|  2       |  2       |  t3.nano     |
|  2       |  2       |  t3.micro    |
|  4       |  3       |  t3.small    |
+----------+----------+--------------+

 

aws vpc cni๋Š” ํŒŒ๋“œ๊ฐ€ ec2์˜ eni ip๋ฅผ ํ• ๋‹น๋ฐ›๋„๋ก ๋™์ž‘ํ•œ๋‹ค. ๊ฐ ์ธ์Šคํ„ด์Šค ๋ณ„๋กœ ์ตœ๋Œ€ eni ๊ฐœ์ˆ˜์™€ eni ๊ฐ€ ํ• ๋‹นํ•  ์ˆ˜ ์žˆ๋Š” ip ๊ฐœ์ˆ˜๊ฐ€ ์ •ํ•ด์ ธ ์žˆ๋Š”๋ฐ ์œ„ ๋ช…๋ น์–ด๋ฅผ ํ†ตํ•ด ์ด ๊ฐ’์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

์‹ค์Šต์—์„œ ์‚ฌ์šฉํ•œ ์›Œ์ปค ๋…ธ๋“œ๋Š” t3.medium ํƒ€์ž…์ด๋‹ค.

  • ๋žœ ์นด๋“œ๋ฅผ 3๊ฐœ๋ฅผ ์ตœ๋Œ€๋กœ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค.
  • eni ๋‹น ํ• ๋‹น ๊ฐ€๋Šฅํ•œ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ip ๊ฐœ์ˆ˜ : 6 (ํ”„๋ผ์ด๋จธ๋ฆฌ 1๊ฐœ + ์„ธ์ปจ๋”๋ฆฌ 5๊ฐœ)
  • ์ „์ฒด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ip ๊ฐœ์ˆ˜ : 6*3=18
  • ํŒŒ๋“œ์— ํ• ๋‹น ๊ฐ€๋Šฅํ•œ ip ๊ฐœ์ˆ˜ : 17 (๋…ธ๋“œ๊ฐ€ 1๊ฐœ ์‚ฌ์šฉ)

์ฆ‰ t3.medium ํƒ€์ž…์˜ ์ธ์Šคํ„ด์Šค์—์„œ๋Š” ์ตœ๋Œ€ ํŒŒ๋“œ๋ฅผ 17๊ฐœ ๋„์šธ ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ๋‹ค. ํ•˜์ง€๋งŒ aws ๊ธฐ๋ณธ ํŒŒ๋“œ๋ฅผ ์ œ์™ธํ•˜๋ฉด ์‚ฌ์šฉ์ž๊ฐ€ ๋„์šธ ์ˆ˜ ์žˆ๋Š” ํŒŒ๋“œ๋Š” 15๊ฐœ์ด๋‹ค.

kubectl scale deployment nginx-deployment --replicas=8

kubectl scale deployment nginx-deployment --replicas=15

kubectl scale deployment nginx-deployment --replicas=30

kubectl scale deployment nginx-deployment --replicas=50

 

 

ํ˜„์žฌ ์‚ฌ์šฉ ์ค‘์ธ EC2 ์ธ์Šคํ„ด์Šค๋Š” t3.medium์ธ๋ฐ, ์ด ์ธ์Šคํ„ด์Šค๋Š” ๊ฐ eni ๋‹น 5๊ฐœ์˜ ์ถ”๊ฐ€ IP๋ฅผ ํ• ๋‹นํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ตœ๋Œ€ 3๊ฐœ์˜ eni๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋‹ค.

 

kubectl get pod -o wide | grep Pending
nginx-deployment-6c8cb99bb9-6pdcl   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-9pt62   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-dlx6v   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-fgc8x   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-kf6bl   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-kg7xh   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-nptcc   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-vb5ss   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-wr8ff   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>
nginx-deployment-6c8cb99bb9-zhb86   0/1     Pending   0          6m46s   <none>          <none>                                             <none>           <none>


๋ ˆํ”Œ๋ฆฌ์นด๋ฅผ 50์œผ๋กœ ์„ค์ •ํ•˜๊ฒŒ ๋˜๋ฉด ec2์˜ ํ• ๋‹น ๊ฐ€๋Šฅํ•œ ip ๊ฐœ์ˆ˜๋ฅผ ์ดˆ๊ณผํ•˜๋ฏ€๋กœ 10๊ฐœ์˜ ํŒŒ๋“œ๋“ค์€ Pending ์ƒํƒœ๋กœ ๋จ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.