feat: Setup KIND cluster for local Kubernetes development
- Created 5-node KIND cluster (1 control-plane + 4 workers) - Configured NodePort mappings for console access (30080, 30081) - Created namespace separation (site11-console, site11-pipeline) - Deployed MongoDB and Redis in KIND cluster - Deployed Console backend and frontend with NodePort services - All 4 pods running successfully and verified with browser test Infrastructure: - k8s/kind-dev-cluster.yaml: 5-node cluster configuration - k8s/kind/console-mongodb-redis.yaml: Database deployments - k8s/kind/console-backend.yaml: Backend with NodePort - k8s/kind/console-frontend.yaml: Frontend with NodePort Management Tools: - scripts/kind-setup.sh: Comprehensive cluster management script - docker-compose.kubernetes.yml: Monitoring helper services Documentation: - KUBERNETES.md: Complete usage guide for developers - docs/KIND_SETUP.md: Detailed KIND setup documentation - docs/PROGRESS.md: Updated with KIND cluster completion Console Services Access: - Frontend: http://localhost:3000 (NodePort 30080) - Backend: http://localhost:8000 (NodePort 30081) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
112
docker-compose.kubernetes.yml
Normal file
112
docker-compose.kubernetes.yml
Normal file
@ -0,0 +1,112 @@
|
||||
version: '3.8'
|
||||
|
||||
# KIND (Kubernetes IN Docker) 클러스터 관리용 docker-compose
|
||||
# 사용법:
|
||||
# 시작: docker-compose -f docker-compose.kubernetes.yml up -d
|
||||
# 중지: docker-compose -f docker-compose.kubernetes.yml down
|
||||
# 재시작: docker-compose -f docker-compose.kubernetes.yml restart
|
||||
# 로그: docker-compose -f docker-compose.kubernetes.yml logs -f
|
||||
|
||||
services:
|
||||
# KIND 클러스터 관리 헬퍼 서비스
|
||||
# KIND 클러스터는 docker-compose로 직접 제어할 수 없으므로
|
||||
# 이 헬퍼 서비스를 통해 관리 작업을 수행합니다
|
||||
kind-manager:
|
||||
image: docker/compose:latest
|
||||
container_name: site11-kind-manager
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./k8s:/k8s:ro
|
||||
- ./scripts:/scripts:ro
|
||||
networks:
|
||||
- kind
|
||||
entrypoint: /bin/sh
|
||||
command: |
|
||||
-c "
|
||||
echo '====================================';
|
||||
echo 'Site11 KIND Cluster Manager';
|
||||
echo '====================================';
|
||||
echo '';
|
||||
echo 'KIND 클러스터 관리 명령어:';
|
||||
echo ' 클러스터 생성: kind create cluster --config /k8s/kind-dev-cluster.yaml';
|
||||
echo ' 클러스터 삭제: kind delete cluster --name site11-dev';
|
||||
echo ' 클러스터 상태: kubectl cluster-info --context kind-site11-dev';
|
||||
echo ' 노드 확인: kubectl get nodes';
|
||||
echo '';
|
||||
echo 'Services 배포:';
|
||||
echo ' 네임스페이스: kubectl create namespace site11-console';
|
||||
echo ' Console: kubectl apply -f /k8s/kind/';
|
||||
echo '';
|
||||
echo '헬퍼 컨테이너는 계속 실행됩니다...';
|
||||
tail -f /dev/null
|
||||
"
|
||||
restart: unless-stopped
|
||||
|
||||
# Kubectl 명령어 실행을 위한 헬퍼 서비스
|
||||
kubectl:
|
||||
image: bitnami/kubectl:latest
|
||||
container_name: site11-kubectl
|
||||
volumes:
|
||||
- ~/.kube:/root/.kube:ro
|
||||
- ./k8s:/k8s:ro
|
||||
networks:
|
||||
- kind
|
||||
entrypoint: /bin/bash
|
||||
command: |
|
||||
-c "
|
||||
echo '====================================';
|
||||
echo 'Kubectl Helper Container';
|
||||
echo '====================================';
|
||||
echo '';
|
||||
echo 'kubectl 명령어 사용 가능';
|
||||
echo ' 예시: docker exec site11-kubectl kubectl get pods -A';
|
||||
echo '';
|
||||
tail -f /dev/null
|
||||
"
|
||||
restart: unless-stopped
|
||||
|
||||
# KIND 클러스터 헬스체크 및 모니터링
|
||||
kind-monitor:
|
||||
image: bitnami/kubectl:latest
|
||||
container_name: site11-kind-monitor
|
||||
volumes:
|
||||
- ~/.kube:/root/.kube:ro
|
||||
networks:
|
||||
- kind
|
||||
entrypoint: /bin/bash
|
||||
command: |
|
||||
-c "
|
||||
while true; do
|
||||
echo '==== KIND Cluster Status ====';
|
||||
kubectl get nodes --context kind-site11-dev 2>/dev/null || echo 'Cluster not running';
|
||||
echo '';
|
||||
echo '==== Console Namespace Pods ====';
|
||||
kubectl get pods -n site11-console --context kind-site11-dev 2>/dev/null || echo 'Namespace not found';
|
||||
echo '';
|
||||
echo '==== Pipeline Namespace Pods ====';
|
||||
kubectl get pods -n site11-pipeline --context kind-site11-dev 2>/dev/null || echo 'Namespace not found';
|
||||
echo '';
|
||||
sleep 30;
|
||||
done
|
||||
"
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
kind:
|
||||
name: kind
|
||||
driver: bridge
|
||||
|
||||
# 참고:
|
||||
# 1. KIND 클러스터 자체는 docker-compose로 직접 제어되지 않습니다
|
||||
# 2. 이 파일은 KIND 클러스터 관리를 위한 헬퍼 컨테이너들을 제공합니다
|
||||
# 3. 실제 클러스터 생성/삭제는 kind CLI를 사용해야 합니다
|
||||
#
|
||||
# KIND 클러스터 라이프사이클:
|
||||
# 생성: kind create cluster --config k8s/kind-dev-cluster.yaml
|
||||
# 삭제: kind delete cluster --name site11-dev
|
||||
# 목록: kind get clusters
|
||||
#
|
||||
# docker-compose 명령어:
|
||||
# 헬퍼 시작: docker-compose -f docker-compose.kubernetes.yml up -d
|
||||
# 헬퍼 중지: docker-compose -f docker-compose.kubernetes.yml down
|
||||
# 로그 확인: docker-compose -f docker-compose.kubernetes.yml logs -f kind-monitor
|
||||
Reference in New Issue
Block a user