[AWS] EKS: Fargate ๋ ธ๋ ๊ตฌ์ฑ
EKS๋ Fargate๋ก๋ ๋
ธ๋๋ฅผ ๊ตฌ์ฑํ๊ณ ๋์ธ ์ ์๋ค.
EC2 ๊ตฌ์ฑ๊ณผ๋ ๋ค๋ฅด๊ฒ ์ค์ผ์ผ๋ง์ด ๋งค์ฐ ์์ ๋กญ๋ค๋ ์ฅ์ ์ด ์๋ค. ์ธ์คํด์ค ์ฌ์ด์ฆ๋ฅผ ์ ๊ฒฝ์ธ ํ์๊ฐ ์๋ค.
๋ค๋ง, Daemonset ๊ฐ์ ๊ธฐ๋ฅ์ ์ธ ์ ์๋ค๊ฑฐ๋ ํ๋ ์ ํ์ด ์ข ์๋ค.
์๋ ๋ฌธ์๋ฅผ ๋ณด๋ฉด ์ด๋์ ๋ ๋ง๋ค...
https://docs.aws.amazon.com/ko_kr/eks/latest/userguide/fargate.html
IAM Role ๊ตฌ์ฑ
Fargate profile ์ ์ฉ ์ญํ ์ ํ๋ ๋ง๋ ๋ค.
EKS Fargate Pod ํ์
์ผ๋ก ํ๊ณ
์ด๋ฆ์ AmazonEKSFargatePodExecutionRole๋ก ํด์ค๋ค.
๋๋ค.
Fargate profile
Fargate profile์ fargate ์ธ์คํด์ค๋ฅผ ์ด๋ป๊ฒ ๋์ธ ๊ฒ์ธ์ง๋ฅผ ์ ์ํ๋ ์๋ธ์์คํ ์ด๋ค.
profile์์ ์ฟ ๋ฒ๋คํฐ์ค ๋ค์์คํ์ด์ค์ ๋ ์ด๋ธ๋ก ํํ๋ฅผ ์ ์ํด๋๋ฉด, ์ดํ์ ๊ฑฐ๊ธฐ์ ๋ง์ถฐ์ ์์ฒญ๋๋ pod๋ค์ fargate๋ก ์ฌ๋ผ๊ฐ๋ ์์ด๋ค.

์ฐ์ ํ๋ ๋ง๋ค์ด๋ณด๊ฒ ๋ค.

์ด๋ฆ์ ์ ๋นํ ์ง๊ณ
๋ฐฉ๊ธ ๋ง๋ ์ญํ ์ ๋ฃ์ด์ค๋ค.
๊ทธ๋ฆฌ๊ณ ๋ค์์คํ์ด์ค์ ๋ ์ด๋ธ ์ ๋ ํฐ๋ฅผ ์ ์ ํ ์ง์ ํด์ค๋ค.
์ ๋ฌ๋ฉด default ๋ค์์คํ์ด์ค์์ app=test-server ๋ ์ด๋ธ์ ๊ฐ์ง ํ๋๋ฅผ ์ ๋ถ fargate๋ก ๋์์ค ๊ฒ์ด๋ค.
๊ทธ๋ฆฌ๊ณ ์ ์กฐ๊ฑด์ ๋ง๊ฒ๋ ํ๋ ์์ฑ์ ๋์ฐ๋ฉด
kubectl create deployment test-server --image=myyrakle/node-server-for-test

๊ฑฐ๊ธฐ์ ๋ง์ถฐ์ Fargate๋ก ๋ ธ๋๋ฅผ ๋์ฐ๊ณ ํ๋ก๋น์ ๋์ ํด์ค ๊ฒ์ด๋ค.
๋์ถฉ ์ด๋ฐ ๋๋์ผ๋ก ์ฐ๋ฉด ๋๋ค.
์ฐธ์กฐ
https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html