titan-iac/services/veles/backend-deployment.yaml

138 lines
4.5 KiB
YAML
Raw Normal View History

2026-06-09 00:46:46 -03:00
# services/veles/backend-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: veles-backend
namespace: veles
labels:
app: veles-backend
spec:
2026-06-09 15:47:33 -03:00
replicas: 1
2026-06-09 00:46:46 -03:00
revisionHistoryLimit: 2
2026-07-11 20:07:15 -03:00
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
2026-06-09 00:46:46 -03:00
selector:
matchLabels:
app: veles-backend
template:
metadata:
labels:
app: veles-backend
2026-06-27 07:35:25 -03:00
annotations:
2026-07-13 18:48:03 -03:00
veles.bstein.dev/redeploy: "2026-07-13-0.6.74-route-suppression-hardening"
2026-06-27 07:35:25 -03:00
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/agent-init-first: "true"
2026-06-27 07:35:25 -03:00
vault.hashicorp.com/agent-pre-populate-only: "true"
vault.hashicorp.com/role: "veles"
vault.hashicorp.com/agent-inject-secret-veles-env.sh: "kv/data/atlas/veles/veles-db"
vault.hashicorp.com/agent-inject-template-veles-env.sh: |
{{- with secret "kv/data/atlas/veles/veles-db" }}
unset DATABASE_URL
export VELES_DATABASE_HOST="{{ .Data.data.POSTGRES_HOST }}"
export VELES_DATABASE_PORT="{{ .Data.data.POSTGRES_PORT }}"
export VELES_DATABASE_NAME="{{ .Data.data.POSTGRES_DB }}"
2026-06-27 07:35:25 -03:00
export VELES_DATABASE_USER="{{ .Data.data.POSTGRES_USER }}"
export VELES_DATABASE_PASSWORD="{{ .Data.data.POSTGRES_PASSWORD }}"
export VELES_DATABASE_SSLMODE="disable"
2026-06-27 07:35:25 -03:00
{{- end }}
{{- with secret "kv/data/atlas/veles/veles-oidc" }}
export VELES_OIDC_CLIENT_SECRET="{{ .Data.data.client_secret }}"
{{- end }}
{{- with secret "kv/data/atlas/veles/app-secrets" }}
export VELES_SESSION_SECRET="{{ .Data.data.VELES_SESSION_SECRET }}"
export VELES_BYOK_ENCRYPTION_KEY="{{ .Data.data.VELES_BYOK_ENCRYPTION_KEY }}"
{{- end }}
2026-06-09 00:46:46 -03:00
spec:
serviceAccountName: veles-backend
priorityClassName: veles-core
nodeSelector:
veles.bstein.dev/node-pool: oceanus
2026-06-27 07:35:25 -03:00
kubernetes.io/arch: amd64
2026-06-09 00:46:46 -03:00
tolerations:
- key: veles.bstein.dev/simulation
operator: Equal
value: "true"
effect: NoSchedule
securityContext:
2026-06-09 15:47:33 -03:00
fsGroup: 10001
fsGroupChangePolicy: OnRootMismatch
2026-06-09 00:46:46 -03:00
seccompProfile:
type: RuntimeDefault
initContainers:
2026-06-27 07:35:25 -03:00
- name: database-init
2026-07-13 18:48:03 -03:00
image: registry.bstein.dev/veles/veles-backend:0.6.74 # {"$imagepolicy": "veles:veles-backend"}
2026-06-27 19:52:35 -03:00
imagePullPolicy: Always
2026-06-27 07:35:25 -03:00
command: ["/bin/sh", "-c"]
args:
- |
set -eu
if [ -f /vault/secrets/veles-env.sh ]; then
. /vault/secrets/veles-env.sh
fi
exec veles-db --init --wait-seconds 120
envFrom:
- configMapRef:
2026-06-27 07:35:25 -03:00
name: veles-config
resources:
requests:
2026-06-27 07:35:25 -03:00
cpu: 50m
memory: 128Mi
limits:
2026-06-27 07:35:25 -03:00
cpu: 250m
memory: 512Mi
2026-06-09 00:46:46 -03:00
containers:
- name: backend
2026-07-13 18:48:03 -03:00
image: registry.bstein.dev/veles/veles-backend:0.6.74 # {"$imagepolicy": "veles:veles-backend"}
2026-06-27 19:52:35 -03:00
imagePullPolicy: Always
2026-06-27 07:35:25 -03:00
command: ["/bin/sh", "-c"]
args:
- |
set -eu
if [ -f /vault/secrets/veles-env.sh ]; then
. /vault/secrets/veles-env.sh
fi
exec veles-web --host 0.0.0.0 --port 8796 --no-resume-queued
2026-06-09 00:46:46 -03:00
ports:
- name: http
containerPort: 8796
2026-06-09 00:46:46 -03:00
protocol: TCP
2026-06-27 07:35:25 -03:00
envFrom:
- configMapRef:
name: veles-config
2026-06-09 15:47:33 -03:00
readinessProbe:
httpGet:
path: /api/v1/ready
port: http
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /api/v1/live
port: http
initialDelaySeconds: 20
periodSeconds: 20
2026-06-09 00:46:46 -03:00
resources:
requests:
2026-06-09 15:50:43 -03:00
cpu: 250m
2026-07-11 19:29:34 -03:00
memory: 1Gi
2026-06-09 00:46:46 -03:00
limits:
2026-06-09 15:50:43 -03:00
cpu: "1"
2026-07-11 19:29:34 -03:00
memory: 4Gi
2026-06-09 00:46:46 -03:00
securityContext:
runAsNonRoot: true
2026-06-09 15:47:33 -03:00
runAsUser: 10001
runAsGroup: 10001
2026-06-09 00:46:46 -03:00
allowPrivilegeEscalation: false
capabilities:
drop: ["ALL"]
volumeMounts:
- name: artifacts
mountPath: /data/veles-artifacts
volumes:
- name: artifacts
persistentVolumeClaim:
claimName: veles-artifacts