diff --git a/chart/templates/mattermost/operator/gitrepository.yaml b/chart/templates/mattermost/operator/gitrepository.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d9e0d121c3aa9d7b78177a6759e52b8ef85c6634 --- /dev/null +++ b/chart/templates/mattermost/operator/gitrepository.yaml @@ -0,0 +1,18 @@ +{{- if and (not .Values.offline) .Values.addons.mattermostoperator.enabled }} +apiVersion: source.toolkit.fluxcd.io/v1beta1 +kind: GitRepository +metadata: + name: mattermost-operator + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: mattermost-operator + app.kubernetes.io/component: "collaboration-tools" + {{- include "commonLabels" . | nindent 4}} +spec: + interval: {{ .Values.flux.interval }} + url: {{ .Values.addons.mattermostoperator.git.repo }} + ref: + {{- include "validRef" .Values.addons.mattermostoperator.git | nindent 4 }} + {{ include "gitIgnore" . }} + {{- include "gitCreds" . | nindent 2 }} +{{- end }} diff --git a/chart/templates/mattermost/operator/mattermost-operator-helmrelease.yaml b/chart/templates/mattermost/operator/mattermost-operator-helmrelease.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a2d66de6752f9678cdc6031f523d0a481840c05 --- /dev/null +++ b/chart/templates/mattermost/operator/mattermost-operator-helmrelease.yaml @@ -0,0 +1,47 @@ +{{- if .Values.addons.mattermostoperator.enabled }} +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: mattermost-operator + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: mattermost-operator + app.kubernetes.io/component: "collaboration-tools" + {{- include "commonLabels" . | nindent 4}} +spec: + targetNamespace: mattermost-operator + chart: + spec: + chart: {{ .Values.addons.mattermostoperator.git.path }} + interval: 5m + sourceRef: + kind: GitRepository + name: mattermost-operator + namespace: {{ .Release.Namespace }} + + {{- with .Values.flux }} + interval: {{ .interval }} + test: + enable: false + install: + remediation: + retries: {{ .install.retries }} + upgrade: + remediation: + retries: {{ .upgrade.retries }} + remediateLastFailure: true + cleanupOnFail: true + rollback: + timeout: {{ .rollback.timeout }} + cleanupOnFail: {{ .rollback.cleanupOnFail }} + {{- end }} + + valuesFrom: + - name: values + kind: Secret + valuesKey: "mattermostoperator.yaml" + + values: + imagePullSecrets: + - name: private-registry +{{- end }} diff --git a/chart/templates/mattermost/operator/namespace.yaml b/chart/templates/mattermost/operator/namespace.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c8fa0cda83d9b9657f690a2180148e090ce32e1d --- /dev/null +++ b/chart/templates/mattermost/operator/namespace.yaml @@ -0,0 +1,26 @@ +{{- if .Values.addons.mattermostoperator.enabled }} +apiVersion: v1 +kind: Namespace +metadata: + name: mattermost-operator + labels: + istio-injection: enabled + app.kubernetes.io/name: mattermost-operator + app.kubernetes.io/component: "collaboration-tools" + {{- include "commonLabels" . | nindent 4}} +{{- if ( include "imagePullSecret" . ) }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: private-registry + namespace: mattermost-operator + labels: + app.kubernetes.io/name: mattermost-operator + app.kubernetes.io/component: "collaboration-tools" + {{- include "commonLabels" . | nindent 4}} +type: kubernetes.io/dockerconfigjson +data: + .dockerconfigjson: {{ template "imagePullSecret" . }} +{{- end }} +{{- end }} diff --git a/chart/templates/values.yaml b/chart/templates/values.yaml index 6cad3d7a9d0fa00fa5b170fb5b9323d0f8fc418e..9a897291f19082d686678e71e87b927f61b480cd 100644 --- a/chart/templates/values.yaml +++ b/chart/templates/values.yaml @@ -59,4 +59,6 @@ stringData: {{ toYaml .Values.addons.anchore.values | indent 4 }} sonarqube.yaml: | {{ toYaml .Values.addons.sonarqube.values | indent 4 }} + mattermostoperator.yaml: | +{{ toYaml .Values.addons.mattermostoperator.values | indent 4 }} data: diff --git a/chart/values.yaml b/chart/values.yaml index 94c4f19fc2bf5113190a1bfc3053eafe8ab179a5..4ef9a91f7fe55e34fc088f5a397d126761b44e78 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -554,3 +554,18 @@ addons: # -- Values to passthrough to the anchore chart: https://repo1.dso.mil/platform-one/big-bang/apps/security-tools/anchore-enterprise.git values: {} + + # ---------------------------------------------------------------------------------------------------------------------- + # Mattermost Operator + # + mattermostoperator: + enabled: false + git: + repo: https://repo1.dso.mil/platform-one/big-bang/apps/collaboration-tools/mattermost-operator.git + path: "./chart" + tag: "1.12.0-bb.0" + # -- Values to passthrough to the mattermost operator chart: https://repo1.dso.mil/platform-one/big-bang/apps/collaboration-tools/mattermost-operator/-/blob/main/chart/values.yaml + values: {} + # + # ---------------------------------------------------------------------------------------------------------------------- + # \ No newline at end of file diff --git a/scripts/deploy/02_wait_for_helmreleases.sh b/scripts/deploy/02_wait_for_helmreleases.sh index ad72debd60b9b3ccf35b02cc702dfc9c36bc59bf..63abe7c0b14fac505c19ce3918a2809ed3dc0723 100755 --- a/scripts/deploy/02_wait_for_helmreleases.sh +++ b/scripts/deploy/02_wait_for_helmreleases.sh @@ -3,7 +3,7 @@ set -ex ## This is an array to instantiate the order of wait conditions -ORDERED_HELMRELEASES="gatekeeper istio-operator istio monitoring eck-operator ek fluent-bit twistlock cluster-auditor authservice argocd gitlab haproxy-sso gitlab-runner minio-operator minio anchore sonarqube" +ORDERED_HELMRELEASES="gatekeeper istio-operator istio monitoring eck-operator ek fluent-bit twistlock cluster-auditor authservice argocd gitlab haproxy-sso gitlab-runner minio-operator minio anchore sonarqube mattermost-operator" ## This the actual deployed helmrelease objects in the cluster DEPLOYED_HELMRELEASES=$(kubectl get hr --no-headers -n bigbang | awk '{ print $1}') diff --git a/tests/ci/k3d/values.yaml b/tests/ci/k3d/values.yaml index a4fdcd0395d24538789762414f86632a17083a79..103a34ac93a02350c3b4b3aa58cd5c06aca475d5 100644 --- a/tests/ci/k3d/values.yaml +++ b/tests/ci/k3d/values.yaml @@ -71,3 +71,5 @@ addons: enabled: true sonarqube: enabled: true + mattermostoperator: + enabled: true