This commit is contained in:
Waylon Walker 2025-11-22 22:20:32 -06:00
parent 8c0277c8f3
commit 9e2c30af22
60 changed files with 8853 additions and 232 deletions

232
matrix/deployment.yaml Normal file
View file

@ -0,0 +1,232 @@
# namespace: matrix
apiVersion: v1
kind: Namespace
metadata:
name: matrix
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: db
name: db
namespace: matrix
spec:
ports:
- name: "5432"
port: 5432
targetPort: 5432
selector:
io.kompose.service: db
status:
loadBalancer: {}
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.service.expose: dev-matrix.wayl.one,matrix.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
ports:
- name: "8008"
port: 8008
targetPort: 8008
selector:
io.kompose.service: synapse
status:
loadBalancer: {}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: matrix
namespace: matrix
spec: {}
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: db
name: db
namespace: matrix
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: db
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/matrix-default: "true"
io.kompose.service: db
spec:
containers:
- env:
- name: POSTGRES_INITDB_ARGS
value: --encoding=UTF-8 --lc-collate=C --lc-ctype=C
- name: POSTGRES_PASSWORD
value: synapse
- name: POSTGRES_USER
value: synapse
image: docker.io/postgres:12-alpine
name: synapse-db
ports:
- containerPort: 5432
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: schemas
restartPolicy: Always
volumes:
- name: schemas
persistentVolumeClaim:
claimName: schemas
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: schemas
name: schemas
namespace: matrix
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.service.expose: dev-matrix.wayl.one,matrix.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: synapse
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.service.expose: dev-matrix.wayl.one,matrix.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/matrix-default: "true"
io.kompose.service: synapse
spec:
containers:
- image: docker.io/matrixdotorg/synapse:latest
name: synapse
ports:
- containerPort: 8008
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /data
name: synapse-data
restartPolicy: Always
volumes:
- name: synapse-data
persistentVolumeClaim:
claimName: synapse-data
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kompose.cmd: kompose convert -o deployment.yaml -n matrix
kompose.service.expose: dev-matrix.wayl.one,matrix.k.waylonwalker.com
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
rules:
- host: dev-matrix.wayl.one
http:
paths:
- backend:
service:
name: synapse
port:
number: 8008
path: /
pathType: Prefix
- host: matrix.k.waylonwalker.com
http:
paths:
- backend:
service:
name: synapse
port:
number: 8008
path: /
pathType: Prefix
status:
loadBalancer: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: synapse-data
name: synapse-data
namespace: matrix
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

View file

@ -8,44 +8,49 @@ services:
synapse:
image: docker.io/matrixdotorg/synapse:latest
container_name: synapse
restart: unless-stopped
networks:
- proxy
security_opt:
- no-new-privileges:true
volumes:
- ${PWD}/matrix/synapse-data:/data
depends_on:
- db
# - ${PWD}/matrix/synapse-data:/data
- synapse-data:/data
# depends_on:
# - db
ports:
- 8448:8448/tcp
labels:
- "traefik.enable=true"
- "traefik.http.routers.synapse.entrypoints=http"
- "traefik.http.routers.synapse.rule=Host(`matrix.${URL}`)"
- "traefik.http.middlewares.synapse-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.synapse.middlewares=synapse-https-redirect"
- "traefik.http.routers.synapse-secure.entrypoints=https"
- "traefik.http.routers.synapse-secure.rule=Host(`matrix.${URL}`)"
- "traefik.http.routers.synapse-secure.tls=true"
- "traefik.http.routers.synapse-secure.service=synapse"
- "traefik.http.services.synapse.loadbalancer.server.port=8008"
- "traefik.docker.network=proxy"
db:
image: docker.io/postgres:12-alpine
container_name: synapse-db
# Change that password, of course!
environment:
- POSTGRES_USER=${SYNAPSE_POSTGRES_USER:-synapse}
- POSTGRES_PASSWORD=${SYNAPSE_POSTGRES_PASSWORD:-synapse}
# ensure the database gets created correctly
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
volumes:
# You may store the database tables in a local folder..
- ${PWD}/matrix/schemas:/var/lib/postgresql/data
# .. or store them on some high performance storage for better results
# - /path/to/ssd/storage:/var/lib/postgresql/data
kompose.service.expose: m2.wayl.one
# - "traefik.enable=true"
# - "traefik.http.routers.synapse.entrypoints=http"
# - "traefik.http.routers.synapse.rule=Host(`matrix.${URL}`)"
# - "traefik.http.middlewares.synapse-https-redirect.redirectscheme.scheme=https"
# - "traefik.http.routers.synapse.middlewares=synapse-https-redirect"
# - "traefik.http.routers.synapse-secure.entrypoints=https"
# - "traefik.http.routers.synapse-secure.rule=Host(`matrix.${URL}`)"
# - "traefik.http.routers.synapse-secure.tls=true"
# - "traefik.http.routers.synapse-secure.service=synapse"
# - "traefik.http.services.synapse.loadbalancer.server.port=8008"
# - "traefik.docker.network=proxy"
# db:
# image: docker.io/postgres:12-alpine
# container_name: synapse-db
# # Change that password, of course!
# environment:
# - POSTGRES_USER=${SYNAPSE_POSTGRES_USER:-synapse}
# - POSTGRES_PASSWORD=${SYNAPSE_POSTGRES_PASSWORD:-synapse}
# # ensure the database gets created correctly
# # https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
# - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
# volumes:
# # You may store the database tables in a local folder..
# - ${PWD}/matrix/schemas:/var/lib/postgresql/data
# # .. or store them on some high performance storage for better results
# # - /path/to/ssd/storage:/var/lib/postgresql/data
volumes:
synapse-data: {}
networks:
proxy:

