2026-09-01 21:02:44 -03:00

100 lines
3.3 KiB
YAML

# services/hermes-scm-broker/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: hermes-scm-broker
namespace: hermes-scm
labels:
app: hermes-scm-broker
spec:
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: hermes-scm-broker
template:
metadata:
labels:
app: hermes-scm-broker
annotations:
ai.bstein.dev/config-rev: scm-boundary-v3
vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: hermes-scm-broker
vault.hashicorp.com/agent-inject-secret-gitea-token: kv/data/atlas/hermes/developer-gitea
vault.hashicorp.com/agent-inject-template-gitea-token: |
{{- with secret "kv/data/atlas/hermes/developer-gitea" -}}
{{ .Data.data.token }}
{{- end }}
vault.hashicorp.com/agent-pre-populate-only: "true"
vault.hashicorp.com/agent-init-first: "true"
vault.hashicorp.com/agent-requests-cpu: 10m
vault.hashicorp.com/agent-requests-mem: 32Mi
vault.hashicorp.com/agent-limits-cpu: 50m
vault.hashicorp.com/agent-limits-mem: 64Mi
spec:
serviceAccountName: hermes-scm-broker
automountServiceAccountToken: true
securityContext:
fsGroup: 10000
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values: [arm64]
- key: node-role.kubernetes.io/worker
operator: In
values: ["true"]
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: hardware
operator: In
values: [rpi5]
containers:
- name: broker
image: registry.bstein.dev/bstein/hermes-agent
imagePullPolicy: IfNotPresent
command:
- /opt/hermes/.venv/bin/python
- /opt/broker/scm_broker.py
ports:
- {name: http, containerPort: 9081, protocol: TCP}
readinessProbe:
httpGet: {path: /healthz, port: http}
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
httpGet: {path: /healthz, port: http}
initialDelaySeconds: 15
periodSeconds: 30
failureThreshold: 10
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10000
runAsGroup: 10000
volumeMounts:
- {name: broker-code, mountPath: /opt/broker, readOnly: true}
- {name: tmp, mountPath: /tmp}
resources:
requests: {cpu: 50m, memory: 128Mi}
limits: {cpu: "1", memory: 768Mi}
volumes:
- name: broker-code
configMap:
name: hermes-scm-boundary-v2
defaultMode: 0555
- name: tmp
emptyDir:
sizeLimit: 1Gi