๐Ÿš† ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค StaticPod(์Šคํƒœํ‹ฑ ํฌ๋“œ)

๊น€์„ฑ์ธยท2023๋…„ 10์›” 12์ผ
0

[DevOps] ๐ŸณDocker & Kubernetes

๋ชฉ๋ก ๋ณด๊ธฐ
24/62

์ปดํฌ๋„ŒํŠธ ํ”Œ๋ ˆ์ธ์—์˜ํ•ด ์ƒ์„ฑ๋œ ํฌ๋“œ๊ฐ€ ์•„๋‹ˆ๋ผ, ๋…ธ๋“œ์˜ ํ•„์š”์„ฑ์— ์˜ํ•ด kubelet์ด ์ง์ ‘ ์‹คํ–‰ํ•œ Pod

  • apiserver๋ฅผ ํ†ตํ•ด์„œ ์ƒ์„ฑ๋œ๊ฒŒ ์•„๋‹ˆ๊ธฐ ๋•Œ๋ฌธ์— apiserver๋ฅผ ํ†ตํ•ด ์Šคํƒœํ‹ฑํฌ๋“œ ์‚ญ์ œ๋Š” ๋ถˆ๊ฐ€๋Šฅํ•˜๋‹ค
  • ๊ธฐ๋ณธ๊ฒฝ๋กœ : /etc/kubernetes/manifests
    • ํ•ด๋‹น ํŒŒ์ผ์„ ์ˆ˜์ •ํ•˜์—ฌ ์„ค์ •ํ•จ. ์ˆ˜์ •ํ•˜๊ณ  ์ €์žฅ์‹œ ๋ฐ”๋กœ ์ ์šฉ๋˜๊ธฐ ๋•Œ๋ฌธ์— ๋ฐฑ์—… ๊ถŒ์žฅ

manifest ๊ฒฝ๋กœ ํ™•์ธ

vi/etc/systemd/system/kubelet.service.d ๋‚ด๋ถ€ configํŒŒ์ผ

vi /var/lib/kubelet/config.yaml: manifest๊ฒฝ๋กœ


https://kubernetes.io/ko/docs/tasks/configure-pod-container/static-pod/

๊ฐ„๋‹จํ•œ ์Šคํƒœํ‹ฑํฌ๋“œ ์ž‘์„ฑ

apiVersion: v1
kind: Pod
metadata:
  name: static-web
  labels:
    role: myrole
spec:
  containers:
    - name: web
      image: nginx
      ports:
        - name: web
          containerPort: 80
          protocol: TCP

manifest ๊ฒฝ๋กœ์— ์ƒ์„ฑํ•˜๋ฉด ์ž๋™์œผ๋กœ ๋งŒ๋“ค์–ด์ง.


-> ์ฃฝ์—ฌ๋„ ๋‹ค์‹œ ์‚ด์•„๋‚จ

0๊ฐœ์˜ ๋Œ“๊ธ€