Tekton
Tekton은 Lumie 플랫폼의 클라우드 네이티브 CI/CD 시스템입니다. Kubernetes 네이티브 파이프라인을 통해 컨테이너 이미지 빌드와 배포를 자동화합니다.
파이프라인 상세: 실제 파이프라인 목록, EventListener 트리거 구성, 이미지 태그 전략은 CI/CD 파이프라인 문서를 참조하세요.
아키텍처
Tekton 컴포넌트 구성
Tekton은 4개의 독립적인 ArgoCD Application으로 관리됩니다:
| ArgoCD Application | 경로 | 역할 |
|---|---|---|
tekton-pipeline | applications/tekton/pipeline | 파이프라인 엔진 (Controller, Webhook) |
tekton-triggers | applications/tekton/triggers | 트리거 엔진 (EventListener, Interceptors) |
tekton-dashboard | applications/tekton/dashboard | 웹 UI |
tekton-ci-cd | applications/tekton/ci-cd | 파이프라인 정의, 태스크, 트리거 설정 |
1. Tekton Pipeline
핵심 파이프라인 엔진. K8s 리소스(Pipeline, PipelineRun, Task, TaskRun)를 처리합니다:
# applications/tekton/pipeline/kustomization.yaml
resources:
- https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
2. Tekton Triggers
Gitea 웹훅 수신 및 파이프라인 자동 실행을 담당합니다:
# applications/tekton/triggers/kustomization.yaml
resources:
- https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
- https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml
3. Tekton Dashboard
웹 UI. Teleport App Access를 통해 tekton.lumie-infra.com에서 접근합니다:
# applications/tekton/dashboard/kustomization.yaml
resources:
- https://infra.tekton.dev/tekton-releases/dashboard/latest/release-full.yaml
4. tekton-ci-cd (파이프라인 설정)
실제 파이프라인, 태스크, 트리거 리소스가 정의되는 ArgoCD Application입니다. applications/tekton/ci-cd/ 하위 구조:
applications/tekton/ci-cd/
├── argocd.yaml
└── manifests/
├── pipelines/
│ ├── lumie-springboot-build-deploy.yaml # 백엔드 모노리스
│ ├── nextjs-build-deploy.yaml # 프론트엔드/문서
│ └── fastapi-build-deploy.yaml # AI 서비스
├── tasks/
│ ├── kaniko-clone-build-github.yaml # 이미지 빌드
│ └── git-update-values.yaml # values 업데이트
├── triggers/
│ ├── eventlistener.yaml # github-listener (단일 EL)
│ ├── triggertemplate.yaml # 서비스별 TriggerTemplate
│ └── triggerbinding.yaml
├── rbac/
├── resource-quota.yaml
└── secrets/
파이프라인 목록
현재 정의된 파이프라인 3종:
| 파이프라인 | 대상 | 빌드 타임아웃 |
|---|---|---|
lumie-springboot-build-deploy | lumie-backend 모노리스 (Spring Boot) | 45분 |
nextjs-build-deploy | lumie-frontend, lumie-document (Next.js) | 30분 |
fastapi-build-deploy | Worker 서비스 (grading, report, analysis, chatbot 등) | 30분 |
이전에는 백엔드 마이크로서비스 10개 각각에 별도 파이프라인/트리거가 있었습니다. 모노리스 전환으로 백엔드 파이프라인이
lumie-springboot-build-deploy1개로 통합되었습니다.
CI 게이팅 — informational 파라미터
lumie-springboot-build-deploy 파이프라인은 informational 파라미터를 springboot-ci 태스크로 전달합니다. 이 값이 "true"이면 Gradle 테스트 실패가 경고 로그로만 기록되고 빌드 단계(kaniko)는 계속 진행됩니다. "false"(기본값)이면 테스트 실패 시 PipelineRun 전체가 중단됩니다.
# lumie-pipeline.yaml (lumie-springboot-build-deploy)
- name: informational
description: If "true", test failure does not block build
type: string
default: "false"
TriggerTemplate에서 informational 값을 PipelineRun 파라미터로 주입합니다. 트리거 자체가 CI를 차단하는 것이 아니라 파이프라인 파라미터로 게이팅이 제어됩니다.
EventListener 트리거 목록
단일 github-listener EventListener가 모든 Gitea 레포 웹훅을 수신합니다. 모든 트리거는 header.match('X-Gitea-Event', 'push') && body.ref.startsWith('refs/heads/main') CEL 필터로 main 브랜치 푸시만 처리합니다:
| 트리거 이름 | 레포 필터 | TriggerTemplate |
|---|---|---|
github-push-nextjs | body.repository.name in [] (현재 미사용) | nextjs-build-template |
github-push-lumie-document | lumie-document | lumie-document-build-template |
github-push-fastapi | joossam (AI 레포) | fastapi-build-template |
github-push-lumie-frontend | lumie-frontend | lumie-frontend-build-template |
github-push-lumie-backend | lumie-backend | lumie-backend-build-template |
github-push-lumie-grading-svc | lumie-worker + services/grading/ 경로 | lumie-grading-svc-build-template |
github-push-lumie-report-svc | lumie-worker + services/report/ 경로 | lumie-report-svc-build-template |
github-push-lumie-temp-omr-grading | lumie-worker + services/temp-omr-grading/ 경로 | lumie-temp-omr-grading-build-template |
github-push-lumie-analysis-svc | lumie-worker + services/analysis/ 경로 | lumie-analysis-svc-build-template |
github-push-lumie-chatbot-svc | lumie-worker + services/chatbot/ 경로 | lumie-chatbot-svc-build-template |
리소스 쿼터 및 보안
리소스 할당량
동시 빌드로 인한 클러스터 자원 고갈을 방지합니다:
apiVersion: v1
kind: ResourceQuota
metadata:
name: build-concurrency-limit
namespace: tekton-pipelines
spec:
hard:
requests.memory: 6Gi
scopeSelector:
matchExpressions:
- scopeName: NotBestEffort
operator: Exists
Pod Security Standard
Kaniko 빌드 요구사항으로 tekton-pipelines 네임스페이스는 privileged PSS를 사용합니다:
# kustomization.yaml patch
- target:
version: v1
kind: Namespace
name: tekton-pipelines
patch: |-
- op: replace
path: /metadata/labels/pod-security.kubernetes.io~1enforce
value: privileged
CI 파드 CPU 스케줄링
K8s는 파드 내 모든 컨테이너 스텝의 CPU requests 합산을 노드 예약에 사용합니다. springboot-ci 태스크는 2-코어 노드에서 합산 요청이 빈 메모리에 맞도록 각 스텝의 CPU 요청을 의도적으로 낮게 설정합니다 — 실제 CPU는 burst-up됩니다. 태스크 주석에 "Reservation only; ... bursts to available CPU" 라는 설명이 명시되어 있습니다.
시크릿 관리
모든 시크릿은 Vault에서 관리되며 VaultStaticSecret으로 동기화됩니다:
| 시크릿 | Vault 경로 | 용도 |
|---|---|---|
gitea-credentials | infrastructure/gitea 또는 tokens | Git clone (Gitea private repo) |
github-webhook-secret | tokens | HMAC 서명 검증 (웹훅) |
zot-registry-credentials | infrastructure/zot | Kaniko → Zot 이미지 푸시 |
운영 명령어
# 실행 중인 PipelineRun 확인
kubectl get pipelinerun -n tekton-pipelines
# 특정 PipelineRun 로그 확인
kubectl logs -n tekton-pipelines -l tekton.dev/pipelineRun=<run-name> -c step-build-and-push
# 실패한 PipelineRun 상세
kubectl describe pipelinerun -n tekton-pipelines <run-name>
# EventListener 상태 확인
kubectl get eventlistener -n tekton-pipelines
kubectl logs -n tekton-pipelines -l eventlistener=github-listener
# 리소스 사용량 확인
kubectl top pods -n tekton-pipelines
kubectl describe resourcequota -n tekton-pipelines
# Tekton Dashboard 접근
# https://tekton.lumie-infra.com (Teleport App Access)