From 2d0292a69b90ae88ad34e19cd33f9e45f42ab1a4 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Fri, 19 Jun 2026 21:33:11 +0000 Subject: [PATCH] Adds mattermost app. --- mattermost/app.yaml | 5 ++ mattermost/versions/10/README.md | 33 ++++++++ mattermost/versions/10/db-init-job.yaml | 59 ++++++++++++++ mattermost/versions/10/deployment.yaml | 93 +++++++++++++++++++++++ mattermost/versions/10/ingress.yaml | 26 +++++++ mattermost/versions/10/kustomization.yaml | 16 ++++ mattermost/versions/10/manifest.yaml | 20 +++++ mattermost/versions/10/namespace.yaml | 4 + mattermost/versions/10/pvc.yaml | 23 ++++++ mattermost/versions/10/service.yaml | 13 ++++ 10 files changed, 292 insertions(+) create mode 100644 mattermost/app.yaml create mode 100644 mattermost/versions/10/README.md create mode 100644 mattermost/versions/10/db-init-job.yaml create mode 100644 mattermost/versions/10/deployment.yaml create mode 100644 mattermost/versions/10/ingress.yaml create mode 100644 mattermost/versions/10/kustomization.yaml create mode 100644 mattermost/versions/10/manifest.yaml create mode 100644 mattermost/versions/10/namespace.yaml create mode 100644 mattermost/versions/10/pvc.yaml create mode 100644 mattermost/versions/10/service.yaml diff --git a/mattermost/app.yaml b/mattermost/app.yaml new file mode 100644 index 0000000..b6a27fe --- /dev/null +++ b/mattermost/app.yaml @@ -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" diff --git a/mattermost/versions/10/README.md b/mattermost/versions/10/README.md new file mode 100644 index 0000000..44d3bff --- /dev/null +++ b/mattermost/versions/10/README.md @@ -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) diff --git a/mattermost/versions/10/db-init-job.yaml b/mattermost/versions/10/db-init-job.yaml new file mode 100644 index 0000000..788bfaf --- /dev/null +++ b/mattermost/versions/10/db-init-job.yaml @@ -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" diff --git a/mattermost/versions/10/deployment.yaml b/mattermost/versions/10/deployment.yaml new file mode 100644 index 0000000..8970590 --- /dev/null +++ b/mattermost/versions/10/deployment.yaml @@ -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 diff --git a/mattermost/versions/10/ingress.yaml b/mattermost/versions/10/ingress.yaml new file mode 100644 index 0000000..37c0c33 --- /dev/null +++ b/mattermost/versions/10/ingress.yaml @@ -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 }} diff --git a/mattermost/versions/10/kustomization.yaml b/mattermost/versions/10/kustomization.yaml new file mode 100644 index 0000000..9e8d469 --- /dev/null +++ b/mattermost/versions/10/kustomization.yaml @@ -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 diff --git a/mattermost/versions/10/manifest.yaml b/mattermost/versions/10/manifest.yaml new file mode 100644 index 0000000..84bb890 --- /dev/null +++ b/mattermost/versions/10/manifest.yaml @@ -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 diff --git a/mattermost/versions/10/namespace.yaml b/mattermost/versions/10/namespace.yaml new file mode 100644 index 0000000..a7d5012 --- /dev/null +++ b/mattermost/versions/10/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: mattermost diff --git a/mattermost/versions/10/pvc.yaml b/mattermost/versions/10/pvc.yaml new file mode 100644 index 0000000..fad8ddb --- /dev/null +++ b/mattermost/versions/10/pvc.yaml @@ -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 diff --git a/mattermost/versions/10/service.yaml b/mattermost/versions/10/service.yaml new file mode 100644 index 0000000..29d609c --- /dev/null +++ b/mattermost/versions/10/service.yaml @@ -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