Skip to content

Commit

Permalink
wip: burning boats
Browse files Browse the repository at this point in the history
  • Loading branch information
mjnagel committed Jan 30, 2024
1 parent 6f20e86 commit 1bdd963
Show file tree
Hide file tree
Showing 21 changed files with 232 additions and 134 deletions.
4 changes: 2 additions & 2 deletions bundle/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ metadata:
packages:
- name: dev-minio
repository: ghcr.io/defenseunicorns/packages/uds/dev-minio
ref: 5.0.13-0
ref: 0.0.1

- name: dev-postgres
repository: ghcr.io/defenseunicorns/packages/uds/dev-postgres
ref: 12.6.6-0
ref: 0.0.1

- name: dev-secrets
path: ../
Expand Down
3 changes: 0 additions & 3 deletions bundle/uds-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,3 @@ variables:
dev-postgres:
db_username: "mattermost"
db_name: "mattermostdb"
mattermost:
mattermost_file_store_endpoint: minio.dev-minio.svc.cluster.local
mattermost_bucket_suffix: "-dev"
18 changes: 18 additions & 0 deletions chart/templates/mattermost-gossip-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- /* Mattermost uses a gossip protocol for HA clustering. In order for Istio to properly route this traffic it needs to be explicitly defined in a service with a `tcp-` prefix. */ -}}
apiVersion: v1
kind: Service
metadata:
name: mattermost-gossip
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: mattermost-enterprise-edition
spec:
type: ClusterIP
clusterIP: None
selector:
app.kubernetes.io/name: mattermost-enterprise-edition
ports:
- name: tcp-gossip
port: 8074
protocol: TCP
targetPort: 8074
17 changes: 17 additions & 0 deletions chart/templates/mattermost-sso.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Secret
metadata:
name: mattermost-sso
namespace: {{ .Release.Namespace }}
labels:
type: Opaque
stringData:
MM_GITLABSETTINGS_ENABLE: "{{ .Values.sso.enabled }}"
MM_GITLABSETTINGS_ID: "{{ .Values.sso.client_id }}"
MM_GITLABSETTINGS_SECRET: "{{ .Values.sso.client_secret }}"
MM_GITLABSETTINGS_AUTHENDPOINT: "{{ .Values.sso.auth_endpoint }}"
MM_GITLABSETTINGS_TOKENENDPOINT: "{{ .Values.sso.token_endpoint }}"
MM_GITLABSETTINGS_USERAPIENDPOINT: "{{ .Values.sso.user_api_endpoint }}"
MM_EMAILSETTINGS_ENABLESIGNUPWITHEMAIL: "{{ .Values.sso.enable_sign_up_with_email }}"
MM_EMAILSETTINGS_ENABLESIGNINWITHEMAIL: "{{ .Values.sso.enable_sign_in_with_email }}"
MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME: "{{ .Values.sso.enable_sign_in_with_username }}"
13 changes: 10 additions & 3 deletions chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@ metadata:
spec:
network:
expose:
- service: mattermost
- service: mattermost-enterprise-edition
podLabels:
app: mattermost
app.kubernetes.io/name: mattermost-enterprise-edition
gateway: tenant
host: mattermost
port: 8065
allow:
# Permit intra-namespace communication for job communications
- direction: Ingress
remoteGenerated: IntraNamespace

- direction: Egress
remoteGenerated: IntraNamespace

