From 8e00437e07c7acd1462c2d1d28d1ac35a786bb75 Mon Sep 17 00:00:00 2001 From: Antoine Dao Date: Mon, 8 Jun 2020 22:09:40 +0100 Subject: [PATCH 01/10] fix: add pod and workflow workers to argo helm values (#364) --- charts/argo/Chart.yaml | 2 +- charts/argo/templates/workflow-controller-deployment.yaml | 8 ++++++++ charts/argo/values.yaml | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index c75eaaf1..f79367d2 100644 --- a/charts/argo/Chart.yaml +++ b/charts/argo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v2.8.0 description: A Helm chart for Argo Workflows name: argo -version: 0.9.4 +version: 0.9.5 icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm maintainers: diff --git a/charts/argo/templates/workflow-controller-deployment.yaml b/charts/argo/templates/workflow-controller-deployment.yaml index 2b8b1dbd..852bad52 100644 --- a/charts/argo/templates/workflow-controller-deployment.yaml +++ b/charts/argo/templates/workflow-controller-deployment.yaml @@ -43,6 +43,14 @@ spec: {{- if .Values.singleNamespace }} - "--namespaced" {{- end }} + {{- with .Values.controller.workflowWorkers }} + - "--workflow-workers" + - {{ . | quote }} + {{- end }} + {{- if .Values.controller.podWorkers }} + - "--pod-workers" + - {{ . | quote }} + {{- end }} env: - name: ARGO_NAMESPACE valueFrom: diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index 8f8e825d..a5492cb6 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -57,6 +57,8 @@ controller: # spec: # ttlStrategy: # secondsAfterCompletion: 84600 + # workflowWorkers: 32 + # podWorkers: 32 telemetryConfig: enabled: false path: /telemetry From ea4ba2283cceb1603134f8aebd99bd43e36a3ed8 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Tue, 9 Jun 2020 14:33:29 -0400 Subject: [PATCH 02/10] feat: Helm chart contribution for argocd-notifications (#365) * Helm chart contribution for argocd-notifications The following chart is a contribution from work done at https://github.com/Bandwidth/ to facilitate installing https://github.com/argoproj-labs/argocd-notifications via Helm chart based on https://github.com/argoproj-labs/argocd-notifications/blob/master/manifests/install.yaml --- CODEOWNERS | 9 +- CONTRIBUTING.md | 10 ++ charts/argocd-notifications/.helmignore | 22 ++++ charts/argocd-notifications/Chart.yaml | 14 ++ charts/argocd-notifications/README.md | 9 ++ .../templates/_helpers.tpl | 63 +++++++++ .../templates/configmap.yaml | 16 +++ .../templates/deployment.yaml | 43 ++++++ .../argocd-notifications/templates/role.yaml | 27 ++++ .../templates/rolebinding.yaml | 13 ++ .../templates/secret.yaml | 16 +++ .../templates/serviceaccount.yaml | 6 + charts/argocd-notifications/values.yaml | 124 ++++++++++++++++++ 13 files changed, 369 insertions(+), 3 deletions(-) create mode 100644 charts/argocd-notifications/.helmignore create mode 100644 charts/argocd-notifications/Chart.yaml create mode 100644 charts/argocd-notifications/README.md create mode 100644 charts/argocd-notifications/templates/_helpers.tpl create mode 100644 charts/argocd-notifications/templates/configmap.yaml create mode 100644 charts/argocd-notifications/templates/deployment.yaml create mode 100644 charts/argocd-notifications/templates/role.yaml create mode 100644 charts/argocd-notifications/templates/rolebinding.yaml create mode 100644 charts/argocd-notifications/templates/secret.yaml create mode 100644 charts/argocd-notifications/templates/serviceaccount.yaml create mode 100644 charts/argocd-notifications/values.yaml diff --git a/CODEOWNERS b/CODEOWNERS index 7de4e9c4..3fa1142c 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,13 +1,16 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners +# Argo Workflows +/charts/argo @benjaminws @stefansedich @paguos + # Argo CD /charts/argo-cd @seanson @spencergilbert # Argo Events /charts/argo-events @jbehling -# Argo Workflows -/charts/argo @benjaminws @stefansedich @paguos - # Argo Rollouts /charts/argo-rollouts @cabrinha + +# Argo CD Notifications +/charts/argocd-notifications @alexmt @andyfeller diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ba764f3c..72303016 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,6 +51,16 @@ argocd app create guestbook --dest-namespace default --dest-server https://kuber argocd app sync guestbook ``` +## Testing Argo CD Notification Changes + +Thorough testing of argocd-notifications would require one or more notification services (Slack, OpsGenie, etc), however +minimal testing mostly consists of successful Helm chart installation and the argocd-notifications controller having +access to the `Application` resources in the same namespace that Argo CD is installed. + +``` +helm install argocd-notifications charts/argocd-notifications --namespace argocd +``` + ## New Application Versions When raising application versions ensure you make the following changes: diff --git a/charts/argocd-notifications/.helmignore b/charts/argocd-notifications/.helmignore new file mode 100644 index 00000000..50af0317 --- /dev/null +++ b/charts/argocd-notifications/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml new file mode 100644 index 00000000..0700ce4c --- /dev/null +++ b/charts/argocd-notifications/Chart.yaml @@ -0,0 +1,14 @@ +apiVersion: v2 +appVersion: 0.7.0 +description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. +name: argocd-notifications +type: application +version: 1.0.0 +home: https://github.com/argoproj/argo-helm +icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png +keywords: + - argoproj + - argocd + - argocd-notifications +maintainers: + - name: alexmt diff --git a/charts/argocd-notifications/README.md b/charts/argocd-notifications/README.md new file mode 100644 index 00000000..61e1d363 --- /dev/null +++ b/charts/argocd-notifications/README.md @@ -0,0 +1,9 @@ +## ArgoCD Notifications Chart + +This is a **community maintained** chart. It installs the [argocd-notifications](https://github.com/argoproj-labs/argocd-notifications) application. This application comes packaged with: +- Notifications Controller Deployment +- Notifications Controller ConfigMap +- Notifications Controller Secret +- Service Account +- Roles +- Role Bindings diff --git a/charts/argocd-notifications/templates/_helpers.tpl b/charts/argocd-notifications/templates/_helpers.tpl new file mode 100644 index 00000000..bbe07b54 --- /dev/null +++ b/charts/argocd-notifications/templates/_helpers.tpl @@ -0,0 +1,63 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "argocd-notifications.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "argocd-notifications.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "argocd-notifications.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Common labels +*/}} +{{- define "argocd-notifications.labels" -}} +helm.sh/chart: {{ include "argocd-notifications.chart" . }} +{{ include "argocd-notifications.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "argocd-notifications.selectorLabels" -}} +app.kubernetes.io/name: {{ include "argocd-notifications.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + +{{/* +Create the name of the service account to use +*/}} +{{- define "argocd-notifications.serviceAccountName" -}} +{{- if .Values.serviceAccount.create -}} + {{ default (include "argocd-notifications.fullname" .) .Values.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/argocd-notifications/templates/configmap.yaml b/charts/argocd-notifications/templates/configmap.yaml new file mode 100644 index 00000000..757d8475 --- /dev/null +++ b/charts/argocd-notifications/templates/configmap.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "argocd-notifications.name" . }}-cm + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} +data: + config.yaml: | + context: + argocdUrl: {{ .Values.argocdUrl | quote }} + subscriptions: + {{- toYaml .Values.subscriptions | nindent 6 }} + templates: + {{- toYaml .Values.templates | nindent 6 }} + triggers: + {{- toYaml .Values.triggers | nindent 6 }} diff --git a/charts/argocd-notifications/templates/deployment.yaml b/charts/argocd-notifications/templates/deployment.yaml new file mode 100644 index 00000000..7a2b3efb --- /dev/null +++ b/charts/argocd-notifications/templates/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "argocd-notifications.name" . }}-controller + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} +spec: + selector: + matchLabels: + {{- include "argocd-notifications.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "argocd-notifications.selectorLabels" . | nindent 8 }} + spec: + strategy: + type: Recreate + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "argocd-notifications.serviceAccountName" . }} + containers: + - name: {{ include "argocd-notifications.name" . }}-controller + image: "{{ .Values.image.repository }}:{{ .Values.image.tag}}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + command: + - /app/argocd-notifications + - controller + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/argocd-notifications/templates/role.yaml b/charts/argocd-notifications/templates/role.yaml new file mode 100644 index 00000000..fcd99ef6 --- /dev/null +++ b/charts/argocd-notifications/templates/role.yaml @@ -0,0 +1,27 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "argocd-notifications.name" . }}-controller + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} +rules: +- apiGroups: + - argoproj.io + resources: + - applications + - appprojects + verbs: + - get + - list + - watch + - update + - patch +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - watch diff --git a/charts/argocd-notifications/templates/rolebinding.yaml b/charts/argocd-notifications/templates/rolebinding.yaml new file mode 100644 index 00000000..d3be3f9d --- /dev/null +++ b/charts/argocd-notifications/templates/rolebinding.yaml @@ -0,0 +1,13 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "argocd-notifications.name" . }}-controller + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "argocd-notifications.name" . }}-controller +subjects: +- kind: ServiceAccount + name: {{ include "argocd-notifications.serviceAccountName" . }} diff --git a/charts/argocd-notifications/templates/secret.yaml b/charts/argocd-notifications/templates/secret.yaml new file mode 100644 index 00000000..26612dfa --- /dev/null +++ b/charts/argocd-notifications/templates/secret.yaml @@ -0,0 +1,16 @@ +{{ if .Values.secret.create }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "argocd-notifications.name" . }}-secret + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} +type: Opaque +stringData: + notifiers.yaml: | +{{- if .Values.secret.notifiers.slack.enabled }} + slack: + token: {{ .Values.secret.notifiers.slack.token }} + username: {{ .Values.secret.notifiers.slack.username }} +{{- end }} +{{ end }} diff --git a/charts/argocd-notifications/templates/serviceaccount.yaml b/charts/argocd-notifications/templates/serviceaccount.yaml new file mode 100644 index 00000000..5181c5a4 --- /dev/null +++ b/charts/argocd-notifications/templates/serviceaccount.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "argocd-notifications.serviceAccountName" . }} + labels: + {{- include "argocd-notifications.labels" . | nindent 4 }} diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml new file mode 100644 index 00000000..362156df --- /dev/null +++ b/charts/argocd-notifications/values.yaml @@ -0,0 +1,124 @@ +affinity: {} + +# ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates +argocdUrl: + +fullnameOverride: "" + +image: + repository: argoprojlabs/argocd-notifications + tag: v0.7.0 + pullPolicy: IfNotPresent + +imagePullSecrets: [] + +nameOverride: "argocd-notifications" + +nodeSelector: {} + +secret: + # Whether helm chart creates controller secret + create: true + + notifiers: + # For more information: https://argoproj-labs.github.io/argocd-notifications/services/overview/ + + slack: + # For more information: https://argoproj-labs.github.io/argocd-notifications/services/slack/ + + # Specifies whether Slack notifier should be configured + enabled: false + # OAuth Access Token + token: + # Optional override username + username: + +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +serviceAccount: + # Specifies whether a service account should be created + create: true + + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: argocd-notifications-controller + +subscriptions: [] + # Assignment of recipients by notification channel to triggers in several forms: + # + # global subscription for all type of notifications + # - recipients: + # - slack:test1 + # - webhook:github + # + # subscription for on-sync-status-unknown trigger notifications + # - recipients: + # - slack:test2 + # - email:test@gmail.com + # trigger: on-sync-status-unknown + # + # global subscription restricted to applications with matching labels only + # - recipients: + # - slack:test3 + # selector: test=true + # + # For more information: https://argoproj-labs.github.io/argocd-notifications/triggers_and_templates/ + +templates: [] + # The notification template is used to generate the notification content. The template is leveraging html/template + # golang package and allow to define notification title and body. The template is meant to be reusable and can be + # referenced by multiple triggers. + # + # Add your custom template + # - name: my-custom-template + # title: Hello {{.app.metadata.name}} + # body: | + # Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}. + # + # Override one field in built-in template + # - name: on-sync-succeeded + # title: Application {{.app.metadata.name}} sync status is {{.app.status.sync.status}} + # + # For more information: https://argoproj-labs.github.io/argocd-notifications/triggers_and_templates/ + +tolerations: [] + +triggers: + # The condition when the notification should be sent. The definition includes name, condition and notification template reference. + # + # Enable built-in triggers: + # + # Application has degraded + # - name: on-health-degraded + # enabled: true + # + # Application syncing has failed + # - name: on-sync-failed + # enabled: true + # + # Application is being synced + # - name: on-sync-running + # enabled: true + # + # Application status is 'Unknown' + # - name: on-sync-status-unknown + # enabled: true + # + # Application syncing has succeeded + # - name: on-sync-succeeded + # enabled: true + # + # + # Or define your custom triggers: + # + # - name: my-custom-trigger + # condition: app.status.sync.status == 'Unknown' + # template: my-custom-template + # + # For more information: https://argoproj-labs.github.io/argocd-notifications/triggers_and_templates/ From 249a79f4c8f41e9db36627fdd1890b4b8e3d5d0f Mon Sep 17 00:00:00 2001 From: Albert Dixon Date: Fri, 12 Jun 2020 11:48:57 -0700 Subject: [PATCH 03/10] fix: ArgoCD Notifications - Deployment manifest udpateStrategy (#372) fix: ArgoCD Notifications - Deployment manifest udpateStrategy (#372) --- charts/argocd-notifications/Chart.yaml | 2 +- charts/argocd-notifications/templates/deployment.yaml | 4 ++-- charts/argocd-notifications/values.yaml | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index 0700ce4c..b03c0b38 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.7.0 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.0 +version: 1.0.1 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argocd-notifications/templates/deployment.yaml b/charts/argocd-notifications/templates/deployment.yaml index 7a2b3efb..14fd9f48 100644 --- a/charts/argocd-notifications/templates/deployment.yaml +++ b/charts/argocd-notifications/templates/deployment.yaml @@ -5,6 +5,8 @@ metadata: labels: {{- include "argocd-notifications.labels" . | nindent 4 }} spec: + strategy: + {{- .Values.updateStrategy | toYaml | nindent 4 }} selector: matchLabels: {{- include "argocd-notifications.selectorLabels" . | nindent 6 }} @@ -13,8 +15,6 @@ spec: labels: {{- include "argocd-notifications.selectorLabels" . | nindent 8 }} spec: - strategy: - type: Recreate {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index 362156df..993b75bb 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -16,6 +16,9 @@ nameOverride: "argocd-notifications" nodeSelector: {} +updateStrategy: + type: Recreate + secret: # Whether helm chart creates controller secret create: true From 30d53378cf2a060e5539d4122371d0226c323e88 Mon Sep 17 00:00:00 2001 From: Andy Feller Date: Fri, 12 Jun 2020 15:44:32 -0400 Subject: [PATCH 04/10] docs: Adding argocd-notifications maintainer (#370) * Adding argocd-notifications maintainer * Bumping version --- charts/argocd-notifications/Chart.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index b03c0b38..02d935de 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.7.0 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.1 +version: 1.0.2 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: @@ -12,3 +12,4 @@ keywords: - argocd-notifications maintainers: - name: alexmt + - name: andyfeller From aaeca8e124ada725b4d744aaada4f8ed392576dd Mon Sep 17 00:00:00 2001 From: Yann Soubeyrand Date: Thu, 18 Jun 2020 01:37:46 +0200 Subject: [PATCH 05/10] fix: remove Argo CD server route status field (#362) Status fields prevent resources from converging. --- charts/argo-cd/Chart.yaml | 2 +- charts/argo-cd/templates/argocd-server/route.yaml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index b34759a5..af39aec8 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.5.4" description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 2.3.5 +version: 2.3.6 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-server/route.yaml b/charts/argo-cd/templates/argocd-server/route.yaml index 775a0a2f..7a7f3618 100644 --- a/charts/argo-cd/templates/argocd-server/route.yaml +++ b/charts/argo-cd/templates/argocd-server/route.yaml @@ -26,6 +26,4 @@ spec: termination: {{ .Values.server.route.termination_type | default "passthrough" }} insecureEdgeTerminationPolicy: {{ .Values.server.route.termination_policy | default "None" }} wildcardPolicy: None -status: - ingress: [] {{- end }} From c4e4d1439bba7fe1caf678ed489cee0ee1713b5f Mon Sep 17 00:00:00 2001 From: Wolfgang Nagele Date: Thu, 18 Jun 2020 21:36:53 +0200 Subject: [PATCH 06/10] Indent error (#369) --- charts/argo/Chart.yaml | 2 +- charts/argo/templates/workflow-controller-config-map.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index f79367d2..022e953d 100644 --- a/charts/argo/Chart.yaml +++ b/charts/argo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v2.8.0 description: A Helm chart for Argo Workflows name: argo -version: 0.9.5 +version: 0.9.6 icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm maintainers: diff --git a/charts/argo/templates/workflow-controller-config-map.yaml b/charts/argo/templates/workflow-controller-config-map.yaml index a5845681..38bcba23 100644 --- a/charts/argo/templates/workflow-controller-config-map.yaml +++ b/charts/argo/templates/workflow-controller-config-map.yaml @@ -25,8 +25,8 @@ data: env: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} + {{- if or .Values.minio.install .Values.useDefaultArtifactRepo }} artifactRepository: - {{- if or .Values.minio.install .Values.useDefaultArtifactRepo }} {{- if .Values.artifactRepository.archiveLogs }} archiveLogs: {{ .Values.artifactRepository.archiveLogs }} {{- end }} @@ -54,7 +54,7 @@ data: {{- if .Values.artifactRepository.s3.useSDKCreds }} useSDKCreds: {{ .Values.artifactRepository.s3.useSDKCreds }} {{- end }} - {{- end}} + {{- end}} {{- if .Values.controller.metricsConfig.enabled }} metricsConfig: {{ toYaml .Values.controller.metricsConfig | indent 6}}{{- end }} From f3bfd0f6fa766fa479b6c1fbc668819de0089429 Mon Sep 17 00:00:00 2001 From: Eric Hayes Date: Fri, 19 Jun 2020 15:25:11 -0700 Subject: [PATCH 07/10] Added support for webhook triggers. (#380) --- charts/argocd-notifications/Chart.yaml | 2 +- .../templates/secret.yaml | 7 +++++++ charts/argocd-notifications/values.yaml | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index 02d935de..cfbdfc6e 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.7.0 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.2 +version: 1.0.3 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argocd-notifications/templates/secret.yaml b/charts/argocd-notifications/templates/secret.yaml index 26612dfa..b631c78f 100644 --- a/charts/argocd-notifications/templates/secret.yaml +++ b/charts/argocd-notifications/templates/secret.yaml @@ -13,4 +13,11 @@ stringData: token: {{ .Values.secret.notifiers.slack.token }} username: {{ .Values.secret.notifiers.slack.username }} {{- end }} +{{- if .Values.secret.notifiers.webhooks }} + webhook: +{{- range $k, $v := .Values.secret.notifiers.webhooks }} + - name: {{ $k }} + {{- $v | toYaml | nindent 8 }} +{{- end }} +{{- end }} {{ end }} diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index 993b75bb..a05ee4c0 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -36,6 +36,25 @@ secret: # Optional override username username: + webhooks: {} + # For more information: https://argoproj-labs.github.io/argocd-notifications/services/webhook/ + # mywebhook: + # url: http://example.com + # headers: + # - name: headerName + # value: headerValue + # basicAuth: + # username: username + # password: mypassword + # mywebhook2: + # url: http://example.com + # headers: + # - name: headerName + # value: headerValue + # basicAuth: + # username: username + # password: mypassword + resources: {} # limits: # cpu: 100m From 0181f86f5fe1931c0b55ce4a22c6fadfda759199 Mon Sep 17 00:00:00 2001 From: Wolfgang Nagele Date: Mon, 22 Jun 2020 19:27:06 +0200 Subject: [PATCH 08/10] fix: Add support for SSO in Argo (#383) --- charts/argo/Chart.yaml | 2 +- charts/argo/templates/server-deployment.yaml | 8 ++++++++ charts/argo/templates/workflow-controller-config-map.yaml | 3 +++ charts/argo/values.yaml | 5 +++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index 022e953d..28e783dc 100644 --- a/charts/argo/Chart.yaml +++ b/charts/argo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v2.8.0 description: A Helm chart for Argo Workflows name: argo -version: 0.9.6 +version: 0.9.7 icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm maintainers: diff --git a/charts/argo/templates/server-deployment.yaml b/charts/argo/templates/server-deployment.yaml index 5f5ff726..52acbc79 100644 --- a/charts/argo/templates/server-deployment.yaml +++ b/charts/argo/templates/server-deployment.yaml @@ -63,6 +63,14 @@ spec: value: {{ .Values.server.baseHref | quote }} resources: {{- toYaml .Values.server.resources | nindent 12 }} + {{- with .Values.server.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12}} + {{- end }} + {{- with .Values.server.volumes }} + volumes: + {{- toYaml . | nindent 8}} + {{- end }} {{- with .Values.server.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/argo/templates/workflow-controller-config-map.yaml b/charts/argo/templates/workflow-controller-config-map.yaml index 38bcba23..b6d56e64 100644 --- a/charts/argo/templates/workflow-controller-config-map.yaml +++ b/charts/argo/templates/workflow-controller-config-map.yaml @@ -67,3 +67,6 @@ data: {{- if .Values.controller.workflowDefaults }} workflowDefaults: {{ toYaml .Values.controller.workflowDefaults | indent 6 }}{{- end }} + {{- with .Values.controller.sso }} + sso: +{{ toYaml . | indent 6 }}{{- end }} diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index a5492cb6..2525b7bd 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -54,6 +54,7 @@ controller: # name: argo-postgres-config # key: password workflowDefaults: {} # Only valid for 2.7+ + sso: {} # Only valid for 2.9+ # spec: # ttlStrategy: # secondsAfterCompletion: 84600 @@ -164,6 +165,10 @@ server: # Extra arguments to provide to the Argo server binary. extraArgs: [] + ## Additional volumes to the server main container. + volumeMounts: [] + volumes: [] + ## Ingress configuration. ## ref: https://kubernetes.io/docs/user-guide/ingress/ ## From 209d69558e1c9a9954b2cb378ee2665a8ea45ed8 Mon Sep 17 00:00:00 2001 From: Vlad Losev Date: Mon, 22 Jun 2020 10:44:50 -0700 Subject: [PATCH 09/10] feat(argo): Adds SSO configuration for Argo Server. (#381) --- charts/argo/Chart.yaml | 2 +- .../workflow-controller-config-map.yaml | 6 +++--- charts/argo/values.yaml | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index 28e783dc..de0c3833 100644 --- a/charts/argo/Chart.yaml +++ b/charts/argo/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: v2.8.0 description: A Helm chart for Argo Workflows name: argo -version: 0.9.7 +version: 0.9.8 icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png home: https://github.com/argoproj/argo-helm maintainers: diff --git a/charts/argo/templates/workflow-controller-config-map.yaml b/charts/argo/templates/workflow-controller-config-map.yaml index b6d56e64..5dde9ff3 100644 --- a/charts/argo/templates/workflow-controller-config-map.yaml +++ b/charts/argo/templates/workflow-controller-config-map.yaml @@ -67,6 +67,6 @@ data: {{- if .Values.controller.workflowDefaults }} workflowDefaults: {{ toYaml .Values.controller.workflowDefaults | indent 6 }}{{- end }} - {{- with .Values.controller.sso }} - sso: -{{ toYaml . | indent 6 }}{{- end }} + {{- with .Values.server.sso }} + sso: {{- toYaml . | nindent 6 }} + {{- end }} diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index 2525b7bd..0dc5dd47 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -54,7 +54,6 @@ controller: # name: argo-postgres-config # key: password workflowDefaults: {} # Only valid for 2.7+ - sso: {} # Only valid for 2.9+ # spec: # ttlStrategy: # secondsAfterCompletion: 84600 @@ -202,6 +201,23 @@ server: clusterWorkflowTemplates: # Give the server permissions to edit ClusterWorkflowTemplates. enableEditing: true + sso: + ## SSO configuration when SSO is specified as a server auth mode. + ## All the values are requied. SSO is activated by adding --auth-mode=sso + ## to the server command line. + # + ## The root URL of the OIDC identity provider. + # issuer: https://accounts.google.com + ## Name of a secret and a key in it to retrieve the app OIDC client ID from. + # clientId: + # name: argo-server-sso + # key: client-id + ## Name of a secret and a key in it to retrieve the app OIDC client secret from. + # clientSecret: + # name: argo-server-sso + # key: client-secret + ## The OIDC redirect URL. Should be in the form /oauth2/callback. + # redirectUrl: https://argo/oauth2/callback # Influences the creation of the ConfigMap for the workflow-controller itself. useDefaultArtifactRepo: false From 422752023d1ef1b90502e01ef3628f974516a240 Mon Sep 17 00:00:00 2001 From: appanycd <67127154+appanycd@users.noreply.github.com> Date: Tue, 23 Jun 2020 23:40:18 +0300 Subject: [PATCH 10/10] feat(argocd-notifications): Add slack icon and signingSecret support and Grafana support (#384) * Add icon and signingSecret support * Fix typo * Add grafana support * Fix trailing spaces * Fix trailing spaces 2 * Fix grafana comments * Add bot manifests * Bump version * No new line character * Values.yaml new line character * Add comments * Add slack.enabled flag * Move slack bot to bots/slack folder Co-authored-by: sergeyshaykhullin Co-authored-by: Sergey Shaykhullin <46970457+sergeyshaykhullin@users.noreply.github.com> --- charts/argocd-notifications/Chart.yaml | 2 +- .../templates/_helpers.tpl | 31 +++++++++++ .../templates/bots/slack/deployment.yaml | 45 +++++++++++++++ .../templates/bots/slack/role.yaml | 18 ++++++ .../templates/bots/slack/rolebinding.yaml | 13 +++++ .../templates/bots/slack/service.yaml | 15 +++++ .../templates/bots/slack/serviceaccount.yaml | 8 +++ .../templates/deployment.yaml | 2 +- .../templates/secret.yaml | 7 +++ charts/argocd-notifications/values.yaml | 55 +++++++++++++++++++ 10 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 charts/argocd-notifications/templates/bots/slack/deployment.yaml create mode 100644 charts/argocd-notifications/templates/bots/slack/role.yaml create mode 100644 charts/argocd-notifications/templates/bots/slack/rolebinding.yaml create mode 100644 charts/argocd-notifications/templates/bots/slack/service.yaml create mode 100644 charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index cfbdfc6e..54ef9a84 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 0.7.0 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.0.3 +version: 1.0.4 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argocd-notifications/templates/_helpers.tpl b/charts/argocd-notifications/templates/_helpers.tpl index bbe07b54..7540cf20 100644 --- a/charts/argocd-notifications/templates/_helpers.tpl +++ b/charts/argocd-notifications/templates/_helpers.tpl @@ -43,6 +43,18 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end -}} +{{/* +Common slack bot labels +*/}} +{{- define "argocd-notifications.bots.slack.labels" -}} +helm.sh/chart: {{ include "argocd-notifications.chart" . }} +{{ include "argocd-notifications.bots.slack.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + {{/* Selector labels */}} @@ -51,6 +63,14 @@ app.kubernetes.io/name: {{ include "argocd-notifications.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end -}} +{{/* +Selector slack bot labels +*/}} +{{- define "argocd-notifications.bots.slack.selectorLabels" -}} +app.kubernetes.io/name: {{ include "argocd-notifications.name" . }}-bot +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} + {{/* Create the name of the service account to use */}} @@ -61,3 +81,14 @@ Create the name of the service account to use {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{/* +Create the name of the bot service account to use +*/}} +{{- define "argocd-notifications.bots.slack.serviceAccountName" -}} +{{- if .Values.bots.slack.serviceAccount.create -}} + {{ default (include "argocd-notifications.fullname" .) .Values.bots.slack.serviceAccount.name }} +{{- else -}} + {{ default "default" .Values.bots.slack.serviceAccount.name }} +{{- end -}} +{{- end -}} diff --git a/charts/argocd-notifications/templates/bots/slack/deployment.yaml b/charts/argocd-notifications/templates/bots/slack/deployment.yaml new file mode 100644 index 00000000..c53efb74 --- /dev/null +++ b/charts/argocd-notifications/templates/bots/slack/deployment.yaml @@ -0,0 +1,45 @@ +{{ if .Values.bots.slack.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "argocd-notifications.name" . }}-bot + labels: + {{- include "argocd-notifications.bots.slack.labels" . | nindent 4 }} +spec: + strategy: + {{- .Values.bots.slack.updateStrategy | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "argocd-notifications.bots.slack.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "argocd-notifications.bots.slack.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.bots.slack.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "argocd-notifications.serviceAccountName" . }}-bot + containers: + - name: {{ include "argocd-notifications.name" . }}-bot + image: "{{ .Values.bots.slack.image.repository }}:{{ .Values.bots.slack.image.tag }}" + imagePullPolicy: {{ .Values.bots.slack.image.pullPolicy }} + resources: + {{- toYaml .Values.bots.slack.resources | nindent 12 }} + command: + - /app/argocd-notifications + - bot + {{- with .Values.bots.slack.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.bots.slack.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.bots.slack.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{ end }} diff --git a/charts/argocd-notifications/templates/bots/slack/role.yaml b/charts/argocd-notifications/templates/bots/slack/role.yaml new file mode 100644 index 00000000..5127fcac --- /dev/null +++ b/charts/argocd-notifications/templates/bots/slack/role.yaml @@ -0,0 +1,18 @@ +{{ if .Values.bots.slack.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: {{ include "argocd-notifications.name" . }}-bot +rules: +- apiGroups: + - argoproj.io + resources: + - applications + - appprojects + verbs: + - get + - list + - watch + - update + - patch +{{ end }} diff --git a/charts/argocd-notifications/templates/bots/slack/rolebinding.yaml b/charts/argocd-notifications/templates/bots/slack/rolebinding.yaml new file mode 100644 index 00000000..6a87bb49 --- /dev/null +++ b/charts/argocd-notifications/templates/bots/slack/rolebinding.yaml @@ -0,0 +1,13 @@ +{{ if .Values.bots.slack.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: {{ include "argocd-notifications.name" . }}-bot +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: {{ include "argocd-notifications.name" . }}-bot +subjects: +- kind: ServiceAccount + name: {{ include "argocd-notifications.bots.slack.serviceAccountName" . }} +{{ end }} diff --git a/charts/argocd-notifications/templates/bots/slack/service.yaml b/charts/argocd-notifications/templates/bots/slack/service.yaml new file mode 100644 index 00000000..1878fe9d --- /dev/null +++ b/charts/argocd-notifications/templates/bots/slack/service.yaml @@ -0,0 +1,15 @@ +{{ if .Values.bots.slack.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "argocd-notifications.name" . }}-bot +spec: + ports: + - name: server + port: 80 + protocol: TCP + targetPort: 8080 + selector: + {{- include "argocd-notifications.bots.slack.selectorLabels" . | nindent 4 }} + type: {{ .Values.bots.slack.service.type }} +{{ end }} diff --git a/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml b/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml new file mode 100644 index 00000000..ce28ad58 --- /dev/null +++ b/charts/argocd-notifications/templates/bots/slack/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{ if and .Values.bots.slack.enabled .Values.secret.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "argocd-notifications.bots.slack.serviceAccountName" . }} + labels: + {{- include "argocd-notifications.bots.slack.labels" . | nindent 4 }} +{{ end }} diff --git a/charts/argocd-notifications/templates/deployment.yaml b/charts/argocd-notifications/templates/deployment.yaml index 14fd9f48..cbe71ca7 100644 --- a/charts/argocd-notifications/templates/deployment.yaml +++ b/charts/argocd-notifications/templates/deployment.yaml @@ -22,7 +22,7 @@ spec: serviceAccountName: {{ include "argocd-notifications.serviceAccountName" . }} containers: - name: {{ include "argocd-notifications.name" . }}-controller - image: "{{ .Values.image.repository }}:{{ .Values.image.tag}}" + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/argocd-notifications/templates/secret.yaml b/charts/argocd-notifications/templates/secret.yaml index b631c78f..a5fc5527 100644 --- a/charts/argocd-notifications/templates/secret.yaml +++ b/charts/argocd-notifications/templates/secret.yaml @@ -12,6 +12,13 @@ stringData: slack: token: {{ .Values.secret.notifiers.slack.token }} username: {{ .Values.secret.notifiers.slack.username }} + icon: {{ .Values.secret.notifiers.slack.icon }} + signingSecret: {{ .Values.secret.notifiers.slack.signingSecret }} +{{- end }} +{{- if .Values.secret.notifiers.grafana.enabled }} + grafana: + apiUrl: {{ .Values.secret.notifiers.grafana.apiUrl }} + apiKey: {{ .Values.secret.notifiers.grafana.apiKey }} {{- end }} {{- if .Values.secret.notifiers.webhooks }} webhook: diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index a05ee4c0..d7769bf7 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -35,6 +35,20 @@ secret: token: # Optional override username username: + # Optional override icon + icon: + # Optional override signingSecret: https://argoproj-labs.github.io/argocd-notifications/recipients/slack-bot/ + signingSecret: + + grafana: + # For more information: https://argoproj-labs.github.io/argocd-notifications/services/grafana/ + + # Specifies whether Grafana notifier should be configured + enabled: false + # Grafana api endpoint; for example: https://grafana.example.com/api + apiUrl: + # Grafana api key + apiKey: webhooks: {} # For more information: https://argoproj-labs.github.io/argocd-notifications/services/webhook/ @@ -144,3 +158,44 @@ triggers: # template: my-custom-template # # For more information: https://argoproj-labs.github.io/argocd-notifications/triggers_and_templates/ + +bots: + # For more information: https://argoproj-labs.github.io/argocd-notifications/recipients/bot/ + slack: + # You have to set secret.notifiers.slack.signingSecret + enabled: false + + updateStrategy: + type: Recreate + + image: + repository: argoprojlabs/argocd-notifications + tag: v0.7.0 + pullPolicy: IfNotPresent + + imagePullSecrets: [] + + service: + type: LoadBalancer + + serviceAccount: + # Specifies whether a service account should be created + create: true + + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: argocd-notifications-bot + + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + + affinity: {} + + tolerations: [] + + nodeSelector: {}