CI/CD
목적
Lumie의 CI/CD 경로는 GitOps에 인접해 있지만 GitOps만으로 끝나지는 않습니다. Tekton이 Gitea push 이벤트에 반응하고, 이미지를 빌드해 Zot으로 push하고, 갱신된 이미지 태그를 lumie-infra에 다시 커밋한 다음, 실제 롤아웃은 Argo CD가 수행합니다.
이 페이지는 build trigger, pipeline template, 이미지 게시, GitOps로 넘어가는 values-update 핸드오프를 변경하는 개발자를 위한 reference 문서입니다. Tekton controller 설치는 Tekton을 참고하세요.
소스 경로
| 경로 | 역할 |
|---|---|
lumie-infra/applications/tekton/ci-cd/argocd.yaml | CI/CD 매니페스트용 Argo CD 애플리케이션 |
lumie-infra/applications/tekton/ci-cd/manifests/triggers/eventlistener.yaml | Gitea webhook 라우팅과 경로 기반 trigger 필터 |
lumie-infra/applications/tekton/ci-cd/manifests/triggers/triggerbinding.yaml | webhook payload 필드를 Tekton 파라미터로 매핑 |
lumie-infra/applications/tekton/ci-cd/manifests/triggers/triggertemplate.yaml | 저장소 또는 워커 slice별 PipelineRun 오브젝트 생성 |
lumie-infra/applications/tekton/ci-cd/manifests/pipelines/*.yaml | Spring Boot, Next.js, FastAPI, Python, React build용 pipeline 정의 |
lumie-infra/applications/tekton/ci-cd/manifests/tasks/kaniko-build-push.yaml | clone, build, tag, push 로직 |
lumie-infra/applications/tekton/ci-cd/manifests/tasks/git-update-values.yaml | 갱신된 이미지 태그를 lumie-infra에 다시 커밋 |
lumie-infra/applications/tekton/ci-cd/manifests/secrets/*.yaml | Vault 기반 Gitea, webhook, Zot 자격 증명 |
lumie-infra/applications/lumie/**/common-values.yaml | 성공적인 build 후 Tekton이 변경하는 deployment values |
런타임 흐름
퍼블릭 표면
| 표면 | 계약 |
|---|---|
EventListener github-listener | refs/heads/main에 대한 X-Gitea-Event=push만 허용 |
Trigger binding github-push-binding | http://gitea-http.gitea.svc.cluster.local:3000/<org>/<repo>.git에서 저장소 clone |
| Pipeline 결과 태그 | kaniko-build-push가 짧은 commit SHA를 IMAGE_TAG에, digest를 IMAGE_DIGEST에 기록 |
| Values updater | git-update-values가 sed로 하나 이상의 YAML 파일을 수정하고, 최대 5회 push 또는 rebase를 재시도하며 커밋 |
GitOps로의 핸드오프는 명시적으로 Git 기반입니다. Tekton은 인클러스터 Deployment를 직접 패치하지 않습니다.
활성 파이프라인 카탈로그
| Trigger 또는 template | Pipeline | 갱신되는 배포 대상 |
|---|---|---|
lumie-document-build-template | nextjs-build-deploy | applications/lumie/document/helm-values.yaml |
lumie-frontend-build-template | nextjs-build-deploy | applications/lumie/frontend/common-values.yaml 하위 |
lumie-backend-build-template | lumie-springboot-build-deploy | applications/lumie/backend/common-values.yaml |
lumie-grading-svc-build-template | fastapi-build-deploy | applications/lumie/worker/grading-svc/common-values.yaml 하위 |
lumie-report-svc-build-template | fastapi-build-deploy | applications/lumie/worker/report-svc/common-values.yaml 하위 |
lumie-analysis-svc-build-template | fastapi-build-deploy | applications/lumie/worker/analysis-svc/helm-values.yaml |
lumie-chatbot-svc-build-template | fastapi-build-deploy | applications/lumie/worker/chatbot-svc/common-values.yaml 하위 |
lumie-temp-omr-grading-build-template | fastapi-build-deploy | applications/lumie/worker/temp-omr-grading/helm-values.yaml |
두 개의 trigger 정의는 존재하지만 범위가 매우 좁습니다.
github-push-nextjs는 현재body.repository.name in []로 필터링하므로 검사한 소스에서는 어떤 저장소도 매칭되지 않습니다.github-push-fastapi는 현재body.repository.name in ['joossam']만 필터링합니다.
시크릿 및 자격 증명 흐름
| Secret | 소스 경로 | 목적 |
|---|---|---|
gitea-credentials | manifests/secrets/gitea-credentials.yaml | 저장소 clone과 values 업데이트 push를 위한 HTTP basic auth |
github-webhook-secret | manifests/secrets/github-credentials.yaml | Vault 경로 tokens에서 저장되는 webhook secret |
zot-registry-credentials | manifests/secrets/zot-registry-credentials.yaml | zot.lumie-infra.com으로 Kaniko push를 위한 Docker config |
세 리소스 모두 공유 vault/vault-auth identity를 통해 해석되는 VaultStaticSecret입니다.
운영 메모
resource-quota.yaml은 non-BestEffort CI pod의 전체requests.memory를16Gi로 제한합니다.cleanup/cronjob.yaml은 완료된PipelineRun과TaskRun리소스를 두 시간마다 정리합니다.PipelineRun.spec.onSuccessfulCompletion: delete는 cleanup 이전에도 성공한 실행을 짧게 유지합니다.springboot-test,nextjs-check,fastapi-check는 비차단 informational mode를 지원하지만, 기본 동작은 여전히 차단형입니다.
이 발췌는 deployment-values 핸드오프를 보여줍니다.
- name: GIT_REPO_URL
default: "http://gitea-http.gitea.svc.cluster.local:3000/Lumie-Edu/lumie-infra.git"
...
git commit -m "CHORE(app): update $(params.APP_NAME) image to $IMAGE_TAG"
계약 드리프트
검사한 소스는 GitOps 배포 상태가 어디에 있는지에 대해 서로 다릅니다.
| 소스 | 주장 |
|---|---|
| 루트 Argo CD Application과 bootstrap 기본값 | lumie-infra 소스 저장소는 GitHub |
git-update-values.yaml | lumie-infra 업데이트는 인클러스터 Gitea로 push |
bootstrap/gitea/helm-values.yaml | 주석은 여전히 lumie-infra는 GitHub에 남고 애플리케이션 소스 저장소는 Gitea에 있다고 설명 |
저장소에는 lumie-infra에 대한 GitHub와 Gitea 사이의 동기화 경로가 선언되어 있지 않습니다. CI/CD를 수정할 때 이 공백을 계속 드러내 두세요.
검증
cd lumie-infra
rg -n "github-listener|gitea-http|zot.lumie-infra.com|git-update-values|onSuccessfulCompletion" \
applications/tekton/ci-cd
kubectl get eventlistener github-listener -n tekton-pipelines -o yaml
kubectl get pipelineruns -n tekton-pipelines
kubectl get taskruns -n tekton-pipelines