Skip to content

[Feature] Helm기반 github action 배포 파이프라인 구축 #2

Merged
0gonge merged 17 commits intomainfrom
feat/#1
Jun 28, 2025
Merged

[Feature] Helm기반 github action 배포 파이프라인 구축 #2
0gonge merged 17 commits intomainfrom
feat/#1

Conversation

@0gonge
Copy link
Contributor

@0gonge 0gonge commented Jun 28, 2025

Python Flask 기반 데모 서버와 Kubernetes 배포를 위한 Helm 차트, GitHub Actions CI/CD 파이프라인을 구현했습니다.

✨ Description

Python Flask Server (app.py)

  • / - 메인 API 엔드포인트 (프로젝트 정보 반환)
  • /test - 헬스체크용 엔드포인트
  • 환경변수 지원 (ENVIRONMENT, PORT)

Docker Setup

보안 강화 (non-root user)
Python 3.11-slim 기반 (이미지 빌드 시간을 단축시키고자 slim으로 적용했습니다!)

Helm Chart (python-demo-chart/)

Kubernetes Deployment, Service 설정
환경별 설정 -> values.yaml
리소스 제한을 걸어두었는데 Helm에서는 사용자가 환경에 맞게 설정하도록 비워두는 것을 권장해 사용자가 환경에 맞게 설정해서 사용할 수도 있지만, 무제한 리소스라는 클러스터 전체에 위험이 있다고 판단해서 적용시켜두었습니다! 이 부분이 현업에서도 이렇게 적용을 하는지 궁금합니다! 이렇게 제한을 걸어두면 모든 환경에 적합하지는 않을 수 있지만, 성능을 예측할 수 있기 때문에 어느정도 예측이 가능할거라고 생각합니다!

GitHub Actions (.github/workflows/deploy.yml)

자동 Docker 이미지 빌드 & 푸시 (GitHub Container Registry)
main 브랜치 머지 시 자동 Helm 배포

Test방법

  • 로컬 docker 테스트
    docker build -t python-demo .
    docker run -p 8080:8080 python-demo

  • Helm 차트 검증
    helm lint python-demo-chart
    helm template python-demo-app ./python-demo-chart

배포 후에 확인해야하는 것

kubectl get pods -n python-demo
kubectl get services -n python-demo

minikube service python-demo-app-python-demo-chart -n python-demo --url

아직 많이 배우는 중이라 부족한 부분이 있을 수 있습니다.
코드 리뷰 주시면 감사히 배우겠습니다!

@0gonge 0gonge requested review from doyoom, tae2089 and wosyh18 June 28, 2025 05:15
@0gonge 0gonge self-assigned this Jun 28, 2025
@0gonge 0gonge removed request for doyoom, tae2089 and wosyh18 June 28, 2025 05:29
@0gonge 0gonge requested review from doyoom, tae2089 and wosyh18 June 28, 2025 05:36
@0gonge 0gonge merged commit 26e9e56 into main Jun 28, 2025
2 checks passed
@0gonge 0gonge changed the title [Feature] helm기반 github action 배포 파이프라인 구축 [Feature] Helm기반 github action 배포 파이프라인 구축 Jun 28, 2025
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