synapse/manifests/prod/delegation.yaml
2024-09-27 07:42:17 +07:00

92 lines
1.8 KiB
YAML

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: delegation
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
ingressClassName: nginx
tls:
- secretName: tls-delegation
hosts:
- "$SERVER_NAME"
rules:
- host: "$SERVER_NAME"
http:
paths:
- path: /.well-known/matrix/
pathType: Prefix
backend:
service:
name: delegation
port:
name: http
---
apiVersion: v1
kind: Service
metadata:
name: delegation
labels:
app: delegation
spec:
selector:
app: delegation
ports:
- name: http
port: 80
targetPort: http
---
apiVersion: v1
kind: ConfigMap
metadata:
name: delegation
data:
default.conf: |
server {
listen 80;
location /.well-known/matrix/server {
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.server": "$BASE_URL:443"}';
}
location /.well-known/matrix/client {
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '{"m.homeserver": {"base_url": "https://$BASE_URL"}}';
}
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: delegation
labels:
app: delegation
spec:
replicas: $NB_REPLICAS
selector:
matchLabels:
app: delegation
template:
metadata:
labels:
app: delegation
spec:
containers:
- name: app
image: docker.io/nginx:latest
ports:
- name: http
containerPort: 80
volumeMounts:
- name: delegation
mountPath: /etc/nginx/conf.d/
volumes:
- name: delegation
configMap:
name: delegation