Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python Flask 기반 데모 서버와 Kubernetes 배포를 위한 Helm 차트, GitHub Actions CI/CD 파이프라인을 구현했습니다.
✨ Description
Python Flask Server (app.py)
/- 메인 API 엔드포인트 (프로젝트 정보 반환)/test- 헬스체크용 엔드포인트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-demoHelm 차트 검증
helm lint python-demo-charthelm template python-demo-app ./python-demo-chart배포 후에 확인해야하는 것
아직 많이 배우는 중이라 부족한 부분이 있을 수 있습니다.
코드 리뷰 주시면 감사히 배우겠습니다!