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/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index b204ba59..b34759a5 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.2 +version: 2.3.5 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-application-controller/serviceaccount.yaml b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml index b397d43c..fbbb0b78 100644 --- a/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml @@ -1,3 +1,4 @@ +{{- if .Values.controller.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -8,4 +9,5 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.controller.name }} \ No newline at end of file + app.kubernetes.io/component: {{ .Values.controller.name }} +{{- end }} diff --git a/charts/argo-cd/templates/argocd-server/service.yaml b/charts/argo-cd/templates/argocd-server/service.yaml index 396b0c06..0d3b6c49 100644 --- a/charts/argo-cd/templates/argocd-server/service.yaml +++ b/charts/argo-cd/templates/argocd-server/service.yaml @@ -37,7 +37,7 @@ spec: loadBalancerIP: {{ .Values.server.service.loadBalancerIP | quote }} {{- end }} {{- if .Values.server.service.loadBalancerSourceRanges }} - loadBalancerSourceranges: + loadBalancerSourceRanges: {{ toYaml .Values.server.service.loadBalancerSourceRanges | indent 4 }} {{- end }} {{- end -}} diff --git a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml index 08f11d01..b8549600 100644 --- a/charts/argo-cd/templates/argocd-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-server/serviceaccount.yaml @@ -1,3 +1,4 @@ +{{- if .Values.server.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -8,4 +9,5 @@ metadata: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd - app.kubernetes.io/component: {{ .Values.server.name }} \ No newline at end of file + app.kubernetes.io/component: {{ .Values.server.name }} +{{- end }} diff --git a/charts/argo-cd/templates/dex/serviceaccount.yaml b/charts/argo-cd/templates/dex/serviceaccount.yaml index 4df9ca5a..cdd1cd0b 100644 --- a/charts/argo-cd/templates/dex/serviceaccount.yaml +++ b/charts/argo-cd/templates/dex/serviceaccount.yaml @@ -1,4 +1,4 @@ -{{- if .Values.dex.enabled }} +{{- if .Values.dex.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: @@ -10,4 +10,4 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: argocd app.kubernetes.io/component: {{ .Values.dex.name }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index b47acbbf..45d20995 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -160,7 +160,7 @@ controller: # additionalLabels: {} ## Enable Admin ClusterRole resources. - ## Enable if you would like to grant rights to ArgoCD to deploy to the local kuberentes cluster. + ## Enable if you would like to grant rights to ArgoCD to deploy to the local Kubernetes cluster. clusterAdminAccess: enabled: true @@ -564,7 +564,7 @@ server: # roles: [] ## Enable Admin ClusterRole resources. - ## Enable if you would like to grant rights to ArgoCD to deploy to the local kuberentes cluster. + ## Enable if you would like to grant rights to ArgoCD to deploy to the local Kubernetes cluster. clusterAdminAccess: enabled: true diff --git a/charts/argo/Chart.yaml b/charts/argo/Chart.yaml index cd3e1cb0..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.1 +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/server-cluster-role.yaml b/charts/argo/templates/server-cluster-roles.yaml similarity index 74% rename from charts/argo/templates/server-cluster-role.yaml rename to charts/argo/templates/server-cluster-roles.yaml index 082e4915..8da10df2 100644 --- a/charts/argo/templates/server-cluster-role.yaml +++ b/charts/argo/templates/server-cluster-roles.yaml @@ -1,14 +1,8 @@ {{- if .Values.server.enabled }} apiVersion: rbac.authorization.k8s.io/v1 -{{- if .Values.singleNamespace }} -kind: Role -metadata: - name: {{ .Release.Name }}-{{ .Values.server.name }}-role -{{ else }} kind: ClusterRole metadata: - name: {{ .Release.Name }}-{{ .Values.server.name }}-cluster-role -{{- end }} + name: {{ .Release.Name }}-{{ .Values.server.name }} rules: - apiGroups: - "" @@ -58,7 +52,6 @@ rules: - workflows - workflowtemplates - cronworkflows - - clusterworkflowtemplates verbs: - create - get @@ -67,4 +60,24 @@ rules: - update - patch - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name }}-cluster-template +rules: +- apiGroups: + - argoproj.io + resources: + - clusterworkflowtemplates + verbs: + - get + - list + - watch + {{- if .Values.server.clusterWorkflowTemplates.enableEditing }} + - create + - update + - patch + - delete + {{- end }} {{- end }} diff --git a/charts/argo/templates/server-crb.yaml b/charts/argo/templates/server-crb.yaml index ed7d7982..a919e573 100644 --- a/charts/argo/templates/server-crb.yaml +++ b/charts/argo/templates/server-crb.yaml @@ -3,21 +3,29 @@ apiVersion: rbac.authorization.k8s.io/v1 {{- if .Values.singleNamespace }} kind: RoleBinding metadata: - name: {{ .Release.Name }}-{{ .Values.server.name}}-rb + name: {{ .Release.Name }}-{{ .Values.server.name}} {{ else }} kind: ClusterRoleBinding metadata: - name: {{ .Release.Name }}-{{ .Values.server.name}}-crb + name: {{ .Release.Name }}-{{ .Values.server.name}} {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io - {{- if .Values.singleNamespace }} - kind: Role - name: {{ .Release.Name }}-{{ .Values.server.name}}-role - {{ else }} kind: ClusterRole - name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role - {{- end }} + name: {{ .Release.Name }}-{{ .Values.server.name}} +subjects: +- kind: ServiceAccount + name: {{ .Values.server.serviceAccount }} + namespace: {{ .Release.Namespace }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-template +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-template subjects: - kind: ServiceAccount name: {{ .Values.server.serviceAccount }} diff --git a/charts/argo/templates/workflow-controller-clusterrole.yaml b/charts/argo/templates/workflow-controller-cluster-roles.yaml similarity index 85% rename from charts/argo/templates/workflow-controller-clusterrole.yaml rename to charts/argo/templates/workflow-controller-cluster-roles.yaml index 43d1a8a7..1bee0b17 100644 --- a/charts/argo/templates/workflow-controller-clusterrole.yaml +++ b/charts/argo/templates/workflow-controller-cluster-roles.yaml @@ -1,13 +1,7 @@ apiVersion: rbac.authorization.k8s.io/v1 -{{- if .Values.singleNamespace }} -kind: Role -metadata: - name: {{ .Release.Name }}-{{ .Values.controller.name }}-role -{{ else }} kind: ClusterRole metadata: - name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-role -{{- end }} + name: {{ .Release.Name }}-{{ .Values.controller.name }} rules: - apiGroups: - "" @@ -103,5 +97,18 @@ rules: verbs: - get {{- end}} - - +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-template +rules: +- apiGroups: + - argoproj.io + resources: + - clusterworkflowtemplates + - clusterworkflowtemplates/finalizers + verbs: + - get + - list + - watch diff --git a/charts/argo/templates/workflow-controller-config-map.yaml b/charts/argo/templates/workflow-controller-config-map.yaml index 14d49935..a5845681 100644 --- a/charts/argo/templates/workflow-controller-config-map.yaml +++ b/charts/argo/templates/workflow-controller-config-map.yaml @@ -42,8 +42,8 @@ data: bucket: {{ .Values.artifactRepository.s3.bucket | default .Values.minio.defaultBucket.name }} endpoint: {{ .Values.artifactRepository.s3.endpoint | default (printf "%s-%s" .Release.Name "minio:9000") }} insecure: {{ .Values.artifactRepository.s3.insecure }} - {{- if .Values.artifactRepository.s3.keyPrefix }} - keyPrefix: {{ .Values.artifactRepository.s3.keyPrefix }} + {{- if .Values.artifactRepository.s3.keyFormat }} + keyFormat: {{ .Values.artifactRepository.s3.keyFormat }} {{- end }} {{- if .Values.artifactRepository.s3.region }} region: {{ .Values.artifactRepository.s3.region }} diff --git a/charts/argo/templates/workflow-controller-crb.yaml b/charts/argo/templates/workflow-controller-crb.yaml index 3eba3cf2..459a3c67 100644 --- a/charts/argo/templates/workflow-controller-crb.yaml +++ b/charts/argo/templates/workflow-controller-crb.yaml @@ -5,16 +5,11 @@ kind: RoleBinding kind: ClusterRoleBinding {{- end }} metadata: - name: {{ .Release.Name }}-{{ .Values.controller.name }}-binding + name: {{ .Release.Name }}-{{ .Values.controller.name }} roleRef: apiGroup: rbac.authorization.k8s.io - {{- if .Values.singleNamespace }} - kind: Role - name: {{ .Release.Name }}-{{ .Values.controller.name }}-role - {{ else }} kind: ClusterRole - name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-role - {{- end }} + name: {{ .Release.Name }}-{{ .Values.controller.name }} subjects: - kind: ServiceAccount name: {{ .Values.controller.serviceAccount }} @@ -30,3 +25,16 @@ subjects: {{- end }} {{- end }} {{- end }} +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-template +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-template +subjects: + - kind: ServiceAccount + name: {{ .Values.controller.serviceAccount }} + namespace: {{ .Release.Namespace }} 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 7ab0aae5..a5492cb6 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -39,6 +39,8 @@ controller: # maxOpenConns: 0 # # save the entire workflow into etcd and DB # nodeStatusOffLoad: false + # # enable archiving of old workflows + # archive: false # postgresql: # host: localhost # port: 5432 @@ -55,6 +57,8 @@ controller: # spec: # ttlStrategy: # secondsAfterCompletion: 84600 + # workflowWorkers: 32 + # podWorkers: 32 telemetryConfig: enabled: false path: /telemetry @@ -190,6 +194,9 @@ server: # - secretName: argo-ui-tls # hosts: # - argo.domain.com + clusterWorkflowTemplates: + # Give the server permissions to edit ClusterWorkflowTemplates. + enableEditing: true # Influences the creation of the ConfigMap for the workflow-controller itself. useDefaultArtifactRepo: false 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..02d935de --- /dev/null +++ b/charts/argocd-notifications/Chart.yaml @@ -0,0 +1,15 @@ +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.2 +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 + - name: andyfeller 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..14fd9f48 --- /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: + strategy: + {{- .Values.updateStrategy | toYaml | nindent 4 }} + selector: + matchLabels: + {{- include "argocd-notifications.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "argocd-notifications.selectorLabels" . | nindent 8 }} + spec: + {{- 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..993b75bb --- /dev/null +++ b/charts/argocd-notifications/values.yaml @@ -0,0 +1,127 @@ +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: {} + +updateStrategy: + type: Recreate + +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/