diff --git a/k8s/helmfile/argo-cd.yaml b/k8s/helmfile/argo-cd.yaml index bc601555a..d6d87c6a0 100644 --- a/k8s/helmfile/argo-cd.yaml +++ b/k8s/helmfile/argo-cd.yaml @@ -18,8 +18,8 @@ releases: - name: argo-cd-base namespace: argocd chart: argo-cd/argo-cd - version: '{{ if eq .Environment.Name "production" }} 7.6.11 {{ else }} 9.1.9 {{ end }}' + version: '9.1.9' missingFileHandler: Error values: - - env/production/{{`{{ .Release.Name }}`}}.values.yaml.gotmpl - - env/{{`{{ .Environment.Name }}`}}/{{`{{ .Release.Name }}`}}.values.yaml.gotmpl + - env/production/{{`{{ .Release.Name }}`}}.values.yaml + - env/{{`{{ .Environment.Name }}`}}/{{`{{ .Release.Name }}`}}.values.yaml diff --git a/k8s/helmfile/env/local/argo-cd-base.values.yaml b/k8s/helmfile/env/local/argo-cd-base.values.yaml new file mode 100644 index 000000000..0e2163908 --- /dev/null +++ b/k8s/helmfile/env/local/argo-cd-base.values.yaml @@ -0,0 +1,57 @@ +configs: + params: + server.insecure: "true" + + cm: + admin.enabled: "true" + + ui.bannercontent: "LOCAL" + ui.bannerurl: "http://www.wbaas.dev/" + + styles: | + .ui-banner { + background-color:#6d7f8b; + + a { + color:white; + } + } + +global: + domain: argo.wbaas.dev + +certificate: + enabled: true + +server: + ingress: + enabled: true + ingressClassName: nginx + +notifications: + notifiers: + service.mattermost: | + apiURL: https://mattermost.wikimedia.de + token: $mattermost-token + secret: + create: false + + subscriptions: + - recipients: + - mattermost:3kk8aywgrjf4fmxfqkm6fusbcr + + templates: + template.app-sync-succeeded: | + mattermost: + attachments: '[{"title":"{{.app.status.sync.status}} {{.app.metadata.name}} on {{.app.spec.project}}","title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}","color":"#18be52","fields":[{"title":"Timestamp","value":"{{.app.status.operationState.finishedAt}}","short":true},{"title":"Details","value":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .","short":true}]}]' + + triggers: + # trigger.on-deleted: | + # oncePer: app.status.sync.revision + # send: [app-deleted] + + trigger.on-sync-succeeded: | + - description: Application syncing has succeeded + send: + - app-sync-succeeded + when: "true" diff --git a/tf/env/local/secrets-argo.tf b/tf/env/local/secrets-argo.tf new file mode 100644 index 000000000..db3ba73f9 --- /dev/null +++ b/tf/env/local/secrets-argo.tf @@ -0,0 +1,11 @@ +resource "kubernetes_secret" "argo-notifications-secret" { + + metadata { + namespace = "argocd" + name = "argocd-notifications-secret" + } + + data = { + "mattermost-token" = var.mattermost_bot_token, + } +} diff --git a/tf/env/local/variables.tf b/tf/env/local/variables.tf index b36da7b52..f19c52c1b 100644 --- a/tf/env/local/variables.tf +++ b/tf/env/local/variables.tf @@ -39,3 +39,9 @@ variable "botstopper_image_pull_json_secret" { description = "String contents of a docker/config.json to pull the botstopper image generated using `kubectl create secret` as per the botstopper docs" sensitive = true } + +variable "mattermost_bot_token" { + type = string + description = "Base64 Encoding of a docker/config.json to pull the botstopper image" + sensitive = true +} \ No newline at end of file