# Todo: wide open for hitting in-cluster or external postgres/s3
- direction: Egress
podLabels:
app: mattermost
app.kubernetes.io/name: mattermost-enterprise-edition
remoteGenerated: Anywhere
10 changes: 10 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sso:
enabled: false
client_id: ""
client_secret: ""
auth_endpoint: ""
token_endpoint: ""
user_api_endpoint: ""
enable_sign_up_with_email: ""
enable_sign_in_with_email: ""
enable_sign_in_with_username: ""
7 changes: 5 additions & 2 deletions src/dev-secrets/minio-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ metadata:
namespace: mattermost
type: kubernetes.io/opaque
stringData:
accesskey: ###ZARF_VAR_ACCESS_KEY###
secretkey: ###ZARF_VAR_SECRET_KEY###
MM_FILESETTINGS_AMAZONS3SSL: "false"
MM_FILESETTINGS_AMAZONS3ACCESSKEYID: ###ZARF_VAR_ACCESS_KEY###
MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY: ###ZARF_VAR_SECRET_KEY###
MM_FILESETTINGS_AMAZONS3BUCKET: "uds-mattermost-dev"
MM_FILESETTINGS_AMAZONS3ENDPOINT: "minio.dev-minio.svc.cluster.local:9000"
1 change: 0 additions & 1 deletion src/dev-secrets/postgres-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ metadata:
namespace: mattermost
type: kubernetes.io/opaque
stringData:
DB_CONNECTION_CHECK_URL: "postgres://mattermost:###ZARF_VAR_POSTGRES_DB_PASSWORD###@postgresql.dev-postgres.svc.cluster.local:5432/mattermostdb?connect_timeout=10&sslmode=disable"
DB_CONNECTION_STRING: "postgres://mattermost:###ZARF_VAR_POSTGRES_DB_PASSWORD###@postgresql.dev-postgres.svc.cluster.local:5432/mattermostdb?connect_timeout=10&sslmode=disable"
6 changes: 6 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ includes:
- test: ./tasks/test.yaml

tasks:
- name: default
actions:
- task: setup-cluster
- task: create-test-bundle
- task: deploy-test-bundle

- name: setup-cluster
actions:
- task: setup:k3d-test-cluster
Expand Down
6 changes: 5 additions & 1 deletion tasks/create.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
variables:
- name: FLAVOR
default: "registry1"

tasks:
- name: mattermost-test-bundle
description: Create the UDS bundle with Mattermost and its dependencies
Expand All @@ -9,7 +13,7 @@ tasks:
- name: mattermost-package
description: Create the UDS Mattermost Zarf Package
actions:
- cmd: zarf package create --confirm --no-progress --architecture=${ZARF_ARCHITECTURE} --flavor registry1
- cmd: zarf package create --confirm --no-progress --architecture=${ZARF_ARCHITECTURE} --flavor ${FLAVOR}

- name: dependency-package
description: Create the Minio, PostgreSQL, and Redis Dependency Zarf Packages
Expand Down
2 changes: 1 addition & 1 deletion tasks/setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ tasks:
- name: k3d-test-cluster
actions:
- description: Create k3d cluster with UDS Core
cmd: uds deploy oci://defenseunicorns/uds/bundles/k3d-core-istio:0.7.0-${UDS_ARCH} --confirm --no-progress
cmd: uds deploy oci://defenseunicorns/uds/bundles/k3d-core-istio-dev:0.10.0-${UDS_ARCH} --confirm --no-progress
10 changes: 10 additions & 0 deletions values/config-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sso:
enabled: ###ZARF_VAR_MATTERMOST_SSO_ENABLED###
client_id: ###ZARF_VAR_MATTERMOST_SSO_CLIENT_ID###
client_secret: ###ZARF_VAR_MATTERMOST_SSO_CLIENT_SECRET###
auth_endpoint: ###ZARF_VAR_MATTERMOST_SSO_AUTH_ENDPOINT###
token_endpoint: ###ZARF_VAR_MATTERMOST_SSO_TOKEN_ENDPOINT###
user_api_endpoint: ###ZARF_VAR_MATTERMOST_SSO_USER_API_ENDPOINT###
enable_sign_up_with_email: ###ZARF_VAR_MATTERMOST_SSO_EMAIL_SIGNUP_ENABLED###
enable_sign_in_with_email: ###ZARF_VAR_MATTERMOST_SSO_EMAIL_SIGNIN_ENABLED###
enable_sign_in_with_username: ###ZARF_VAR_MATTERMOST_SSO_USERNAME_SIGNIN_ENABLED###
Empty file removed values/mattermost-ce.yaml
Empty file.
Empty file.
7 changes: 0 additions & 7 deletions values/mattermost-operator-values.yaml

This file was deleted.