54
matrix/generate.yaml Normal file
View file

@ -0,0 +1,54 @@
apiVersion: v1
kind: Namespace
metadata:
name: matrix
---
apiVersion: batch/v1
kind: Job
metadata:
name: synapse-generate
namespace: matrix
spec:
ttlSecondsAfterFinished: 100
template:
spec:
containers:
- image: docker.io/matrixdotorg/synapse:latest
name: synapse
command: ["generate"]
volumeMounts:
- mountPath: /data
name: synapse-data
volumes:
- name: synapse-data
persistentVolumeClaim:
claimName: synapse-data
# template:
# spec:
# containers:
# - image: docker.io/matrixdotorg/synapse:latest
# name: synapse
# command: ["generate"]
# volumeMounts:
# - mountPath: /data
# name: synapse-data
# volumes:
# - name: synapse-data
# persistentVolumeClaim:
# claimName: synapse-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: synapse-data
name: synapse-data
namespace: matrix
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

9
matrix/justfile Normal file
View file

@ -0,0 +1,9 @@
default: convert deploy viz
convert:
kompose convert -o deployment.yaml -n matrix
deploy:
kubectl apply -f deployment.yaml
viz:
k8sviz -n matrix --kubeconfig $KUBECONFIG -t png -o matrix-k8s.png
restart:
kubectl rollout restart -n matrix deployment/matrix

BIN
matrix/kui Normal file

Binary file not shown.

BIN
matrix/matrix-k8s.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

127
matrix/matrix.yaml Normal file
View file

@ -0,0 +1,127 @@
---
apiVersion: v1
kind: Service
metadata:
annotations:
kompose.cmd: kompose convert --namespace matrix -o matrix.yaml
kompose.service.expose: m2.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
ports:
- name: "8448"
port: 8448
targetPort: 8448
selector:
io.kompose.service: synapse
status:
loadBalancer: {}
---
apiVersion: v1
kind: Namespace
metadata:
creationTimestamp: null
name: matrix
namespace: matrix
spec: {}
status: {}
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
kompose.cmd: kompose convert --namespace matrix -o matrix.yaml
kompose.service.expose: m2.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: synapse
strategy:
type: Recreate
template:
metadata:
annotations:
kompose.cmd: kompose convert --namespace matrix -o matrix.yaml
kompose.service.expose: m2.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.network/proxy: "true"
io.kompose.service: synapse
spec:
containers:
- image: docker.io/matrixdotorg/synapse:latest
name: synapse
ports:
- containerPort: 8448
hostPort: 8448
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /data
name: synapse-data
restartPolicy: Always
volumes:
- name: synapse-data
persistentVolumeClaim:
claimName: synapse-data
status: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kompose.cmd: kompose convert --namespace matrix -o matrix.yaml
kompose.service.expose: m2.wayl.one
kompose.version: 1.31.2 (a92241f79)
creationTimestamp: null
labels:
io.kompose.service: synapse
name: synapse
namespace: matrix
spec:
rules:
- host: m2.wayl.one
http:
paths:
- backend:
service:
name: synapse
port:
number: 8448
path: /
pathType: Prefix
status:
loadBalancer: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: synapse-data
name: synapse-data
namespace: matrix
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}

45
matrix/pvc-inspector.yaml Normal file
View file

@ -0,0 +1,45 @@
apiVersion: v1
kind: Namespace
metadata:
name: matrix
---
apiVersion: v1
kind: Pod
metadata:
name: pvc-inspector
namespace: matrix
spec:
containers:
- image: docker.io/matrixdotorg/synapse:latest
name: pvc-inspector
command: ["sleep", "infinity"]
volumeMounts:
- mountPath: /data
name: synapse-data
- image: docker.io/matrixdotorg/synapse:latest
name: pvc-inspector-synapse
command: ["sleep", "infinity"]
volumeMounts:
- mountPath: /data
name: synapse-data
volumes:
- name: synapse-data
persistentVolumeClaim:
claimName: synapse-data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
creationTimestamp: null
labels:
io.kompose.service: synapse-data
name: synapse-data
namespace: matrix
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Mi
status: {}