CICD

๐Ÿ”ญArgo CD v2.10 ๋ฆด๋ฆฌ์ฆˆ!

ApplicationSet์˜ ํ…œํ”Œ๋ฆฟ ๊ธฐ๋Šฅ ๊ณ ๋„ํ™” ๋ฐ App ๋ฐฐํฌ ์ƒํƒœ ์•Œ๋ฆผ ์„ค์ • ๊ด€๋ จ ์—…๋ฐ์ดํŠธ

2024.01.08 | ์กฐํšŒ 208 |
0
|

DevOps ์—ฌํ–‰์„ ์œ„ํ•œ ์†Œ์‹์ง€

DevOps, ํด๋ผ์šฐ๋“œ, IT ๊ธฐ์ˆ  ๊ด€๋ จ ์ตœ์‹  ์†Œ์‹๊ณผ ์ •๋ณด๋ฅผ ์ •๋ฆฌํ•ด์„œ ์ฃผ 1ํšŒ ์ด๋ฉ”์ผ๋กœ ์ „ํ•ด๋“œ๋ฆฝ๋‹ˆ๋‹ค๐Ÿ˜บ

์•ˆ๋…•ํ•˜์„ธ์š”, ์ตœ์‹  DevOps ์†Œ์‹์„ ์•Œ๊ธฐ ์‰ฝ๊ฒŒ ๊ณต์œ ํ•˜๋Š” DevOps ์—ฌํ–‰์„ ์œ„ํ•œ ์†Œ์‹์ง€์ž…๋‹ˆ๋‹ค.

์ง€๋‚œ 12์›”, CD(Continuous Deployment, ์ง€์†์  ๋ฐฐํฌ) ํˆด๋กœ ์œ ๋ช…ํ•œ Argo CD์˜ 2.10 ๋ฒ„์ „์ด ๋ฆด๋ฆฌ์ฆˆ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. Argo CD๋Š” Kubernetes ํด๋Ÿฌ์Šคํ„ฐ์— ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋ณด๋‹ค ์‰ฝ๊ฒŒ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๋„๋ก ๋„์™€์ฃผ๋Š” Tool์ธ๋ฐ์š”.

ํŠน์ • Git ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ์— ์ €์žฅ๋œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ •์˜(Kubernetes์—์„œ App ๋ฐฐํฌ ์‹œ ์‚ฌ์šฉํ•˜๋Š” yaml ํŒŒ์ผ ๋“ฑ)๋ฅผ Web UI ๋˜๋Š” CLI(Command Line Interface)๋กœ ์‰ฝ๊ฒŒ ๋ฐฐํฌํ•˜๊ณ  ์ƒํƒœ๋ฅผ ํ™•์ธํ•˜๊ฑฐ๋‚˜ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์–ด์„œ ๋„๋ฆฌ ์‚ฌ์šฉ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.๐Ÿ‘

๊ทธ๋Ÿผ Argo CD ์ตœ์‹  ๋ฆด๋ฆฌ์ฆˆ์˜ ์ฃผ์š” ์—…๋ฐ์ดํŠธ๋ฅผ ์‚ดํŽด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.๐Ÿ”Ž

 

โš™App ๋ฐฐํฌ๋ฅผ ๋ณด๋‹ค ์œ ์—ฐํ•˜๊ฒŒ, ApplicationSet ํ…œํ”Œ๋ฆฟ ๊ธฐ๋Šฅ ๊ณ ๋„ํ™”

์ด๋ฒˆ ๋ฆด๋ฆฌ์ฆˆ๋ฅผ ํ†ตํ•ด Argo CD์—์„œ App์„ ๋ฐฐํฌํ•  ๋•Œ ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ ์ •์˜ํ•˜๋Š” AppicationSet์˜ ํ…œํ”Œ๋ฆฟ ๊ธฐ๋Šฅ์ด ๊ณ ๋„ํ™”๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

