feat: Add k8s deployment manifests for staging environment (Phase 10-07, Task 2)
- PostgreSQL StatefulSet with ConfigMap, Secret, and Service - Backend Deployment with health checks and resource limits - Frontend Deployment with health checks and resource limits - Ingress configuration for traefik/nginx ingress controllers - Comprehensive deployment report documenting staging setup - All services running and healthy with 0 restarts - Database schema migration pending Staging cluster status: - gravl-backend: 1/1 Running ✅ - gravl-frontend: 1/1 Running ✅ - gravl-db: 1/1 Running ✅ - Ingress: traefik configured and responding ✅
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: gravl-backend
|
||||
namespace: gravl-staging
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: gravl-backend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: gravl-backend
|
||||
spec:
|
||||
containers:
|
||||
- name: gravl-backend
|
||||
image: gravl-gravl-backend:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 3001
|
||||
env:
|
||||
- name: NODE_ENV
|
||||
value: "production"
|
||||
- name: DB_HOST
|
||||
value: "postgres.gravl-prod.svc.cluster.local"
|
||||
- name: DB_PORT
|
||||
value: "5432"
|
||||
- name: DB_NAME
|
||||
value: "gravl"
|
||||
- name: DB_USER
|
||||
value: "gravl_user"
|
||||
- name: DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: POSTGRES_PASSWORD
|
||||
- name: LOG_LEVEL
|
||||
value: "info"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 3001
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 3001
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "500m"
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: app
|
||||
operator: In
|
||||
values:
|
||||
- gravl-backend
|
||||
topologyKey: kubernetes.io/hostname
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: gravl-backend
|
||||
namespace: gravl-staging
|
||||
labels:
|
||||
app: gravl-backend
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: gravl-backend
|
||||
ports:
|
||||
- name: http
|
||||
port: 3001
|
||||
targetPort: 3001
|
||||
protocol: TCP
|
||||
Reference in New Issue
Block a user