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