/dendrite-k8s-manifest

Example of a matrix dendrite K8S deployement

Apache License 2.0Apache-2.0

K8S manifest for Dendrite

Deploy a Dendrite monolith server on a K8S cluster (v1.16).

Preparation

  1. The manifest deploy dendrite into a namespace called dendrite. First thing is to create the namspace:
kubectl create namespace dendrite
  1. Generate the Dendrite server signing key

Compile the generate-keys tool from https://github.com/matrix-org/dendrite/tree/master/cmd/generate-keys and generate the server private key:

generate-keys -private-key matrix_key.pem
  1. Create a secret from the private key generated in the previous step
kubectl -n dendrite create secret generic dendrite-cert --from-file=matrix_key.pem
  1. Configure your server name in the dendrite configuration file

Edit the files dendrite-cm.yaml and dendrite-cm.yaml by replacing <server_name> with your actual server name.

  1. Deploy dendrite
kubectl apply -f dendrite-cm.yaml,dendrite-deployment.yaml,dendrite-pvc.yaml,dendrite-svc.yaml
  1. Create an ingress to expose the server over your domain

This ingress used cert-manager to generate TLS certificate automatically from Lets'Encrypt. Make sure you have cert-manager properly installed and functionning in your cluster before deploying the ingress.

Once cert-manager is properly working and your domain point to one of your K8S node that has a public address, deploy the ingress:

kubectl apply -f dendrite-ingress.yaml
  1. Configure the SRV record to configure the federation:

This example expect a SRV record properly configured in order to make the federation work. Checkout the documentation to know how to configure it: https://matrix.org/docs/spec/server_server/latest#resolving-server-names