eimis-ans / eimis-synapse

Make a Synapse homeserver work on a managed kubernetes server hosted by OVH

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synapse on Kubernetes

Matrix GitHub Actions Workflow Status License

Make a Synapse/Matrix server work on a managed kubernetes cluster hosted by OVH

The Matrix-synapse stack is based on the work done by Alexander Olofsson : https://gitlab.com/ananace/charts/-/tree/master/charts/matrix-synapse

Prerequisites

  • an account in OVH hosting provider and its credentials (application key, application secret, consumer secret and endpoint)
  • to store Terraform state files : a S3 object storage with the credentials to connect to (access key, secret key, endpoint and region) and a bucket named terraform-states-hp-myenv for example.
  • a user and credentials dedicated to openstack with the following rights : [Network Security Operator, Volume Operator, Network Operator, Backup Operator, Compute Operator, Image Operator, Administrator, Infrastructure Supervisor]
  • to reach the future synapse homeserver : a valid dns zone hosted by OVH
  • to send some mails to users : a valid access to a SMTP service

On the computer running this code :

Provisioning

  • Create in the local folder a local.env.sh file copying the script/local.env.template.sh file and fill it with all the environment variables values needed. OS_variables relate to the openstack part.

    Then source this file :

    source local/local.env.sh
  • Generate the var file for provisioning stage (terraform.tfvars) based on values previously set :

    sh scripts/generate_provisioning_var_files.sh
  • Go to the terraform folder

    cd terraform
  • Initialize the Terraform workspace specifying the name of the S3 bucket

    terraform init -backend-config="bucket=terraform-states-hp-$ENVIRONMENT"
  • Create the Terraform execution plan to validate that everything is ok

    terraform plan
  • Apply the Terraform plan

    terraform apply

    This will lead to the creation of a kubernetes cluster with 1 control plane node and several worker nodes

Configuration

The configuration part will be done with Ansible and is quite independent from the provisioning part.

This will lead to the installation of the following components in the cluster :

  • basic components :
    • an ingress controller
    • a certificate manager
  • components specific to our stack :
    • a keycloak instance along with its operator
    • the synapse stack and its customization
    • the element-web stack
    • the stunner stack used to facilitate audio/video on element
    • a prometheus/grafana stack for monitoring
    • an alpha unofficial version of a MS teams bridge

Other credits

About

Make a Synapse homeserver work on a managed kubernetes server hosted by OVH

License:MIT License


Languages

Language:HCL 49.5%Language:Shell 33.2%Language:Jinja 17.3%