Mattermost

  • By Canonical IS DevOps
Channel Revision Published Runs on
latest/stable 27 22 Nov 2023
Ubuntu 20.04
latest/edge 18 14 Jun 2021
Ubuntu 20.04
juju deploy mattermost-k8s
Show information

Platform:

Getting Started

What you’ll do

The mattermost-k8s charm helps deploy a horizontally scalable Mattermost application with ease. This tutorial will walk you through each step of deployment to get a basic Mattermost deployment.

Prerequisites

To deploy mattermost-k8s charm, you will need a juju bootstrapped with any kubernetes controller. To see how to bootstrap your juju installation with microk8s, please refer to the documentation on microk8s installation.

Setting up the tutorial model

To easily clean up the resources and to separate your workload from the contents of this tutorial, it is recommended to set up a new model with the following command.

juju add-model mattermost-tutorial

Deploy the mattermost-k8s charm

Deployment of Mattermost requires a relational database. The integration with the pgsql interface is required by the mattermost-k8s charm and hence, postgresql-k8s charm will be used.

Start off by deploying the mattermost charm. By default it will deploy the latest stable release of the mattermost-k8s charm.

juju deploy mattermost-k8s

Deploy and relate database

The following commands deploys the postgresql-k8s charm with TLS and relates mattermost-k8s charm through its db interface.

juju deploy postgresql-k8s
# If your k8s cluster has RBAC enabled, you'll then need to run this:
juju trust postgresql-k8s --scope=cluster
# Deploy and enable TLS certificates for PostgreSQL connections.
juju deploy tls-certificates-operator
# Using self-signed certificates for demonstration purposes only.
juju config tls-certificates-operator generate-self-signed-certificates="true" ca-common-name="Test CA"
juju relate postgresql-k8s tls-certificates-operator
# And now relate postgresql-k8s to mattermost-k8s
juju relate mattermost-k8s postgresql-k8s:db

Login to Mattermost

We should now edit /etc/hosts so that the IP address of your ingress controller resolves to the name of the deployed application. Add the following to that file:

127.0.0.1 mattermost-k8s

Once the deployment has completed and the “mattermost-k8s” workload state in juju status has changed to “active” you can then visit http://mattermost-k8s in a browser and log in to your Mattermost instance, and you’ll be presented with a screen to create an initial admin account. Further accounts must be created using this admin account, or by setting up an external authentication source, such as SAML.

Cleaning up the environment

Congratulations! You have successfully finished the mattermost-k8s tutorial. You can now remove the model environment that you’ve created using the following command.

juju destroy-model mattermost-tutorial -y --release-storage

Help improve this document in the forum (guidelines). Last updated 11 months ago.