Empty file removed values/mattermost-upstream.yaml
Empty file.
62 changes: 0 additions & 62 deletions values/mattermost-values.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions values/registry1-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mattermostApp:
image:
repository: registry1.dso.mil/ironbank/opensource/mattermost/mattermost
tag: 9.4.1
initContainerImage:
repository: registry1.dso.mil/ironbank/redhat/ubi/ubi9-minimal
tag: 9.3
4 changes: 4 additions & 0 deletions values/upstream-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mattermostApp:
image:
repository: mattermost/mattermost-enterprise-edition
tag: 9.4.1
107 changes: 107 additions & 0 deletions values/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
minio:
enabled: false
mysqlha:
enabled: false
mattermostApp:
# Default replicacount due to HA requiring a license
replicaCount: 1
# Mattermost does not provide helm values to configure all the options so it is done via ENV
extraEnv:
# SSO Settings
- name: MM_GITLABSETTINGS_ENABLE
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_ENABLE
name: "mattermost-sso"
- name: MM_GITLABSETTINGS_ID
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_ID
name: "mattermost-sso"
- name: MM_GITLABSETTINGS_SECRET
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_SECRET
name: "mattermost-sso"
- name: MM_GITLABSETTINGS_AUTHENDPOINT
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_AUTHENDPOINT
name: "mattermost-sso"
- name: MM_GITLABSETTINGS_TOKENENDPOINT
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_TOKENENDPOINT
name: "mattermost-sso"
- name: MM_GITLABSETTINGS_USERAPIENDPOINT
valueFrom:
secretKeyRef:
key: MM_GITLABSETTINGS_USERAPIENDPOINT
name: "mattermost-sso"
- name: MM_EMAILSETTINGS_ENABLESIGNUPWITHEMAIL
valueFrom:
secretKeyRef:
key: MM_EMAILSETTINGS_ENABLESIGNUPWITHEMAIL
name: "mattermost-sso"
- name: MM_EMAILSETTINGS_ENABLESIGNINWITHEMAIL
valueFrom:
secretKeyRef:
key: MM_EMAILSETTINGS_ENABLESIGNINWITHEMAIL
name: "mattermost-sso"
- name: MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME
valueFrom:
secretKeyRef:
key: MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME
name: "mattermost-sso"
# Object Storage Connection
- name: MM_FILESETTINGS_DRIVERNAME
value: "amazons3"
- name: MM_FILESETTINGS_AMAZONS3SSL
valueFrom:
secretKeyRef:
key: MM_FILESETTINGS_AMAZONS3SSL
name: "mattermost-object-store"
- name: MM_FILESETTINGS_AMAZONS3ACCESSKEYID
valueFrom:
secretKeyRef:
key: MM_FILESETTINGS_AMAZONS3ACCESSKEYID
name: "mattermost-object-store"
- name: MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY
valueFrom:
secretKeyRef:
key: MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY
name: "mattermost-object-store"
- name: MM_FILESETTINGS_AMAZONS3BUCKET
valueFrom:
secretKeyRef:
key: MM_FILESETTINGS_AMAZONS3BUCKET
name: "mattermost-object-store"
- name: MM_FILESETTINGS_AMAZONS3ENDPOINT
valueFrom:
secretKeyRef:
key: MM_FILESETTINGS_AMAZONS3ENDPOINT
name: "mattermost-object-store"
securityContext:
runAsUser: 2000
runAsGroup: 2000

serviceAccount:
create: true
name: mattermost
annotations: {} # Add IRSA annotation here if necessary in environment

global:
siteUrl: "https://mattermost.###ZARF_VAR_DOMAIN###"
mattermostLicense: "###ZARF_VAR_MATTERMOST_ENTERPRISE_LICENSE###"

features:
database:
useInternal: false
existingDatabaseSecret:
name: mattermost-postgres
key: DB_CONNECTION_STRING
# The job server is only necessary on multi-node/enterprise clusters
# https://docs.mattermost.com/scale/high-availability-cluster.html#job-server
# It also will error due to its init container being blocked by Istio mTLS
jobserver:
enabled: false
Loading

0 comments on commit 1bdd963

Please sign in to comment.