mattermost-team-edition

by Mattermost

Helm chartv6.6.112App 12.1.0Verified publisher

Mattermost Team Edition server.

About this chart

Mattermost Team Edition

:warning: This helm chart is no longer supported. For deploying Mattermost, use our Mattermost Operator here. Additionally, we recommend migrating any existing Helm deployments to the Mattermost Operator to guarantee ongoing support and better management capabilities.

Mattermost is a hybrid cloud enterprise messaging workspace that brings your messaging and tools together to get more done, faster.

TL;DR;

$ helm repo add mattermost https://helm.mattermost.com
$ helm install mattermost/mattermost-team-edition \
  --set mysql.mysqlUser=sampleUser \
  --set mysql.mysqlPassword=samplePassword \

Introduction

This chart creates a Mattermost Team Edition deployment on a Kubernetes cluster using the Helm package manager.

Prerequisites

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release mattermost/mattermost-team-edition

Helm v3 command

$ helm install my-release mattermost/mattermost-team-edition

The command deploys Mattermost on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Upgrading the Chart to 3.0.0+

Breaking Helm chart changes was introduced with version 3.0.0. The easiest method of resolving them is to simply upgrade the chart and let it fail with and provide you with a custom message on what you need to change in your configuration. Note that this failure will occur before any changes have been made to the k8s cluster.

Upgrading the Chart to 4.0.0+

The Chart version 4.0.0+ supports only Helm v3, follow the guide

Upgrading the Chart to 5.0.0+

There were some changes that was introduced in Mattermost version 5.30+ that made this helm chart incompatible and caused the upgrade to fail. To fix that a new Major version of the chart was released, and now the configuration is moved to the database and environment variables.

Steps to migrate:

1 - Copy the existing configuration file from your Secret save it (for backup)

$ kubectl get secrets mm-te-mattermost-team-edition-config-json -o=go-template='{{index .data "config.json"}}' | base64 -d | jq . > config-mm.json

2 - Access the Mattermost pod

$ kubectl exec -it mm-te-mattermost-team-edition-799cc8b475-twglt /bin/sh

3 - Copy the exist config.json to a temp folder, run this inside the container you accessed on Item 2

$ cp config/config.json /tmp

4 - Migrate the config.json to the database (run inside the container that you accessed in the Item 2)

~ $ ./bin/mattermost config migrate /tmp/config.json "mysql://mmuser:mmuser123@tcp(mm-te-mysql:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"
{"level":"warn","msg":"DefaultServerLocale must be one of the supported locales. Setting DefaultServerLocale to en as default value."}
{"level":"warn","msg":"DefaultClientLocale must be one of the supported locales. Setting DefaultClientLocale to en as default value."}
{"level":"warn","msg":"DefaultServerLocale must be one of the supported locales. Setting DefaultServerLocale to en as default value."}
{"level":"warn","msg":"DefaultClientLocale must be one of the supported locales. Setting DefaultClientLocale to en as default value."}
{"level":"info","msg":"Successfully migrated config."}

5 - Update the helm repo

$ helm repo update

6 - Upgrade your mattermost helm, check your existing values, you remove the section config.json from your custom values and important need to keep the existing image tag in this case was 5.29.0

$ helm upgrade  mm-te -f custom_values.yaml --set image.tag=5.29.0 mattermost/mattermost-team-edition

7 - It should deploy and in a few seconds the new Pod for the Mattermost server should be up and running

8 - After all up and running you can upgrade it again to get the latest image tag

$ helm upgrade  mm-te -f custom_values.yaml mattermost/mattermost-team-edition

If in your custom_values.yaml you set the image.tag, please update that to the latest available, at the time of this doc was write the version is 5.35.3

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Mattermost Team Edition chart and their default values.

