Files
infra-k8/deploy/k8s/10-ml.yaml
Noel Sabia b98a1bab42
infra-ci / manifests (push) Failing after 4s
infra-ci / manifests (pull_request) Failing after 3s
feat: prepare v1.1 deploy and presenter load test
- build and push v1.1 images from the service main worktrees
- switch manifests to :v1.1; add web control Secret refs
- configure API BOOTSTRAP_REFRESH=60s and remove unused DATA_DIR
- add k6 presenter scenario with a mid-run control POST
- require control credentials in make load; update runbook and drills
2026-11-14 08:00:58 +01:00

121 lines
3.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: ml
namespace: fch26-onemanarmy
labels:
app.kubernetes.io/name: ml
app.kubernetes.io/component: ml
app.kubernetes.io/part-of: pulsecast
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: ml
template:
metadata:
labels:
app.kubernetes.io/name: ml
app.kubernetes.io/component: ml
app.kubernetes.io/part-of: pulsecast
spec:
automountServiceAccountToken: false
imagePullSecrets:
- name: gitea-regcred
securityContext:
seccompProfile:
type: RuntimeDefault
# Numeric UID is required: a non-numeric image user breaks runAsNonRoot
# (verified on SKE with curlimages/curl, 2026-11-14).
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001
containers:
- name: ml
image: git.noelsabia.dev/noel/pulsecast-ml:v1.1
# v1.1 may be re-pushed during the demo run-up; Always makes a re-push visible.
# Switch back to IfNotPresent once the tag is frozen.
imagePullPolicy: Always
ports:
- name: http
containerPort: 8000
protocol: TCP
envFrom:
- configMapRef:
name: ml-config
- configMapRef:
name: pulsecast-shared
env:
- name: HOME
value: /tmp
- name: MPLCONFIGDIR
value: /tmp
# Required by FastAPI /train; returns 503 when it is unset.
- name: CONTROL_TOKEN
valueFrom:
secretKeyRef:
name: control-auth
key: CONTROL_TOKEN
resources:
requests:
cpu: 200m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: tmp
mountPath: /tmp
startupProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 2
failureThreshold: 60
livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 3
readinessProbe:
httpGet:
path: /readyz
port: http
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 2
terminationGracePeriodSeconds: 30
volumes:
- name: tmp
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: ml
namespace: fch26-onemanarmy
labels:
app.kubernetes.io/name: ml
app.kubernetes.io/part-of: pulsecast
spec:
type: ClusterIP
selector:
app.kubernetes.io/name: ml
ports:
- name: http
port: 8000
targetPort: http
protocol: TCP