apiVersion: apps/v1 kind: Deployment metadata: name: api namespace: fch26-onemanarmy labels: app.kubernetes.io/name: api app.kubernetes.io/component: backend app.kubernetes.io/part-of: pulsecast spec: # Scenario state and the SSE hub live in memory. One replica is intentional. replicas: 1 revisionHistoryLimit: 2 strategy: type: Recreate selector: matchLabels: app.kubernetes.io/name: api template: metadata: labels: app.kubernetes.io/name: api app.kubernetes.io/component: backend app.kubernetes.io/part-of: pulsecast spec: automountServiceAccountToken: false imagePullSecrets: - name: gitea-regcred securityContext: seccompProfile: type: RuntimeDefault # distroless static:nonroot is UID/GID 65532. Keep it numeric so # runAsNonRoot never depends on the image's user name. runAsUser: 65532 runAsGroup: 65532 containers: - name: api image: git.noelsabia.dev/noelsabia/pulsecast-api:gate1 # Gate 1 reuses the `gate1` tag while iterating; Always makes a re-push visible. # Switch to an immutable tag + IfNotPresent at deploy freeze. imagePullPolicy: Always ports: - name: http containerPort: 8080 protocol: TCP envFrom: - configMapRef: name: api-config - configMapRef: name: pulsecast-shared env: - name: HOME value: /tmp # Created by the human; see docs/deploy.md. Never commit real credentials. - name: CONTROL_USER valueFrom: secretKeyRef: name: control-auth key: CONTROL_USER - name: CONTROL_PASS valueFrom: secretKeyRef: name: control-auth key: CONTROL_PASS # Forwarded as a Bearer token to FastAPI's internal /train routes. - name: CONTROL_TOKEN valueFrom: secretKeyRef: name: control-auth key: CONTROL_TOKEN resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 256Mi securityContext: runAsNonRoot: true allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: - ALL volumeMounts: - name: tmp mountPath: /tmp startupProbe: httpGet: path: /api/healthz port: http periodSeconds: 2 failureThreshold: 30 livenessProbe: httpGet: path: /api/healthz port: http periodSeconds: 10 timeoutSeconds: 3 failureThreshold: 3 readinessProbe: httpGet: path: /api/readyz port: http periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 2 # SSE clients reconnect with retry: 3000; give them a moment on shutdown. terminationGracePeriodSeconds: 20 volumes: - name: tmp emptyDir: {} --- apiVersion: v1 kind: Service metadata: name: api namespace: fch26-onemanarmy labels: app.kubernetes.io/name: api app.kubernetes.io/part-of: pulsecast spec: type: ClusterIP selector: app.kubernetes.io/name: api ports: - name: http port: 8080 targetPort: http protocol: TCP