From 55abbc1d3de1e2db66d04a2c78aebbb495214921 Mon Sep 17 00:00:00 2001 From: Zachariah Miller Date: Mon, 8 Jul 2024 17:56:07 -0400 Subject: [PATCH 1/4] make monitoring optional based on license --- README.md | 4 ++++ chart/templates/uds-package.yaml | 3 ++- chart/values.yaml | 2 +- values/config-values.yaml | 1 + zarf.yaml | 3 +++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4caaa2f8..52075f76 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,10 @@ 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 + +Mattermost supports emitting metrics to Prometheus, but only if yo uhave 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..9d9ab13c 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###" \ No newline at end of file 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 From 53f0d2dc5c990ce92d1df1887848c21677b8d7cb Mon Sep 17 00:00:00 2001 From: zamaz <71521611+zachariahmiller@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:13:32 -0400 Subject: [PATCH 2/4] fix missing newline at end of file --- values/config-values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/values/config-values.yaml b/values/config-values.yaml index 9d9ab13c..e30788a8 100644 --- a/values/config-values.yaml +++ b/values/config-values.yaml @@ -6,4 +6,4 @@ postgres: password: "###ZARF_VAR_DB_PASSWORD###" subdomain: "###ZARF_VAR_SUBDOMAIN###" -mattermostLicense: "###ZARF_VAR_MM_LICENSE###" \ No newline at end of file +mattermostLicense: "###ZARF_VAR_MM_LICENSE###" From 618f3ade2f101765c0d189c686dea200afae4065 Mon Sep 17 00:00:00 2001 From: zamaz <71521611+zachariahmiller@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:19:09 -0400 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52075f76..c617fda8 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ To use IRSA make sure to NOT set the two key variables and add the appropriate r ### Monitoring -Mattermost supports emitting metrics to Prometheus, but only if yo uhave 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. +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 From 65983ff3045f284b4a641ac0d74c7496167c350d Mon Sep 17 00:00:00 2001 From: zamaz <71521611+zachariahmiller@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:36:16 -0400 Subject: [PATCH 4/4] Update README.md Co-authored-by: Wayne Starr --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c617fda8..6da0bf76 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,8 @@ To use IRSA make sure to NOT set the two key variables and add the appropriate r ### Monitoring -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. +> [!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