๋…ธ๋“œ์˜ kubelet ๋ฐ๋ชฌ์— ์˜ํ•ด ์ง์ ‘ ๊ด€๋ฆฌ๋˜๋Š” Pod์œผ๋กœ, yaml ํŒŒ์ผ์„ ํ†ตํ•ด ์ƒ์„ฑ/์ˆ˜์ •/์‚ญ์ œํ•œ๋‹ค.

1 minute read

๋…ธ๋“œ์˜ kubelet ๋ฐ๋ชฌ์— ์˜ํ•ด ์ง์ ‘ ๊ด€๋ฆฌ๋˜๋Š” Pod์œผ๋กœ, yaml ํŒŒ์ผ์„ ํ†ตํ•ด ์ƒ์„ฑ/์ˆ˜์ •/์‚ญ์ œํ•œ๋‹ค.

Static Pod์˜ ์ƒ์„ฑ

์ผ๋ฐ˜ Pod์„ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ๊ณผ ๋™์ผํ•œ Pod yaml ํŒŒ์ผ์„ ์‚ฌ์šฉํ•œ๋‹ค. ๋‹ค๋ฅธ ์ ์€ kubectl์ด ์•„๋‹ˆ๋ผ Pod yaml ํŒŒ์ผ์„ /etc/kubernetes/manifests/ ๋””๋ ‰ํ† ๋ฆฌ ์•„๋ž˜์— ์œ„์น˜ ์‹œํ‚จ๋‹ค๋Š” ๊ฒƒ์ด๋‹ค.

๋งˆ์Šคํ„ฐ ๋…ธ๋“œ์˜ ์ปดํฌ๋„ŒํŠธ์™€ Static Pod

Static Pod์œผ๋กœ Pod์„ ๋„์šฐ๋ฉด, kubectl๋กœ ํ•ด๋‹น Pod์„ ์‚ญ์ œํ•  ์ˆ˜ ์—†๋‹ค. ์ด๋Ÿฐ ์  ๋•Œ๋ฌธ์— ํด๋Ÿฌ์Šคํ„ฐ์˜ ํ•ต์‹ฌ์ธ controlplane์˜ ์ปดํฌ๋„ŒํŠธ๋“ค: apiserver, controller-manager, etcd ๋“ฑ์„ Static Pod์œผ๋กœ ์ƒ์„ฑํ•˜๊ณ  ๊ด€๋ฆฌํ•œ๋‹ค.

๋ฏธ๋Ÿฌ ํŒŒ๋“œ(mirror pod)

Static Pod์€ api-server๊ฐ€ ์•„๋‹ˆ๋ผ kubelet ๋ฐ๋ชฌ์ด ๊ด€๋ฆฌํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ kubelet get pods๋ฅผ ํ†ตํ•ด์„œ etcd Pod ๋“ฑ Static Pod๋“ค์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค. ์ด๊ฒƒ์€ kubelet ๋ฐ๋ชฌ์ด api-server์— Static Pod์— ๋Œ€ํ•œ ๋ฏธ๋Ÿฌ ํŒŒ๋“œ(mirror pod) ์ƒ์„ฑ์„ ์š”์ฒญํ•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ์ฆ‰, ์šฐ๋ฆฌ๊ฐ€ kubelet get pods๋ฅผ ํ†ตํ•ด ๋ณด๋Š” etcd Pod์€ Static Pod์˜ ๋ณธ์ฒด๊ฐ€ ์•„๋‹ˆ๋ผ ๋ถ„์‹ ์ธ ์…ˆ์ด๋‹ค!

๊ทธ๋ž˜์„œ kubelet delete pod ...์„ ํ•˜๋”๋ผ๋„ ๋ฏธ๋Ÿฌ ํŒŒ๋“œ๊ฐ€ ์ž ์‹œ ๋‚ด๋ ค๊ฐˆ ๋ฟ, ๋ณธ์ฒด์ธ Static Pod์€ ๋‚ด๋ ค๊ฐ€์ง€ ์•Š๋Š”๋‹ค!

What if no controlplane?

๋งŒ์•ฝ kube-api-server์™€ master node๊ฐ€ ์—†๋‹ค๊ณ  ์ƒ๊ฐํ•ด๋ณด์ž. ๊ฐœ๋ณ„ ๋…ธ๋“œ๊ฐ€ Pod์„ ์ƒ์„ฑํ•  ์ˆ˜ ์žˆ์„๊นŒ? ๋ฐฉ๋ฒ•์€ Static Pod์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด๋‹ค!

๋…ธ๋“œ์˜ /etc/kubernetes/manifests/ ๊ฒฝ๋กœ์— Pod yaml ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๋ฉด, ๋…ธ๋“œ์˜ kubelet ๋ฐ๋ชฌ์ด ํŒŒ์ผ์„ ํ™•์ธํ•˜๊ณ , ํ•ด๋‹น Pod์„ ์ƒ์„ฑํ•  ๊ฒƒ์ด๋‹ค.

์ฆ‰, controlplane์ด ์—†์–ด๋„ ๊ฐœ๋ณ„ ๋…ธ๋“œ์—์„œ Pod์„ ์ƒ์„ฑ/์ˆ˜์ •/์‚ญ์ œ ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฒƒ์ด๋‹ค. ๊ทธ๋Ÿฌ๋‚˜ ์ปจํŠธ๋กค ๋ฆฌ์†Œ์Šค์ธ ReplicaSet, Deployment, Daemonset๊ณผ ๋„คํŠธ์›Œํฌ ๋ฆฌ์†Œ์Šค์ธ Service๋Š” ์ƒ์„ฑํ•˜์ง€ ๋ชปํ•œ๋‹ค.