diff --git a/README.md b/README.md index 4caaa2f8..6da0bf76 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,11 @@ To use IRSA make sure to NOT set the two key variables and add the appropriate r value: "arn:aws:iam::123456789:role/mattermost-role" ``` +### Monitoring + +> [!IMPORTANT] +> Mattermost supports emitting metrics to feed into Prometheus, but _only_ if you have a license. This package configures the necessary service monitor to enable metrics, but only when a license has been provided via the `MM_LICENSE` var. By default (no license), it does not provision the Service Monitor as it will show unhealthy because metrics is not enabled via the license. + ## Flavors | Flavor | Description | Example Creation | diff --git a/chart/templates/uds-package.yaml b/chart/templates/uds-package.yaml index 95c65f9d..f5dfb029 100644 --- a/chart/templates/uds-package.yaml +++ b/chart/templates/uds-package.yaml @@ -45,12 +45,13 @@ spec: MM_EMAILSETTINGS_ENABLESIGNINWITHUSERNAME: "{{ .Values.sso.enable_sign_in_with_username | toString }}" {{- end }} monitor: + {{- if ne .Values.mattermostLicense "" }} - selector: app.kubernetes.io/name: mattermost-enterprise-edition targetPort: 8067 portName: mattermost-app-metrics description: Metrics - + {{- end }} network: expose: - service: mattermost-enterprise-edition diff --git a/chart/values.yaml b/chart/values.yaml index 6f8616b2..b7b6fcc5 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -26,7 +26,7 @@ postgres: cluster-name: pg-cluster namespace: postgres port: 5432 - +mattermostLicense: "" sso: enabled: true # Options: "gitlab", "openid_connect" diff --git a/values/config-values.yaml b/values/config-values.yaml index b1ccc429..e30788a8 100644 --- a/values/config-values.yaml +++ b/values/config-values.yaml @@ -6,3 +6,4 @@ postgres: password: "###ZARF_VAR_DB_PASSWORD###" subdomain: "###ZARF_VAR_SUBDOMAIN###" +mattermostLicense: "###ZARF_VAR_MM_LICENSE###" diff --git a/zarf.yaml b/zarf.yaml index 990b7bc8..088e53ec 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -19,6 +19,9 @@ variables: description: "Secret Key for S3 compatible storage" - name: DB_PASSWORD description: "Database Password for Mattermost" + - name: MM_LICENSE + description: "License for Mattermost" + default: "" components: - name: mattermost