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:
71
k8s/kind-dev-cluster.yaml
Normal file
71
k8s/kind-dev-cluster.yaml
Normal file
@ -0,0 +1,71 @@
|
||||
kind: Cluster
|
||||
apiVersion: kind.x-k8s.io/v1alpha4
|
||||
name: site11-dev
|
||||
|
||||
# 노드 구성 (1 Control Plane + 4 Workers = 5 Nodes)
|
||||
nodes:
|
||||
# Control Plane (마스터 노드)
|
||||
- role: control-plane
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: InitConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "node-type=control-plane"
|
||||
extraPortMappings:
|
||||
# Console Frontend
|
||||
- containerPort: 30080
|
||||
hostPort: 3000
|
||||
protocol: TCP
|
||||
# Console Backend
|
||||
- containerPort: 30081
|
||||
hostPort: 8000
|
||||
protocol: TCP
|
||||
|
||||
# Worker Node 1 (Console 서비스용)
|
||||
- role: worker
|
||||
labels:
|
||||
workload: console
|
||||
node-type: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "workload=console"
|
||||
|
||||
# Worker Node 2 (Pipeline 서비스용 - 수집)
|
||||
- role: worker
|
||||
labels:
|
||||
workload: pipeline-collector
|
||||
node-type: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "workload=pipeline-collector"
|
||||
|
||||
# Worker Node 3 (Pipeline 서비스용 - 처리)
|
||||
- role: worker
|
||||
labels:
|
||||
workload: pipeline-processor
|
||||
node-type: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "workload=pipeline-processor"
|
||||
|
||||
# Worker Node 4 (Pipeline 서비스용 - 생성)
|
||||
- role: worker
|
||||
labels:
|
||||
workload: pipeline-generator
|
||||
node-type: worker
|
||||
kubeadmConfigPatches:
|
||||
- |
|
||||
kind: JoinConfiguration
|
||||
nodeRegistration:
|
||||
kubeletExtraArgs:
|
||||
node-labels: "workload=pipeline-generator"
|
||||
79
k8s/kind/console-backend.yaml
Normal file
79
k8s/kind/console-backend.yaml
Normal file
@ -0,0 +1,79 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: console-backend
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: console-backend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: console-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: console-backend
|
||||
spec:
|
||||
nodeSelector:
|
||||
workload: console
|
||||
containers:
|
||||
- name: console-backend
|
||||
image: yakenator/site11-console-backend:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: ENV
|
||||
value: "development"
|
||||
- name: DEBUG
|
||||
value: "true"
|
||||
- name: MONGODB_URL
|
||||
value: "mongodb://mongodb:27017"
|
||||
- name: DB_NAME
|
||||
value: "console_db"
|
||||
- name: REDIS_URL
|
||||
value: "redis://redis:6379"
|
||||
- name: JWT_SECRET_KEY
|
||||
value: "dev-secret-key-please-change-in-production"
|
||||
- name: JWT_ALGORITHM
|
||||
value: "HS256"
|
||||
- name: ACCESS_TOKEN_EXPIRE_MINUTES
|
||||
value: "30"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: console-backend
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: console-backend
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: console-backend
|
||||
ports:
|
||||
- port: 8000
|
||||
targetPort: 8000
|
||||
nodePort: 30081
|
||||
protocol: TCP
|
||||
65
k8s/kind/console-frontend.yaml
Normal file
65
k8s/kind/console-frontend.yaml
Normal file
@ -0,0 +1,65 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: console-frontend
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: console-frontend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: console-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: console-frontend
|
||||
spec:
|
||||
nodeSelector:
|
||||
workload: console
|
||||
containers:
|
||||
- name: console-frontend
|
||||
image: yakenator/site11-console-frontend:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: VITE_API_URL
|
||||
value: "http://localhost:8000"
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "200m"
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 10
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: console-frontend
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: console-frontend
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: console-frontend
|
||||
ports:
|
||||
- port: 3000
|
||||
targetPort: 80
|
||||
nodePort: 30080
|
||||
protocol: TCP
|
||||
108
k8s/kind/console-mongodb-redis.yaml
Normal file
108
k8s/kind/console-mongodb-redis.yaml
Normal file
@ -0,0 +1,108 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongodb
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongodb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:7.0
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: MONGO_INITDB_DATABASE
|
||||
value: "console_db"
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "500m"
|
||||
volumeMounts:
|
||||
- name: mongodb-data
|
||||
mountPath: /data/db
|
||||
volumes:
|
||||
- name: mongodb-data
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongodb
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: mongodb
|
||||
ports:
|
||||
- port: 27017
|
||||
targetPort: 27017
|
||||
protocol: TCP
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
protocol: TCP
|
||||
resources:
|
||||
requests:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "256Mi"
|
||||
cpu: "200m"
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: redis-data
|
||||
emptyDir: {}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: site11-console
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user