콘텐츠로 이동

GitOps

Tenax에 필요한 모든 것은 선언적이므로 Flux나 Argo CD 저장소에 잘 맞습니다. 차트는 한곳에, 스토어와 정책은 다른 곳에, 그리고 각 BackupTarget은 보호하는 데이터베이스 옆에 둡니다.

infrastructure/tenax/
  controllers/      # HelmRelease tenax (CRDs, controller, API, alerts, dashboard, policy presets)
  config/
    store.yaml      # BackupStore: bucket, region, age recipients
    secrets/        # SOPS-encrypted: S3 credentials, age identities, database users
apps/team-a/
  app-database.yaml
  app-backup.yaml   # BackupTarget, labelled org/project/env
Flux HelmRelease (excerpt)
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata: { name: tenax, namespace: tenax-system }
spec:
  interval: 10m
  chart:
    spec:
      chart: tenax
      version: "1.2.3"
      sourceRef: { kind: HelmRepository, name: my-charts, namespace: flux-system }
  install: { crds: CreateReplace }
  upgrade: { crds: CreateReplace }
  values:
    image: { repository: registry.example.com/tenax/tenax, tag: v1.2.3 }
    targetNamespaces: [team-a]
    examplePolicies: { enabled: true, store: main }
    metrics:
      serviceMonitor: { enabled: true }
      prometheusRule: { enabled: true }
      grafanaDashboard: { enabled: true }

팁:

  • 평문이나 플레이스홀더가 절대 커밋되지 않도록 kubectl create secret … --dry-run=client -o yaml | sops --encrypt로 Secret을 생성하세요. age 개인 키는 절대 커밋하지 말고, 백업 키의 오프라인 사본을 보관하세요.
  • Tenax는 애플리케이션이 의존하는 체인 밖의 별도 Flux Kustomization에 두어, Tenax의 문제가 배포를 막지 않도록 하세요.
  • 복원은 일회성 작업이므로 보통 git이 아니라 콘솔이나 CLI에서 생성합니다. git에 선언해도 동작합니다.