KIND 클러스터 내부의 MongoDB/Redis를 제거하고 외부(docker-compose) MongoDB/Redis를 사용하도록 변경했습니다. Changes: - docker-compose.kubernetes.yml: MongoDB/Redis 정의 제거 - 기존 docker-compose.yml의 MongoDB/Redis 재사용 - Kind 네트워크를 통해 직접 연결 - k8s/kind/console-backend.yaml: 데이터베이스 연결 설정 변경 - MONGODB_URL: mongodb://site11-mongodb:27017 - REDIS_URL: redis://site11-redis:6379 - Kind 네트워크 내에서 컨테이너 이름으로 직접 접근 - Deleted from cluster: - mongodb deployment and service - redis deployment and service Benefits: - 데이터 영속성: 클러스터 재생성 시에도 데이터 유지 - 중앙 관리: docker-compose.yml에서 통합 관리 - 리소스 절약: 중복 데이터베이스 인스턴스 제거 - 네트워크 공유: Kind 네트워크를 통한 효율적 통신 Architecture: - MongoDB: site11-mongodb (port 27017) - Redis: site11-redis (port 6379) - Network: kind (shared network) - Console Backend → site11-mongodb/redis via container names Verified: - All 2 pods running (console-backend, console-frontend) - Frontend accessible at http://localhost:3000 - MongoDB/Redis connection working properly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
1.8 KiB
YAML
80 lines
1.8 KiB
YAML
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://site11-mongodb:27017"
|
|
- name: DB_NAME
|
|
value: "console_db"
|
|
- name: REDIS_URL
|
|
value: "redis://site11-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
|