[CI/CD] Tekton vs HyperCloud Integration Config ์์ ์ ๋ฆฌ
๐ ๋ค์ด๊ฐ๋ฉฐ
์ด๋ฒ ๊ธ์์๋ Tekton๊ณผ HyperCloud Integration Config(IC)์ ๊ด๊ณ๋ฅผ ์ ๋ฆฌํ๋ค. ๊ฒฐ๋ก ๋ถํฐ ๋งํ๋ฉด IC๋ Tekton์ ๊ฐ์ผ ์ถ์ํ ๋ ์ด์ด(๊ป๋ฐ๊ธฐ)์ด๊ณ , ์ค์ ๋ก ์ผํ๋ ์์ง์ Tekton์ด๋ค. ๊ฐ ์ปดํฌ๋ํธ์ ์ญํ ๊ณผ ICโTekton ๋ณํ, ๊ทธ๋ฆฌ๊ณ ๋์ ์ฅ๋จ์ ์ ๋น๊ตํ๋ค.
ํต์ฌ ๊ฒฐ๋ก โ IC๋ โ๊ฐ๋จํ ์ค์ ๋ฌธ๋ฒโ, CICD Operator๋ โIC โ Tekton ๋ฒ์ญ๊ธฐโ, Tekton์ โ์ค์ ์คํ ์์งโ์ด๋ค. ์ฌ์ฉ์๋ IC๋ง ์๋ฉด ๋๊ณ , ๊ทธ ๋ค์์ Operator๊ฐ Tekton ๋ฆฌ์์ค๋ก ๋ณํํด ์คํํ๋ค.
1. ์ ์ฒด ๊ณ์ธต ๊ตฌ์กฐ
flowchart TD
UI["HyperCloud Console(UI)"] --> IC["Integration Config<br/>(์ถ์ํ ๋ฌธ๋ฒ)"]
IC --> Op["CICD Operator (0.4.14)<br/>IC โ Tekton ๋ณํ"]
Op --> Tk["Tekton Pipelines (0.26.0)<br/>์ค์ ์คํ ์์ง"]
Tk --> Pods["Kubernetes Pods<br/>(compileยทbuildยทscanยทpush)"]
| ์ปดํฌ๋ํธ | ์ญํ | ๋น์ |
|---|---|---|
| Integration Config | ํ์ดํ๋ผ์ธ ํ ํ๋ฆฟ(๊ฐ์ํ) | ํ๊ตญ์ด ๋ ์ํผ |
| CICD Operator | IC โ Tekton ๋ณํ | ๋ฒ์ญ๊ธฐ |
| Tekton Pipelines | ์ค์ ์คํ ์์ง | ์ฃผ๋ฐฉ ์ฅ๋น |
| Kubernetes | Pod ์คํ ์ธํ๋ผ | ์ฃผ๋ฐฉ ๊ณต๊ฐ |
2. Tekton โ ์คํ ์์ง
Kubernetes-native CI/CD ํ๋ ์์ํฌ๋ก, Task โ Pipeline โ PipelineRun์ 3๊ณ์ธต์ด ํต์ฌ์ด๋ค.
| ๋ฆฌ์์ค | ์ญํ |
|---|---|
| Task | ์ฌ์ฌ์ฉ ๊ฐ๋ฅํ ์์ ๋จ์(steps) |
| Pipeline | Task๋ค์ ์์ ์ ์(runAfter) |
| PipelineRun | Pipeline ์คํ ์ธ์คํด์ค |
1
2
3
4
5
6
7
8
9
# Pipeline: Task ์์
kind: Pipeline
spec:
tasks:
- name: compile
taskRef: {name: maven-compile}
- name: build-image
taskRef: {name: buildah-build}
runAfter: [compile] # compile ์๋ฃ ํ
Tekton์ Pod ์์ฑยท์คํ, Workspace/Results๋ก Task ๊ฐ ๋ฐ์ดํฐ ์ ๋ฌ, ์ํ ์ถ์ , ๋ก๊ทธ ์์ง์ ๋ด๋นํ๋ค.
3. Integration Config โ ์ถ์ํ ๋ ์ด์ด
HyperCloud๊ฐ Tekton ์์ ์น์ ์ค์ ๊ฐ์ํ ๋๊ตฌ๋ค. Git ์ฐ๋ยทํธ๋ฆฌ๊ฑฐยทWebhook์ ๊ฐ๋จํ ๋ฌธ๋ฒ์ผ๋ก ์ ์ธํ๋ค.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
apiVersion: cicd.tmax.io/v1
kind: IntegrationConfig
spec:
git:
type: gitlab
url: https://gitlab.example.com/myapp.git
jobs:
preSubmit: # MR ์
- {name: test, image: maven:3.8, script: mvn test}
postSubmit: # merge ํ
- {name: compile, image: scr-maven-img-aicd, script: /usr/local/s2i/bin/assemble}
- name: build-image
image: buildah:v1.23.3
script: buildah bud -t myapp:latest
when: [{key: refs, value: refs/heads/main}]
triggers:
- type: gitlab
gitlab: {push: {branch: main}}
๐ก IC๋ ์ง์ ์คํํ์ง ์๋๋ค. ๊ฐ์ํ๋ ๋ฌธ๋ฒ์ผ๋ก ํ์ดํ๋ผ์ธ์ ์ ์ธํ ๋ฟ, ์ค์ ์คํ์ Operator๊ฐ Tekton์ผ๋ก ๋ณํํ ๋ค ์ด๋ค์ง๋ค. IC๋ โ๋ฌด์์ ํ ์งโ, Tekton์ โ์ด๋ป๊ฒ ์คํํ ์งโ๋ฅผ ๋งก๋๋ค.
4. CICD Operator โ ๋ฒ์ญ๊ธฐ
IC๋ฅผ ๊ฐ์งํด Tekton ๋ฆฌ์์ค ์ธํธ(TaskยทPipelineยทTriggerTemplateยทTriggerBindingยทEventListener)๋ฅผ ์๋ ์์ฑํ๊ณ GitLab Webhook์ ๋ฑ๋กํ๋ค.
1
2
3
# IC ํ๋๊ฐ ๋ง๋ค์ด๋ด๋ Tekton ๋ฆฌ์์ค๋ค
kubectl get task,pipeline,triggertemplate,eventlistener -n shg-cicd-aicd
# โ myapp-compile, myapp-build, myapp-pipeline, myapp-trigger, myapp-listener
5. ์ฝ๋ ํธ์ ์คํ ํ๋ฆ
flowchart LR
Push["git push"] --> WH["GitLab Webhook"]
WH --> EL["EventListener<br/>(Tekton Trigger)"]
EL --> TT["TriggerTemplate<br/>โ PipelineRun ์์ฑ"]
TT --> PC["Pipeline Controller<br/>Task ์์ฐจ ์คํ"]
PC --> P1["compile Pod"] --> P2["build Pod"] --> P3["push Pod"]
๊ฐ Task๋ ๋ณ๋ Pod์์ ์คํ๋๊ณ ์๋ฃ ํ ์๋ ์ญ์ ๋๋ฉฐ, PipelineRun ์ํ(Succeeded/Failed)๊ฐ Console์ ํ์๋๋ค.
6. IC vs Tekton ์ง์ ์ฌ์ฉ
| ๋ฐฉ์ | ์ฅ์ | ๋จ์ |
|---|---|---|
| IC(HyperCloud) | ๊ฐ๋จํ ๋ฌธ๋ฒยทUI ๊ด๋ฆฌยทWebhook ์๋ยทTekton ๋ชฐ๋ผ๋ ์ฌ์ฉ | HyperCloud ์ ์ฉ(์ด์์ฑโ)ยท๊ณ ๊ธ ๋ถ๊ธฐ ์ ํ |
| Tekton ์ง์ | ์์ ํ ์ ์ดยท์ด์์ฑยท์ปค๋ฎค๋ํฐ Task ์ฌ์ฌ์ฉ | ํ์ต ๊ณก์ โยทYAML ๋ง์ยทWebhook ์๋ |
๐ก HyperCloud๊ฐ IC๋ฅผ ๋ง๋ ์ด์ โ Tekton์ ๊ฐ๋ ฅํ์ง๋ง K8s ์ ๋ฌธ๊ฐ์ฉ์ด๋ผ ์ง์ ์ฅ๋ฒฝ์ด ๋๋ค. IC๋ก ๊ฐ์ธ ๊ฐ๋ฐ์๋ ์ฝ๊ฒ ์ฐ๊ฒ ํ๊ณ , HyperAuthยทHyperRegistryยทConsole๊ณผ ์๋ ์ฐ๋ํ๋ค. ๋ค๋ง Tmax ์ข ์์ด๋ผ, ํ์คํยทํ๋ซํผ ๋ ๋ฆฝ์ฑ์ ์ํด GitLab Runner๋ก ์ ํํ๋ ํ๋ฆ๋ ์๋ค.
7. ํ์ธ ๋ช ๋ น์ด
1
2
3
4
kubectl get tasks,pipelines,pipelineruns -n shg-cicd-aicd # IC๊ฐ ๋ง๋ ๋ฆฌ์์ค
kubectl get ic myapp-ic -n shg-cicd-aicd -o yaml # IC ์๋ณธ
tkn pipelinerun logs -f <pr-name> -n shg-cicd-aicd # ์ค์๊ฐ ๋ก๊ทธ
kubectl logs -n cicd-system -l app=cicd-operator -f # ๋ณํ ๊ณผ์
๐ ์ ๋ฆฌ
1
2
3
4
5
Tekton vs IC
โโ ๊ด๊ณ IC(๊ป๋ฐ๊ธฐ) โ Operator(๋ฒ์ญ) โ Tekton(์์ง) โ Pod
โโ Tekton TaskโPipelineโPipelineRun(์ค์ ์คํ)
โโ IC ๊ฐ์ํ ๋ฌธ๋ฒ(Gitยทํธ๋ฆฌ๊ฑฐยทWebhook ์๋)
โโ ์ ํ IC(์ฌ์ยท์ข
์) vs Tekton(์ ์ดยท์ด์์ฑ)
| ๊ฐ๋ | ํ ์ค ์ ์ |
|---|---|
| IC | Tekton ์ถ์ํ ๋ ์ด์ด |
| CICD Operator | IC โ Tekton ๋ณํ๊ธฐ |
| Tekton | ์ค์ ํ์ดํ๋ผ์ธ ์์ง |
ํต์ฌ์ IC๋ ๊ป๋ฐ๊ธฐ, Tekton์ด ์์ง์ด๋ผ๋ ๊ฒ์ด๋ค. IC๋ก ์ฝ๊ฒ ์์ํ๋ ๋ด๋ถ์ ์ผ๋ก๋ Tekton์ด ๋์๊ฐ๋ค๋ ๊ตฌ์กฐ๋ฅผ ์ดํดํ๋ฉด, ํธ๋ฌ๋ธ์ํ ์ ์ด๋ ๊ณ์ธต(IC ๋ฌธ๋ฒ / Operator ๋ณํ / Tekton ์คํ)์ ๋ด์ผ ํ ์ง ๋ช ํํด์ง๋ค.
Comments powered by Disqus.