ApplicationSet์€ App์˜ ์ด๋ฆ„, App ์ •์˜ ํŒŒ์ผ์ด ์ €์žฅ๋œ ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ URL, App ์ •์˜ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ์ฒ˜๋Ÿผ ๋ฐฐํฌ์— ํ•„์š”ํ•œ ์ „๋ฐ˜์ ์ธ ์ •๋ณด๋ฅผ ์ •์˜ํ•˜๊ณ , ๊ฐ€์ง€๊ณ  ์žˆ๋˜ ์ •๋ณด๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ํ•ด๋‹น App์„ ๋ฐฐํฌํ•˜๋Š” ์—ญํ• ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

ApplicationSet์˜ ํ…œํ”Œ๋ฆฟ ๊ธฐ๋Šฅ์€ generators์— ๋ฏธ๋ฆฌ ์ •์˜ํ•œ ํŠน์ • ๊ฐ’์„ App ๋ฐฐํฌ ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ template ๋‚ด {{ํŠน์ • ์œ„์น˜}}์— ๋Œ€์ž… ํ›„ App์„ ๋ฐฐํฌํ•˜๋ฏ€๋กœ ๋‹ค์–‘ํ•œ ๋ฐฐํฌ ๋ฐฉ์‹์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค.

ApplicationSet์˜ template ๊ธฐ๋Šฅ์„ ๋ณด์—ฌ์ฃผ๋Š” ์˜ˆ์‹œ ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.
ApplicationSet์˜ template ๊ธฐ๋Šฅ์„ ๋ณด์—ฌ์ฃผ๋Š” ์˜ˆ์‹œ ํŒŒ์ผ์ž…๋‹ˆ๋‹ค.

์œ„ ApplicationSet ์˜ˆ์‹œ์—์„  generators - list - elements์— ๋ฏธ๋ฆฌ ์ •์˜ํ•œ cluster์™€ url ๊ฐ’์„ template์˜ ๊ฐ {{cluster}} ๋ฐ {{url}}์— ์ง‘์–ด๋„ฃ์€ ๋’ค Kubernetes์— ๋ฐฐํฌํ•˜๋ฏ€๋กœ, ์„ธ ๊ฐ€์ง€ App(engineering-dev-guestbook, engineering-prod-guestbook, finance-preprod-guestbook)์ด ๊ฐ๊ฐ์˜ url์„ ๊ฐ€์ง€๊ณ  ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค.

์ด๋ฒˆ ๋ฆด๋ฆฌ์ฆˆ์—์„  ์—ฌ๊ธฐ์— templatePatch ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•˜์—ฌ template์— if๋ฌธ ๋“ฑ์„ ์ •์˜ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๊ณ , ๋ณต์žกํ•œ ๋ฐฐํฌ ์ •์ฑ…๋„ ์ง€์›ํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์œ„ ApplicationSet ์˜ˆ์‹œ์— templatePatch๊ฐ€ ์ถ”๊ฐ€๋กœ ์ •์˜๋œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.
์œ„ ApplicationSet ์˜ˆ์‹œ์— templatePatch๊ฐ€ ์ถ”๊ฐ€๋กœ ์ •์˜๋œ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.

๋งŒ์•ฝ ์œ„์™€ ๊ฐ™์ด templatePatch๊ฐ€ ์ถ”๊ฐ€๋œ ์˜ˆ์‹œ์—์„œ generators์— autoSync๊ฐ€ true๋กœ ์ •์˜๋˜์–ด ์žˆ๋‹ค๋ฉด, templatePatch ๋‚ด {{- if .autoSync}} ๋ธ”๋ก ๋‚ด์šฉ์ด ์ ์šฉ๋˜์–ด ๋ฐฐํฌ๋ฉ๋‹ˆ๋‹ค.

 

๐Ÿ“ขApp ๋ฐฐํฌ ์ƒํƒœ ์•Œ๋ฆผ ์„ค์ • ์—…๋ฐ์ดํŠธ

