Skip to content

feat: add Helm charts for api and db#3

Merged
hjklo0220 merged 8 commits intomainfrom
feat/helm-chart
Apr 12, 2026
Merged

feat: add Helm charts for api and db#3
hjklo0220 merged 8 commits intomainfrom
feat/helm-chart

Conversation

@hjklo0220
Copy link
Copy Markdown
Collaborator

@hjklo0220 hjklo0220 commented Apr 12, 2026

Summary

  • infra/helm/api/ — api Deployment, Service, Ingress, migrate Job (pre-install hook) Helm Chart
  • infra/helm/db/ — PostgreSQL StatefulSet, Service 독립 Helm Chart
  • db를 api Chart에서 분리 (pre-install deadlock 해결 + 독립 인프라)
  • /api/version 엔드포인트 추가
  • docs/k8s.md, docs/minikube.md, docs/helm.md 학습 기록

주요 설계 결정

  • db Chart 분리: detector, dashboard 등 다른 앱도 같은 DB 사용 예정 → db는 독립 인프라
  • migrate Job을 Helm pre-install hook으로 처리: helm upgrade 시 자동 마이그레이션
  • fullnameOverride: "db" 로 Service 이름 고정 → api가 항상 @db:5432로 접근 가능
  • imagePullPolicy: Never + 버전 태그로 로컬 minikube 이미지 관리

Test plan

  • helm install db infra/helm/db 후 db-0 Running 확인
  • helm install api infra/helm/api -f values-local.yaml 후 api × 3, migrate Completed 확인
  • minikube tunnelcurl http://127.0.0.1/health, /ready, /api/items 확인
  • helm upgrade 버전 변경 후 롤링 업데이트 확인
  • helm rollback 이전 버전 복구 확인

🤖 Generated with Claude Code

hjklo0220 and others added 8 commits April 11, 2026 16:39
- Chart.yaml: name=api, appVersion=0.0.1
- _helpers.tpl: name/fullname/labels/selectorLabels helpers
- NOTES.txt: install instructions for devopsim api
- .helmignore: standard ignore patterns

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- deployment.yaml: api Deployment template with values variables
- values.yaml: replicaCount, image, db, waitForDb, resources
- waitForDb.enabled flag for local/production separation
- NOTES.txt: simplified install instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- service.yaml: ClusterIP, port 80 → targetPort 3000
- ingress.yaml: nginx, host optional, ingress.enabled flag
- values.yaml: add service, ingress sections
- docs/helm.md: add Service/Ingress notes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- deployment.yaml, service.yaml, ingress.yaml templates
- db-statefulset.yaml, db-service.yaml templates (db.enabled flag)
- migrate-job.yaml with post-install,post-upgrade hook
- values.yaml: replicaCount, image, service, ingress, db, waitForDb
- values-local.yaml: replicas=3, pullPolicy=Never, ingress enabled
- docs/helm.md: Service/Ingress, migration strategy, Secret management
- Fix: pre-install → post-install hook (deadlock when db in same chart)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove db-statefulset.yaml, db-service.yaml from api chart
- Add infra/helm/db/ chart (StatefulSet + Service + helpers)
- fullnameOverride: "db" to fix Service name regardless of release name
- migrate-job: pre-install hook (db chart deployed separately first)
- api values.yaml: remove db image/storage config, keep host/port only

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- README: add Helm deployment section
- helm.md: remove Service/Ingress section (moved to k8s.md)
- k8s.md: K8s concepts (Service, Ingress, StatefulSet, CoreDNS, kube-proxy)
- minikube.md: minikube setup troubleshooting

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@hjklo0220 hjklo0220 merged commit 3bd4d7a into main Apr 12, 2026
1 of 2 checks passed
@hjklo0220 hjklo0220 deleted the feat/helm-chart branch April 18, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant