This document provides guidelines for AI coding agents working on the Mattermost Helm chart repository.
This repository contains an Operator-based Helm chart for deploying Mattermost Enterprise Edition on Kubernetes. The chart uses the Mattermost Operator CRD (installation.mattermost.com/v1beta1) for deployment management.
- Operator-based deployment: Uses Mattermost CRD for lifecycle management
- In-cluster Redis: Bitnami Redis subchart for cluster caching
- VPN sidecar: OpenVPN client for internal network access (via resourcePatch)
- TLS via cert-manager: Automatic certificate management
- GitHub Actions CI/CD: Automated deployment with health checks and rollback
# Lint the Helm chart
helm lint charts/mattermost
# Lint with additional values files
helm lint charts/mattermost -f values-test.yaml
# Run chart-testing lint
ct lint --charts charts/mattermost --config ct.yaml# Run helm install in dry-run mode to validate templates
helm install mattermost ./charts/mattermost --dry-run --debug --namespace mattermost
# Test with specific values
helm install mattermost ./charts/mattermost --dry-run -f custom-values.yaml --namespace mattermost
# Run chart-testing install (requires cluster)
ct install --config ct.yaml# Update dependencies first
helm dependency update charts/mattermost
# Render templates without installing
helm template mattermost ./charts/mattermost --namespace mattermost
# Render to a file for review
helm template mattermost ./charts/mattermost --namespace mattermost > rendered.yaml
# Render with debug output
helm template mattermost ./charts/mattermost --debug --namespace mattermost# Update dependencies
helm dependency update charts/mattermost
# Deploy/upgrade
helm upgrade --install mattermost ./charts/mattermost \
--namespace mattermost \
--values charts/mattermost/values.yaml \
--timeout 5m \
--atomic
# Check deployment status
kubectl get mattermost -n mattermost
kubectl get pods -n mattermost -l "installation.mattermost.com/installation=mm-glia".
├── .github/
│ └── workflows/
│ └── deploy.yaml # CI/CD pipeline
├── charts/
│ └── mattermost/
│ ├── Chart.yaml # Chart metadata, Redis dependency
│ ├── values.yaml # Default configuration
│ ├── values.schema.json # JSON schema for validation
│ └── templates/
│ ├── _helpers.tpl # Template helpers
│ ├── mattermost-cr.yaml # Mattermost CRD instance
│ ├── ingress-redirect.yaml # Redirect ingress
│ └── NOTES.txt # Post-install notes
├── ct.yaml # Chart-testing configuration
└── AGENTS.md
- Use 2 spaces for indentation
- Add a newline at the end of files
- Maximum line length: 120 characters
- Use
|for multi-line strings (block style) - Quote strings that contain special characters
- Use lowercase with hyphens:
mm-glia - CRD name configurable via
crdNamein values - Template names:
{{ include "mattermost.fullname" . }} - Label names:
app.kubernetes.io/name,helm.sh/chart
metadata:
labels:
app.kubernetes.io/name: {{ include "mattermost.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
app.kubernetes.io/component: server
app.kubernetes.io/part-of: mattermost
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "mattermost.chart" . }}Use {{- if }} with proper whitespace handling:
{{- if .Values.redis.enabled }}
- name: MM_CLUSTERSETTINGS_USEREDIS
value: "true"
{{- end }}- Use
requiredfor mandatory values - Use
failfor validation errors
The chart references these pre-existing secrets (not created by Helm):
| Secret | Keys | Purpose |
|---|---|---|
mysql-connection |
DB_CONNECTION_STRING |
PostgreSQL connection string |
s3-access-key |
accesskey, secretkey |
S3/Spaces credentials |
mattermost-license |
license |
Enterprise license |
openvpn-config |
config.ovpn |
OpenVPN client config |
openvpn-credentials |
username, password |
VPN auth |
Redis is deployed as a subchart for cluster caching:
redis:
enabled: true
auth:
enabled: true
master:
persistence:
enabled: false # Cache onlyRedis connection is auto-configured via environment variables.
OpenVPN sidecar uses resourcePatch to add a container to the operator-managed deployment:
vpn:
enabled: true
configSecret: openvpn-config
credentialsSecret: openvpn-credentials
routes:
- 192.168.1.0/24 # Only route this network via VPNingress:
enabled: true
host: group.glia.org
tlsSecret: mm-glia
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/ingress.class: nginx- Push to
mainbranch - Paths:
charts/mattermost/** - Manual dispatch via
workflow_dispatch
- Lint: Validate chart syntax and rendering
- Deploy:
helm upgrade --installwith atomic rollback - Wait: Poll Mattermost CR
status.state == stable - Health Check: Verify all pods are ready
- Rollback: Automatic on failure
| Secret | Description |
|---|---|
KUBE_CONFIG |
Base64-encoded kubeconfig |
Generate with:
kubectl config view --raw --minify | base64 -w 0- Use conventional commits:
feat:,fix:,docs:,chore: - Reference issues in commit messages
- Keep commits atomic and focused
- Run
helm dependency update charts/mattermost - Run
helm lint charts/mattermost - Run
helm template mattermost ./charts/mattermost --namespace mattermost - Verify YAML is valid
- Ensure all new values have defaults
- Test deployment on dev cluster if significant changes