2026-01-08 01:55:58 -03:00
|
|
|
# services/comms/mas-deployment.yaml
|
2025-12-31 15:37:54 -03:00
|
|
|
apiVersion: apps/v1
|
|
|
|
|
kind: Deployment
|
|
|
|
|
metadata:
|
|
|
|
|
name: matrix-authentication-service
|
|
|
|
|
labels:
|
|
|
|
|
app: matrix-authentication-service
|
|
|
|
|
spec:
|
2025-12-31 18:29:25 -03:00
|
|
|
replicas: 1
|
2025-12-31 15:37:54 -03:00
|
|
|
selector:
|
|
|
|
|
matchLabels:
|
|
|
|
|
app: matrix-authentication-service
|
|
|
|
|
template:
|
|
|
|
|
metadata:
|
2025-12-31 15:59:46 -03:00
|
|
|
annotations:
|
2026-01-17 02:24:50 -03:00
|
|
|
checksum/config: v5-adminapi-8
|
2026-01-14 14:17:26 -03:00
|
|
|
vault.hashicorp.com/agent-inject: "true"
|
|
|
|
|
vault.hashicorp.com/agent-init-first: "true"
|
|
|
|
|
vault.hashicorp.com/role: "comms"
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-turn-secret: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/turn-shared-secret" -}}{{ .Data.data.TURN_STATIC_AUTH_SECRET }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-livekit-primary: "kv/data/atlas/comms/livekit-api"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-livekit-primary: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/livekit-api" -}}{{ .Data.data.primary }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-bot-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-bot-pass: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "bot-password" }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-seeder-pass: "kv/data/atlas/comms/atlasbot-credentials-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-seeder-pass: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/atlasbot-credentials-runtime" -}}{{ index .Data.data "seeder-password" }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-chat-matrix: "kv/data/atlas/shared/chat-ai-keys-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-chat-matrix: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/shared/chat-ai-keys-runtime" -}}{{ .Data.data.matrix }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-chat-homepage: "kv/data/atlas/shared/chat-ai-keys-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-chat-homepage: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/shared/chat-ai-keys-runtime" -}}{{ .Data.data.homepage }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-admin-secret: "kv/data/atlas/comms/mas-admin-client-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-admin-secret: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-admin-client-runtime" -}}{{ .Data.data.client_secret }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-synapse-db-pass: "kv/data/atlas/comms/synapse-db"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-synapse-db-pass: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/synapse-db" -}}{{ .Data.data.POSTGRES_PASSWORD }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-db-pass: "kv/data/atlas/comms/mas-db"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-db-pass: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-db" -}}{{ .Data.data.password }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-matrix-shared: "kv/data/atlas/comms/mas-secrets-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-matrix-shared: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-secrets-runtime" -}}{{ .Data.data.matrix_shared_secret }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-kc-secret: "kv/data/atlas/comms/mas-secrets-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-kc-secret: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-secrets-runtime" -}}{{ .Data.data.keycloak_client_secret }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-encryption: "kv/data/atlas/comms/mas-secrets-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-encryption: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-secrets-runtime" -}}{{ .Data.data.encryption }}{{- end -}}
|
2026-01-14 14:21:58 -03:00
|
|
|
vault.hashicorp.com/agent-inject-secret-mas-rsa-key: "kv/data/atlas/comms/mas-secrets-runtime"
|
|
|
|
|
vault.hashicorp.com/agent-inject-template-mas-rsa-key: |
|
2026-01-14 14:17:26 -03:00
|
|
|
{{- with secret "kv/data/atlas/comms/mas-secrets-runtime" -}}{{ .Data.data.rsa_key }}{{- end -}}
|
2025-12-31 15:37:54 -03:00
|
|
|
labels:
|
|
|
|
|
app: matrix-authentication-service
|
|
|
|
|
spec:
|
|
|
|
|
enableServiceLinks: false
|
2026-01-14 05:07:23 -03:00
|
|
|
serviceAccountName: comms-vault
|
2025-12-31 15:37:54 -03:00
|
|
|
nodeSelector:
|
|
|
|
|
hardware: rpi5
|
|
|
|
|
affinity:
|
|
|
|
|
nodeAffinity:
|
|
|
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
|
- weight: 50
|
|
|
|
|
preference:
|
|
|
|
|
matchExpressions:
|
|
|
|
|
- key: hardware
|
|
|
|
|
operator: In
|
|
|
|
|
values: ["rpi5","rpi4"]
|
2025-12-31 15:41:15 -03:00
|
|
|
initContainers:
|
|
|
|
|
- name: render-config
|
|
|
|
|
image: alpine:3.20
|
2025-12-31 15:37:54 -03:00
|
|
|
command: ["/bin/sh","-c"]
|
|
|
|
|
args:
|
|
|
|
|
- |
|
|
|
|
|
set -euo pipefail
|
2026-01-14 05:07:23 -03:00
|
|
|
. /vault/scripts/comms_vault_env.sh
|
2025-12-31 15:37:54 -03:00
|
|
|
umask 077
|
|
|
|
|
DB_PASS_ESCAPED="$(printf '%s' "${MAS_DB_PASSWORD}" | sed 's/[\\/&]/\\&/g')"
|
2025-12-31 15:49:21 -03:00
|
|
|
MATRIX_SECRET_ESCAPED="$(printf '%s' "${MATRIX_SHARED_SECRET}" | sed 's/[\\/&]/\\&/g')"
|
|
|
|
|
KC_SECRET_ESCAPED="$(printf '%s' "${KEYCLOAK_CLIENT_SECRET}" | sed 's/[\\/&]/\\&/g')"
|
|
|
|
|
|
|
|
|
|
sed \
|
|
|
|
|
-e "s/@@MAS_DB_PASSWORD@@/${DB_PASS_ESCAPED}/g" \
|
|
|
|
|
-e "s/@@MATRIX_SHARED_SECRET@@/${MATRIX_SECRET_ESCAPED}/g" \
|
|
|
|
|
-e "s/@@KEYCLOAK_CLIENT_SECRET@@/${KC_SECRET_ESCAPED}/g" \
|
|
|
|
|
/etc/mas/config.yaml > /rendered/config.yaml
|
2025-12-31 15:44:17 -03:00
|
|
|
chmod 0644 /rendered/config.yaml
|
2025-12-31 15:41:15 -03:00
|
|
|
volumeMounts:
|
|
|
|
|
- name: config
|
|
|
|
|
mountPath: /etc/mas/config.yaml
|
|
|
|
|
subPath: config.yaml
|
|
|
|
|
readOnly: true
|
|
|
|
|
- name: rendered
|
|
|
|
|
mountPath: /rendered
|
|
|
|
|
readOnly: false
|
2026-01-14 05:07:23 -03:00
|
|
|
- name: vault-scripts
|
|
|
|
|
mountPath: /vault/scripts
|
|
|
|
|
readOnly: true
|
2025-12-31 15:41:15 -03:00
|
|
|
containers:
|
|
|
|
|
- name: mas
|
2025-12-31 17:10:45 -03:00
|
|
|
image: ghcr.io/element-hq/matrix-authentication-service:1.8.0
|
2025-12-31 15:41:15 -03:00
|
|
|
args: ["server","--config","/rendered/config.yaml"]
|
2025-12-31 15:37:54 -03:00
|
|
|
ports:
|
|
|
|
|
- name: http
|
|
|
|
|
containerPort: 8080
|
|
|
|
|
protocol: TCP
|
2026-01-01 18:22:32 -03:00
|
|
|
- name: internal
|
|
|
|
|
containerPort: 8081
|
|
|
|
|
protocol: TCP
|
2025-12-31 15:37:54 -03:00
|
|
|
volumeMounts:
|
2025-12-31 15:41:15 -03:00
|
|
|
- name: rendered
|
|
|
|
|
mountPath: /rendered
|
2025-12-31 15:37:54 -03:00
|
|
|
readOnly: true
|
|
|
|
|
resources:
|
|
|
|
|
requests:
|
|
|
|
|
cpu: 200m
|
|
|
|
|
memory: 256Mi
|
|
|
|
|
limits:
|
|
|
|
|
cpu: "2"
|
|
|
|
|
memory: 1Gi
|
|
|
|
|
volumes:
|
|
|
|
|
- name: config
|
|
|
|
|
configMap:
|
|
|
|
|
name: matrix-authentication-service-config
|
|
|
|
|
items:
|
|
|
|
|
- key: config.yaml
|
|
|
|
|
path: config.yaml
|
2025-12-31 15:41:15 -03:00
|
|
|
- name: rendered
|
|
|
|
|
emptyDir: {}
|
2026-01-14 05:07:23 -03:00
|
|
|
- name: vault-scripts
|
|
|
|
|
configMap:
|
|
|
|
|
name: comms-vault-env
|
|
|
|
|
defaultMode: 0555
|
2025-12-31 15:37:54 -03:00
|
|
|
---
|
|
|
|
|
apiVersion: v1
|
|
|
|
|
kind: Service
|
|
|
|
|
metadata:
|
|
|
|
|
name: matrix-authentication-service
|
|
|
|
|
spec:
|
|
|
|
|
selector:
|
|
|
|
|
app: matrix-authentication-service
|
|
|
|
|
ports:
|
|
|
|
|
- name: http
|
|
|
|
|
port: 8080
|
|
|
|
|
targetPort: http
|
|
|
|
|
protocol: TCP
|
2026-01-01 18:22:32 -03:00
|
|
|
- name: internal
|
|
|
|
|
port: 8081
|
|
|
|
|
targetPort: internal
|
|
|
|
|
protocol: TCP
|