[k8s] operator
์ด์ ํฌ์คํธ
https://blog.naver.com/sssang97/223114653465
operator ํจํด์ ์ฟ ๋ฒ๋คํฐ์ค์ ํต์ฌ ์์ ์ค ํ๋๋ค.
CustomResource์ ๋๋ถ์ด์ ํ์ฅ ํ๋ฌ๊ทธ์ธ ๋ฐ์๋ฅผ ๋ง๋ค๋ ์ฃผ๋ก ์ฌ์ฉํ๋ค.
operator์ custom resouce๋ ๋ค์๊ณผ ๊ฐ์ ๊ตฌ์กฐ๋ก ์์ฉ๋๋ค.
https://www.cncf.io/blog/2022/06/15/kubernetes-operators-what-are-they-some-examples/
custom resource๊ฐ ์ต์ข
client๊ฐ ์๊ตฌํ๋ ์์ฒญ์ ์ ์ํ ๋ฆฌ์์ค ์ ์๋ผ๋ฉด, operator๋ ๊ทธ๊ฑธ ์ฝ์ด์ ์ค์ง์ ์ธ ๋์์ ์ฑ
์์ง๋ controller ์ญํ ์ ํ๋ ๊ฒ์ด๋ค.
์ฌ๊ธฐ์ custom resource๋ yaml์ ํํ๋ก ๋ง๋ค ์ ์์ง๋ง, operator๋ ํ๋์ ํ๋ก๊ทธ๋จ์ด๊ธฐ ๋๋ฌธ์ ๋ณ๋์ ํ๋ก๊ทธ๋๋ฐ ์ธ์ด์ ํ๋ ์์ํฌ๋ฅผ ์ฌ์ฉํด์๋ง ๋ง๋ค ์ ์๋ค.
๊ทธ๋ฆฌ๊ณ ์์ฑ๋ ์คํํ์ผ์ ๋์ปค๋ก ๋ง์์ ๊ด๋ฆฌ์ ๊ถํ์ ๊ฐ์ง ์ปจํธ๋กค๋ฌ๋ฅผ ๋์ฐ๋ ํํ๊ฐ ๋๋ค.
operator๋ฅผ ๋ง๋ค๋ ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉ๋๋๊ฑด ํ์คํ Go๊ณ , Rust๋ ๊ทธ ๋ค์์ธ ๊ฒ ๊ฐ๋ค.
๋ํ์ ์ผ๋ก ๋คํธ์ํฌ ๊ด๋ จ ํ๋ฌ๊ทธ์ธ์ธ calico ๋ฐ์๊ฐ operator๋ก ๋ง๋ค์ด์ง ํดํท์ด๋ค.
์ฐธ์กฐ
https://kubernetes.io/ko/docs/concepts/extend-kubernetes/operator/
https://iximiuz.com/en/posts/kubernetes-operator-pattern/
https://metalbear.co/blog/writing-a-kubernetes-operator/
https://kubernetes.io/ko/docs/concepts/architecture/controller/