Skip to content

Commit

Permalink
fix: make monitoring optional based on license (#108)
Browse files Browse the repository at this point in the history
## Description

make monitoring optional based on license due to licensing restrictions.

## Related Issue

Fixes #
#103

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [ ] Test, docs, adr added or updated as needed
- [ ] [Contributor Guide
Steps](https://github.com/defenseunicorns/uds-package-mattermost/blob/main/CONTRIBUTING.md#developer-workflow)
followed

---------

Co-authored-by: Wayne Starr <Racer159@users.noreply.github.com>
  • Loading branch information
zachariahmiller and Racer159 committed Jul 9, 2024
1 parent 2fdf0e6 commit 783c05e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
3 changes: 2 additions & 1 deletion chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ postgres:
cluster-name: pg-cluster
namespace: postgres
port: 5432

mattermostLicense: ""
sso:
enabled: true
# Options: "gitlab", "openid_connect"
Expand Down
1 change: 1 addition & 0 deletions values/config-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ postgres:
password: "###ZARF_VAR_DB_PASSWORD###"

subdomain: "###ZARF_VAR_SUBDOMAIN###"
mattermostLicense: "###ZARF_VAR_MM_LICENSE###"
3 changes: 3 additions & 0 deletions zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 783c05e

Please sign in to comment.