Cloud Native 11 min read

Deploying Mattermost on Kubernetes with Helm

This guide explains how to install and configure the open‑source Mattermost messaging platform on a Kubernetes cluster using Helm, covering repository setup, chart selection, namespace creation, persistent volumes, external PostgreSQL integration, custom values.yaml adjustments, ingress configuration, and troubleshooting steps.

DevOps Cloud Academy
DevOps Cloud Academy
DevOps Cloud Academy
Deploying Mattermost on Kubernetes with Helm

Mattermost is an open‑source messaging platform designed for development teams, offering private‑cloud deployment, extensive DevOps tool integrations, and a full DevOps lifecycle support including planning, coding, building, testing, releasing, deploying, and monitoring.

Helm Repository Setup

# helm repo add mattermost https://helm.mattermost.com
# helm repo list
NAME        URL
stable      http://mirror.azure.cn/kubernetes/charts/
gitlab      https://charts.gitlab.io
mattermost  https://helm.mattermost.com

Chart Search and Version Selection

# helm search repo -l mattermost/mattermost-team-edition
NAME                                 CHART VERSION  APP VERSION  DESCRIPTION
mattermost/mattermost-team-edition   3.10.0         5.13.2       Mattermost Team Edition server.
... (other versions omitted for brevity) ...

Download Source for Customization

# helm fetch mattermost/mattermost-team-edition --version=3.10.0

Create Namespace

# kubectl create ns mattermost

Create PersistentVolumes for Data and Plugins

apiVersion: v1
kind: PersistentVolume
metadata:
  name: mattermost-data
  namespace: mattermost
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/data/devops/mattermost/data"
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: mattermost-plugins
  namespace: mattermost
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/data/devops/mattermost/plugins"

Apply the PV definitions:

# kubectl create -f pv.yaml
persistentvolume/mattermost-data created
persistentvolume/mattermost-plugins created

Create PostgreSQL Database and User

# CREATE DATABASE mattermost;
# CREATE USER mmuser WITH PASSWORD 'mmuser-password';
# GRANT ALL PRIVILEGES ON DATABASE mattermost TO mmuser;

Customize values.yaml for Persistence and Ingress

persistence:
  data:
    enabled: true
    size: 10Gi
    storageClass: manual
    accessMode: ReadWriteOnce
  plugins:
    enabled: true
    size: 1Gi
    storageClass: manual
    accessMode: ReadWriteOnce
ingress:
  enabled: true
  path: "/"
  annotations:
    kubernetes.io/ingress.class: nginx
  hosts:
    - mm.idevops.site
  tls: []

External Database Configuration (PostgreSQL example)

externalDB:
  enabled: true
  externalDriverType: "postgres"
  externalConnectionString: "postgres://mmuser:[email protected]:5432/mattermost?sslmode=disable&connect_timeout=10"

Verify connectivity:

# psql -h 192.168.1.200 -p 5432 -d mattermost -U mmuser

Deploy the Chart

# helm install mattermost-server --namespace mattermost ./mattermost-team-edition

If deployment fails due to a read‑only configuration file, create a PersistentVolume and PersistentVolumeClaim for /mattermost/config and mount it in the deployment template:

# mkdir -p /data/devops/mattermost/config
# (PV and PVC YAML omitted for brevity)
# Update templates/deployment.yaml to mount the PVC at /mattermost/config

After fixing the configuration, reinstall the chart:

# helm delete mattermost-server --namespace mattermost
# kubectl delete -f ./mattermost-team-edition/config-pvc.yaml
# kubectl delete -f ./mattermost-team-edition/pv.yaml
# kubectl create -f ./mattermost-team-edition/config-pvc.yaml
# kubectl create -f ./mattermost-team-edition/pv.yaml
# helm install mattermost-server --namespace mattermost ./mattermost-team-edition

Access the service at http://mm.idevops.site , create an admin user (admin:Devops.com123), set up a team, and configure language preferences as needed.

Common FAQ: error "no pg_hba.conf entry for host ..." – resolve by adding appropriate host entries to pg_hba.conf and setting listen_addresses = '*' in postgres.conf .

DeploymentKubernetesDevOpsHelmPersistentVolumeMattermost
DevOps Cloud Academy
Written by

DevOps Cloud Academy

Exploring industry DevOps practices and technical expertise.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.