ParameterDescriptionDefault
configJSONThe config.json configuration to be used by the mattermost server. The values you provide will by using Helm's merging behavior override individual default values only. See the example configuration and the Mattermost documentation for details.See configJSON in values.yaml
containerSecurityContextSecurity context for the containernull
image.repositoryContainer image repositorymattermost/mattermost-team-edition
image.tagContainer image tag5.39.0
image.imagePullPolicyContainer image pull policyIfNotPresent
initContainerImage.repositoryInit container image repositoryappropriate/curl
initContainerImage.tagInit container image taglatest
initContainerImage.imagePullPolicyContainer image pull policyIfNotPresent
revisionHistoryLimitHow many old ReplicaSets for Mattermost Deployment you want to retain1
ingress.enabledIf true, an ingress is createdfalse
ingress.hostsA list of ingress hosts[mattermost.example.com]
ingress.tlsA list of ingress tls items[]
mysql.enabledEnables deployment of a mysql servertrue
mysql.mysqlRootPasswordRoot Password for Mysql (Optional)""
mysql.mysqlUserUsername for Mysql (Required)""
mysql.mysqlPasswordUser Password for Mysql (Required)""
mysql.mysqlDatabaseDatabase name (Required)"mattermost"
externalDB.enabledEnables use of an preconfigured external database serverfalse
externalDB.externalDriverType"postgres" or "mysql"""
externalDB.externalConnectionStringSee the section about external databases.""
extraPodAnnotationsExtra pod annotations to be used in the deployments[]
extraEnvVarsExtra environments variables to be used in the deployments[]
extraInitContainersAdditional init containers[]
securityContextSecurity context for the podnull
service.annotationsService annotations{}
service.loadBalancerIPA user-specified IP address for service type LoadBalancer to use as External IP (if supported)nil
service.loadBalancerSourceRangeslist of IP CIDRs allowed access to load balancer (if supported)[]
serviceAccount.createEnables creation and use of a service account for the mattermost podfalse
serviceAccount.nameName of the service account to create and use""
serviceAccount.annotationsThe service account annotations{}

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm install --name my-release \
  --set image.tag=5.35.3 \
  --set mysql.mysqlUser=sampleUser \
  --set mysql.mysqlPassword=samplePassword \
  mattermost/mattermost-team-edition

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

$ helm install --name my-release -f values.yaml mattermost/mattermost-team-edition

Example configuration

A basic example of a .yaml file with values that could be passed to the helm command with the -f or --values flag to get started.

ingress:
  enabled: true
  hosts:
    - mattermost.example.com

configJSON:
  ServiceSettings:
    SiteURL: "https://mattermost.example.com"
  TeamSettings:
    SiteName: "Mattermost on Example.com"

External Databases

There is an option to use external database services (PostgreSQL or MySQL) for your Mattermost installation. If you use an external Database you will need to disable the MySQL chart in the values.yaml

mysql:
  enabled: false

PostgreSQL

To use an external PostgreSQL, You need to set Mattermost externalDB config

IMPORTANT: Make sure the DB is already created before deploying Mattermost services

externalDB:
  enabled: true
  externalDriverType: "postgres"
  externalConnectionString: "<USERNAME>:<PASSWORD>@<HOST>:5432/<DATABASE_NAME>?sslmode=disable&connect_timeout=10"

MySQL

To use an external MySQL, You need to set Mattermost externalDB config

IMPORTANT: Make sure the DB is already created before deploying Mattermost services

externalDB:
  enabled: true
  externalDriverType: "mysql"
  externalConnectionString: "<USERNAME>:<PASSWORD>@tcp(<HOST>:3306)/<DATABASE_NAME>?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s"

Expose extra ports

To use plugins that require extra ports to be exposed, you can use the following config

extraPorts:
    - name: plugin-name
      port: 8585
      protocol: TCP

Local development

For local testing use minikube

Create local cluster using with specified Kubernetes version (e.g. 1.15.6)

$ minikube start --kubernetes-version v1.15.6

Initialize helm

$ helm init

Above command is not required for Helm v3

Get dependencies

$ helm dependency update

Perform local installation

$ helm install . \
    --set image.tag=5.35.3 \
    --set mysql.mysqlUser=sampleUser \
    --set mysql.mysqlPassword=samplePassword

Helm v3 command

$ helm install . \
    --generate-name \
    --set image.tag=5.35.3 \
    --set mysql.mysqlUser=sampleUser \
    --set mysql.mysqlPassword=samplePassword

Limitations

For the Team Edition you can have just one replica running.

Deploy mattermost-team-edition with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has mattermost-team-edition on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmattermost-team-edition is pinned at v6.6.112 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply