Adds mattermost app.

This commit is contained in:
2026-06-19 21:33:11 +00:00
parent d7a11b380c
commit 2d0292a69b
10 changed files with 292 additions and 0 deletions

5
mattermost/app.yaml Normal file
View File

@@ -0,0 +1,5 @@
name: mattermost
is: mattermost
description: Mattermost is a self-hosted, open-source team messaging platform offering secure channels, file sharing, and integrations as a Slack alternative.
icon: https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mattermost.svg
latest: "10"

View File

@@ -0,0 +1,33 @@
# Mattermost
Mattermost is an open-source team messaging platform, a self-hosted alternative to Slack.
## Dependencies
- **PostgreSQL** - Database for storing messages and team data
## Configuration
Key settings in `config.yaml`:
- **domain** - Where Mattermost will be accessible
- **storage** - Persistent volume size (default: `2Gi`)
- **db.name** - Database name (default: `mattermost`)
## First-Time Setup
1. Add and deploy the app:
```bash
wild app add mattermost
wild app deploy mattermost
```
2. Visit the app URL — on first load you will be prompted to create an administrator account (email + password).
3. After creating the admin account, complete the onboarding wizard to set up your first team.
## Notes
- The setup wizard only runs on first launch
- Email invitations require SMTP to be configured in **System Console → Environment → SMTP**
- Push notifications for mobile apps require a push proxy (or Mattermost Cloud push notification service)

View File

@@ -0,0 +1,59 @@
apiVersion: batch/v1
kind: Job
metadata:
name: mattermost-db-init
labels:
component: db-init
spec:
template:
metadata:
labels:
component: db-init
spec:
restartPolicy: OnFailure
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 999
seccompProfile:
type: RuntimeDefault
containers:
- name: postgres-init
image: postgres:15
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
env:
- name: PGHOST
value: {{ .db.host }}
- name: PGUSER
value: postgres
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: mattermost-secrets
key: postgres.password
- name: DB_NAME
value: {{ .db.name }}
- name: DB_USER
value: {{ .db.user }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: mattermost-secrets
key: dbPassword
command:
- /bin/bash
- -c
- |
set -e
until pg_isready; do sleep 2; done
psql -c "CREATE DATABASE ${DB_NAME};" || echo "Database already exists"
psql -c "CREATE USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';" || echo "User already exists"
psql -c "ALTER USER ${DB_USER} WITH PASSWORD '${DB_PASSWORD}';"
psql -c "GRANT ALL PRIVILEGES ON DATABASE ${DB_NAME} TO ${DB_USER};"
psql -d ${DB_NAME} -c "GRANT ALL ON SCHEMA public TO ${DB_USER};"
echo "Done"

View File

@@ -0,0 +1,93 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mattermost
namespace: mattermost
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
component: web
template:
metadata:
labels:
component: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 2000
runAsGroup: 2000
fsGroup: 2000
seccompProfile:
type: RuntimeDefault
containers:
- name: mattermost
image: mattermost/mattermost-team-edition:10.8.1
ports:
- name: http
containerPort: 8065
protocol: TCP
env:
- name: MM_SERVICESETTINGS_SITEURL
value: https://{{ .domain }}
- name: MM_SQLSETTINGS_DRIVERNAME
value: postgres
- name: MM_SQLSETTINGS_DATASOURCE
valueFrom:
secretKeyRef:
name: mattermost-secrets
key: dbUrl
- name: MM_FILESETTINGS_DIRECTORY
value: /mattermost/data/
- name: MM_PLUGINSETTINGS_PLUGINDIRECTORY
value: /mattermost/plugins
- name: MM_CLIENTPLUGINSSETTINGS_PLUGINDIRECTORY
value: /mattermost/client/plugins
- name: MM_LOGSETTINGS_CONSOLELEVEL
value: INFO
resources:
limits:
cpu: 500m
ephemeral-storage: 1Gi
memory: 1Gi
requests:
cpu: 50m
ephemeral-storage: 50Mi
memory: 256Mi
volumeMounts:
- name: mattermost-data
mountPath: /mattermost/data
- name: mattermost-plugins
mountPath: /mattermost/plugins
livenessProbe:
httpGet:
path: /api/v4/system/ping
port: 8065
initialDelaySeconds: 60
timeoutSeconds: 5
periodSeconds: 15
failureThreshold: 6
readinessProbe:
httpGet:
path: /api/v4/system/ping
port: 8065
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 10
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: false
volumes:
- name: mattermost-data
persistentVolumeClaim:
claimName: mattermost-data
- name: mattermost-plugins
persistentVolumeClaim:
claimName: mattermost-plugins
restartPolicy: Always

View File

@@ -0,0 +1,26 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mattermost
namespace: mattermost
annotations:
external-dns.alpha.kubernetes.io/target: {{ .externalDnsDomain }}
external-dns.alpha.kubernetes.io/cloudflare-proxied: "false"
external-dns.alpha.kubernetes.io/ttl: "60"
spec:
ingressClassName: traefik
rules:
- host: {{ .domain }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mattermost
port:
number: 80
tls:
- hosts:
- {{ .domain }}
secretName: {{ .tlsSecretName }}

View File

@@ -0,0 +1,16 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: mattermost
labels:
- includeSelectors: true
pairs:
app: mattermost
managedBy: kustomize
partOf: wild-cloud
resources:
- namespace.yaml
- db-init-job.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- pvc.yaml

View File

@@ -0,0 +1,20 @@
version: 10.8.1-1
requires:
- name: postgres
defaultConfig:
namespace: mattermost
externalDnsDomain: '{{ .cloud.domain }}'
domain: mattermost.{{ .cloud.domain }}
tlsSecretName: wildcard-wild-cloud-tls
storage: 2Gi
db:
host: '{{ .apps.postgres.host }}'
port: '{{ .apps.postgres.port }}'
name: mattermost
user: mattermost
defaultSecrets:
- key: dbPassword
- key: dbUrl
default: 'postgres://{{ .app.db.user }}:{{ .secrets.dbPassword }}@{{ .app.db.host }}:{{ .app.db.port }}/{{ .app.db.name }}?sslmode=disable&connect_timeout=10'
requiredSecrets:
- postgres.password

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: mattermost

View File

@@ -0,0 +1,23 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mattermost-data
namespace: mattermost
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .storage }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mattermost-plugins
namespace: mattermost
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: mattermost
namespace: mattermost
spec:
selector:
component: web
ports:
- name: http
port: 80
targetPort: 8065
protocol: TCP