์ด๋ฒˆ ๋ฆด๋ฆฌ์ฆˆ์—์„  App ๋ฐฐํฌ ์‹œ ์ƒํƒœ ์•Œ๋ฆผ(Notification) ์„ค์ •์— ๋Œ€ํ•ด์„œ๋„ ์—…๋ฐ์ดํŠธ๊ฐ€ ์žˆ์—ˆ์Šต๋‹ˆ๋‹ค. ๋ฐ”๋กœ ๊ด€๋ฆฌ์ž๊ฐ€ ์•„๋‹Œ ์‚ฌ์šฉ์ž๊ฐ€ ๋ฐฐํฌํ•œ App์— ๋Œ€ํ•ด ์‚ฌ์šฉ์ž๋„ App ๋ฐฐํฌ ์ƒํƒœ ์•Œ๋ฆผ์„ ์„ค์ • ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋œ ๊ฒƒ์ธ๋ฐ์š”.

๊ธฐ์กด์—๋Š” ๊ด€๋ฆฌ์ž๋งŒ์ด ๋ฐฐํฌ๋œ App์˜ ์ƒํƒœ ๋ณ€ํ™”์— ๋Œ€ํ•œ ์•Œ๋ฆผ ์„ค์ •์ด ๊ฐ€๋Šฅํ–ˆ์Šต๋‹ˆ๋‹ค. 

๊ทธ๋Ÿฌ๋‹ค Argo CD v2.5 ๋ฆด๋ฆฌ์ฆˆ๋ฅผ ๊ฑฐ์น˜๋ฉด์„œ ๊ด€๋ฆฌ์ž๊ฐ€ ์•„๋‹Œ ์‚ฌ์šฉ์ž๋„ App์„ ๋ฐฐํฌํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋˜์—ˆ๋Š”๋ฐ์š”. ์—ฌ๊ธฐ์— ๋Œ€ํ•œ ์—ฐ์žฅ์„ ์œผ๋กœ, ์ด๋ฒˆ ์—…๋ฐ์ดํŠธ๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉ์ž๋„ ์ž์‹ ์ด ๋ฐฐํฌํ•œ App์˜ ์•Œ๋ฆผ ์„ค์ •์ด ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ด๋ ‡๊ฒŒ ์—…๋ฐ์ดํŠธ๋œ ๊ฐ€์žฅ ํฐ ์ด์œ ๋Š” ๋น„ํšจ์œจ์„ฑ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•จ์ž…๋‹ˆ๋‹ค. ๊ธฐ์กด ๋ฐฉ์‹์—์„  App ๋ฐฐํฌ ์ƒํƒœ ์•Œ๋ฆผ ์„ค์ •์„ ํ•˜๋ ค๋ฉด ๊ด€๋ฆฌ์ž๋ฅผ ๊ฑฐ์ณ์•ผ ํ–ˆ๊ณ , ์‹œ๊ฐ„๊ณผ ๋น„์šฉ์ด ์“ฐ์ผ ์ˆ˜๋ฐ–์— ์—†์—ˆ๊ธฐ ๋•Œ๋ฌธ์ด์ฃ .

 

๐Ÿ”ญ๋งˆ์น˜๋ฉฐ...

Argo CD๋Š” ์•ž์„œ ๋ง์”€๋“œ๋ฆฐ ๊ฒƒ์ฒ˜๋Ÿผ Git ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ๋ฅผ ์ค‘์‹ฌ(GitOps)์œผ๋กœ CD(Continuous Deployment) ์ž‘์—…์— ๋„๋ฆฌ ์“ฐ์ด๋Š” ํˆด์ด๊ธฐ ๋•Œ๋ฌธ์— ์ด๋ฒˆ ์†Œ์‹์ง€ ์ฃผ์ œ๋กœ ๋‹ค๋ค„๋ดค๋Š”๋ฐ์š”.

ํ˜น์‹œ Argo CD ๊ด€๋ จํ•ด์„œ ๋” ๊ถ๊ธˆํ•œ ์ ์ด๋‚˜ ์˜๊ฒฌ์ด ์žˆ์œผ์‹œ๋‹ค๋ฉด ์•„๋ž˜ ๋ฉ”์ผ๋ฆฌ ๋Œ“๊ธ€ ๋‚จ๊ฒจ์ฃผ์„ธ์š”.๐Ÿ˜€

