--- 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: - gmoker.com rules: - host: gmoker.com 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 / { return 200; } location /.well-known/matrix/server { default_type application/json; return 200 '{"m.server": "$BASE_URL:443"}'; } location /.well-known/matrix/client { default_type application/json; 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 readOnly: true volumes: - name: delegation configMap: name: delegation