apiVersion: apps/v1 kind: Deployment metadata: name: guildhall namespace: guildhall labels: app.kubernetes.io/name: guildhall app.kubernetes.io/part-of: guildhouse app.kubernetes.io/component: web app.kubernetes.io/managed-by: manual app.kubernetes.io/version: v0.1.0 spec: replicas: 1 strategy: type: RollingUpdate rollingUpdate: maxSurge: 1 maxUnavailable: 0 selector: matchLabels: app: guildhall template: metadata: labels: app: guildhall app.kubernetes.io/name: guildhall app.kubernetes.io/part-of: guildhouse app.kubernetes.io/component: web app.kubernetes.io/version: v0.1.0 spec: imagePullSecrets: - name: guildhall-registry containers: - name: guildhall image: git.guildhouse.dev/tking/guildhall:v0.1.0 imagePullPolicy: IfNotPresent ports: - containerPort: 4000 name: http protocol: TCP env: # Phoenix / endpoint - name: PHX_SERVER value: "true" - name: PHX_HOST value: guildhall.guildhouse.dev - name: PORT value: "4000" - name: POOL_SIZE value: "10" # Session signing key - name: SECRET_KEY_BASE valueFrom: secretKeyRef: name: guildhall-app-secrets key: SECRET_KEY_BASE # Ecto - name: DATABASE_URL valueFrom: secretKeyRef: name: guildhall-app-secrets key: DATABASE_URL # Starting envelope. Tune after observing real usage under # LiveView fan-out; Phoenix's memory footprint grows with # connected clients. resources: requests: cpu: 200m memory: 256Mi limits: cpu: "1" memory: 1Gi # Probes hit /health, which queries the Ecto pool. See # apps/guildhall_web/lib/guildhall_web_web/controllers/health_controller.ex # for semantics. readinessProbe: httpGet: path: /health port: http initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3 livenessProbe: httpGet: path: /health port: http initialDelaySeconds: 60 periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 # Graceful shutdown allowance. Phoenix endpoint shuts down # cleanly inside this window. lifecycle: preStop: exec: command: ["/bin/sh", "-c", "sleep 5"] terminationGracePeriodSeconds: 30