๊ทธ๋Ÿผ, ๋‹ค์Œ ์†Œ์‹์ง€์—์„œ ๋ณด๋‹ค ์•Œ์ฐจ๊ณ  ํฅ๋ฏธ๋กœ์šด ๋‚ด์šฉ์œผ๋กœ ์ฐพ์•„๋ต™๊ฒ ์Šต๋‹ˆ๋‹ค.

๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๐Ÿ˜บ

 

๐Ÿ”—์ถœ์ฒ˜

Argo CD v2.10 Release Candidate

Argo CD - Declarative GitOps CD for Kubernetes

๋‹ค๊ฐ€์˜ฌ ๋‰ด์Šค๋ ˆํ„ฐ๊ฐ€ ๊ถ๊ธˆํ•˜์‹ ๊ฐ€์š”?

์ง€๊ธˆ ๊ตฌ๋…ํ•ด์„œ ์ƒˆ๋กœ์šด ๋ ˆํ„ฐ๋ฅผ ๋ฐ›์•„๋ณด์„ธ์š”

์ด๋ฒˆ ๋‰ด์Šค๋ ˆํ„ฐ ์–ด๋– ์…จ๋‚˜์š”?

DevOps ์—ฌํ–‰์„ ์œ„ํ•œ ์†Œ์‹์ง€ ๋‹˜์—๊ฒŒ โ˜•๏ธ ์ปคํ”ผ์™€ โœ‰๏ธ ์ชฝ์ง€๋ฅผ ๋ณด๋‚ด๋ณด์„ธ์š”!

๋Œ“๊ธ€

์˜๊ฒฌ์„ ๋‚จ๊ฒจ์ฃผ์„ธ์š”

ํ™•์ธ
์˜๊ฒฌ์ด ์žˆ์œผ์‹ ๊ฐ€์š”? ์ œ์ผ ๋จผ์ € ๋Œ“๊ธ€์„ ๋‹ฌ์•„๋ณด์„ธ์š” !
ยฉ 2024 DevOps ์—ฌํ–‰์„ ์œ„ํ•œ ์†Œ์‹์ง€

DevOps, ํด๋ผ์šฐ๋“œ, IT ๊ธฐ์ˆ  ๊ด€๋ จ ์ตœ์‹  ์†Œ์‹๊ณผ ์ •๋ณด๋ฅผ ์ •๋ฆฌํ•ด์„œ ์ฃผ 1ํšŒ ์ด๋ฉ”์ผ๋กœ ์ „ํ•ด๋“œ๋ฆฝ๋‹ˆ๋‹ค๐Ÿ˜บ

๋‰ด์Šค๋ ˆํ„ฐ ๋ฌธ์˜eduukulelekim@gmail.com

์ž์ฃผ ๋ฌป๋Š” ์งˆ๋ฌธ ์„œ๋น„์Šค ์†Œ๊ฐœ์„œ ์˜ค๋ฅ˜ ๋ฐ ๊ธฐ๋Šฅ ๊ด€๋ จ ์ œ๋ณด

์„œ๋น„์Šค ์ด์šฉ ๋ฌธ์˜admin@team.maily.so

๋ฉ”์ผ๋ฆฌ ์‚ฌ์—…์ž ์ •๋ณด

๋ฉ”์ผ๋ฆฌ (๋Œ€ํ‘œ์ž: ์ดํ•œ๊ฒฐ) | ์‚ฌ์—…์ž๋ฒˆํ˜ธ: 717-47-00705 | ์„œ์šธ ์„œ์ดˆ๊ตฌ ๊ฐ•๋‚จ๋Œ€๋กœ53๊ธธ 8, 8์ธต 11-7ํ˜ธ

์ด์šฉ์•ฝ๊ด€ | ๊ฐœ์ธ์ •๋ณด์ฒ˜๋ฆฌ๋ฐฉ์นจ | ์ •๊ธฐ๊ฒฐ์ œ ์ด์šฉ์•ฝ๊ด€