From 80eeb61a05f8d0b3d55118af176ef0a44910a2cd Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Fri, 12 Nov 2021 10:25:07 +0100 Subject: [PATCH] docs(argocd-notifications): Use helm-docs (#1015) * docs(argocd-notifications): Use helm-docs Signed-off-by: Marco Kilchhofer * Use chart appVersion as default image tag Signed-off-by: Marco Kilchhofer --- charts/argocd-notifications/Chart.yaml | 6 +- charts/argocd-notifications/README.md | 79 ++++++++++++ charts/argocd-notifications/README.md.gotmpl | 45 +++++++ .../templates/bots/slack/deployment.yaml | 2 +- .../templates/deployment.yaml | 2 +- charts/argocd-notifications/values.yaml | 113 ++++++++++++------ 6 files changed, 204 insertions(+), 43 deletions(-) create mode 100644 charts/argocd-notifications/README.md.gotmpl diff --git a/charts/argocd-notifications/Chart.yaml b/charts/argocd-notifications/Chart.yaml index 171a5dfa..3d2cdce2 100644 --- a/charts/argocd-notifications/Chart.yaml +++ b/charts/argocd-notifications/Chart.yaml @@ -1,9 +1,9 @@ apiVersion: v2 -appVersion: 1.1.1 +appVersion: v1.1.1 description: A Helm chart for ArgoCD notifications, an add-on to ArgoCD. name: argocd-notifications type: application -version: 1.5.1 +version: 1.5.2 home: https://github.com/argoproj/argo-helm icon: https://argocd-notifications.readthedocs.io/en/stable/assets/logo.png keywords: @@ -15,4 +15,4 @@ maintainers: - name: andyfeller annotations: artifacthub.io/changes: | - - "[Added]: Support annotations on secret objects" + - "[Changed]: Use helm-docs to generate README.md" diff --git a/charts/argocd-notifications/README.md b/charts/argocd-notifications/README.md index 61e1d363..bdc7af40 100644 --- a/charts/argocd-notifications/README.md +++ b/charts/argocd-notifications/README.md @@ -7,3 +7,82 @@ This is a **community maintained** chart. It installs the [argocd-notifications] - Service Account - Roles - Role Bindings + +To regenerate this document, from the root of this chart directory run: + +```console +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest +``` + +## Values + +### General parameters + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | Assign custom [affinity] rules | +| argocdUrl | string | `nil` | ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates | +| cm.create | bool | `true` | Whether helm chart creates controller config map | +| containerSecurityContext | object | `{}` | Container Security Context | +| context | object | `{}` | Define user-defined context | +| extraArgs | list | `[]` | Extra arguments to provide to the controller | +| extraEnv | list | `[]` | Additional container environment variables | +| fullnameOverride | string | `""` | String to partially override "argocd-notifications.fullname" template | +| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy for the controller | +| image.repository | string | `"argoprojlabs/argocd-notifications"` | Repository to use for the controller | +| image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion | +| imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry | +| logLevel | string | `"info"` | Set the logging level. (One of: `debug`, `info`, `warn`, `error`) | +| metrics.enabled | bool | `false` | Enables prometheus metrics server | +| metrics.port | int | `9001` | Metrics port | +| metrics.service.annotations | object | `{}` | Metrics service annotations | +| metrics.service.labels | object | `{}` | Metrics service labels | +| metrics.serviceMonitor.additionalLabels | object | `{}` | Prometheus ServiceMonitor labels | +| metrics.serviceMonitor.enabled | bool | `false` | Enable a prometheus ServiceMonitor | +| nameOverride | string | `"argocd-notifications"` | String to partially override "argocd-notifications.fullname" template | +| nodeSelector | object | `{}` | [Node selector] | +| notifiers | object | See [values.yaml] | Configures notification services | +| podAnnotations | object | `{}` | Annotations to be applied to the controller Pods | +| podLabels | object | `{}` | Labels to be applied to the controller Pods | +| resources | object | `{}` | Resource limits and requests for the controller | +| secret.annotations | object | `{}` | key:value pairs of annotations to be added to the secret | +| secret.create | bool | `true` | Whether helm chart creates controller secret | +| secret.items | object | `{}` | Generic key:value pairs to be inserted into the secret | +| securityContext | object | `{"runAsNonRoot":true}` | Pod Security Context | +| serviceAccount.annotations | object | `{}` | Annotations applied to created service account | +| serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| serviceAccount.name | string | `"argocd-notifications-controller"` | The name of the service account to use. | +| subscriptions | object | `{}` | Contains centrally managed global application subscriptions | +| templates | object | `{}` | The notification template is used to generate the notification content | +| tolerations | list | `[]` | [Tolerations] for use with node taints | +| triggers | object | `{}` | The trigger defines the condition when the notification should be sent | +| updateStrategy | object | `{"type":"Recreate"}` | The deployment strategy to use to replace existing pods with new ones | + +### Bots + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| bots.slack.affinity | object | `{}` | Assign custom [affinity] rules | +| bots.slack.enabled | bool | `false` | Enable slack bot | +| bots.slack.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy for the Slack bot | +| bots.slack.image.repository | string | `"argoprojlabs/argocd-notifications"` | Repository to use for the Slack bot | +| bots.slack.image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion | +| bots.slack.imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry | +| bots.slack.nodeSelector | object | `{}` | [Node selector] | +| bots.slack.resources | object | `{}` | Resource limits and requests for the Slack bot | +| bots.slack.service.annotations | object | `{}` | Service annotations for Slack bot | +| bots.slack.service.port | int | `80` | Service port for Slack bot | +| bots.slack.service.type | string | `"LoadBalancer"` | Service type for Slack bot | +| bots.slack.serviceAccount.annotations | object | `{}` | Annotations applied to created service account | +| bots.slack.serviceAccount.create | bool | `true` | Specifies whether a service account should be created | +| bots.slack.serviceAccount.name | string | `"argocd-notifications-bot"` | The name of the service account to use. | +| bots.slack.tolerations | list | `[]` | [Tolerations] for use with node taints | +| bots.slack.updateStrategy | object | `{"type":"Recreate"}` | The deployment strategy to use to replace existing pods with new ones | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) + +[affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +[Node selector]: https://kubernetes.io/docs/user-guide/node-selection/ +[Tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +[values.yaml]: values.yaml diff --git a/charts/argocd-notifications/README.md.gotmpl b/charts/argocd-notifications/README.md.gotmpl new file mode 100644 index 00000000..de0184ec --- /dev/null +++ b/charts/argocd-notifications/README.md.gotmpl @@ -0,0 +1,45 @@ +## 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 + +To regenerate this document, from the root of this chart directory run: + +```console +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest +``` + +## Values + +### General parameters + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if not (hasPrefix "bots" .Key) }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + +### Bots + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if hasPrefix "bots" .Key }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) + +[affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ +[Node selector]: https://kubernetes.io/docs/user-guide/node-selection/ +[Tolerations]: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +[values.yaml]: values.yaml diff --git a/charts/argocd-notifications/templates/bots/slack/deployment.yaml b/charts/argocd-notifications/templates/bots/slack/deployment.yaml index 112266ed..83efd6ba 100644 --- a/charts/argocd-notifications/templates/bots/slack/deployment.yaml +++ b/charts/argocd-notifications/templates/bots/slack/deployment.yaml @@ -23,7 +23,7 @@ spec: serviceAccountName: {{ include "argocd-notifications.bots.slack.serviceAccountName" . }} containers: - name: {{ include "argocd-notifications.name" . }}-bot - image: "{{ .Values.bots.slack.image.repository }}:{{ .Values.bots.slack.image.tag }}" + image: "{{ .Values.bots.slack.image.repository }}:{{ default .Chart.AppVersion .Values.bots.slack.image.tag }}" imagePullPolicy: {{ .Values.bots.slack.image.pullPolicy }} resources: {{- toYaml .Values.bots.slack.resources | nindent 12 }} diff --git a/charts/argocd-notifications/templates/deployment.yaml b/charts/argocd-notifications/templates/deployment.yaml index f1d9ab5e..0a91b0ac 100644 --- a/charts/argocd-notifications/templates/deployment.yaml +++ b/charts/argocd-notifications/templates/deployment.yaml @@ -34,7 +34,7 @@ spec: {{- end }} containers: - name: {{ include "argocd-notifications.name" . }}-controller - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} resources: {{- toYaml .Values.resources | nindent 12 }} diff --git a/charts/argocd-notifications/values.yaml b/charts/argocd-notifications/values.yaml index 554bedc1..f3d32c66 100644 --- a/charts/argocd-notifications/values.yaml +++ b/charts/argocd-notifications/values.yaml @@ -1,41 +1,50 @@ +# -- Assign custom [affinity] rules affinity: {} -# ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates +# -- ArgoCD dashboard url; used in place of {{.context.argocdUrl}} in templates argocdUrl: +# -- String to partially override "argocd-notifications.fullname" template fullnameOverride: "" image: + # -- Repository to use for the controller repository: argoprojlabs/argocd-notifications - tag: v1.1.1 + # -- Overrides the image tag whose default is the chart appVersion + tag: "" + # -- Image pull policy for the controller pullPolicy: IfNotPresent +# -- Secrets with credentials to pull images from a private registry imagePullSecrets: [] +# -- String to partially override "argocd-notifications.fullname" template nameOverride: "argocd-notifications" +# -- [Node selector] nodeSelector: {} +# -- The deployment strategy to use to replace existing pods with new ones updateStrategy: type: Recreate -context: - # Add custom values into context - # region: east - # environmentName: staging +# -- Define user-defined context +## For more information: https://argocd-notifications.readthedocs.io/en/stable/templates/#defining-user-defined-context +context: {} + # region: east + # environmentName: staging secret: - # Whether helm chart creates controller secret + # -- Whether helm chart creates controller secret create: true - # key:value pairs to be added to the secret + # -- key:value pairs of annotations to be added to the secret annotations: {} - items: - # Generic key:value pairs to be inserted into the secret - # Can be used for templates, notification services etc. Some examples given below. - # For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/ - + # -- Generic key:value pairs to be inserted into the secret + ## Can be used for templates, notification services etc. Some examples given below. + ## For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/ + items: {} # slack-token: # # For more information: https://argocd-notifications.readthedocs.io/en/stable/services/slack/ @@ -48,43 +57,55 @@ secret: # email-password: # For more information: https://argocd-notifications.readthedocs.io/en/stable/services/email/ +# -- Set the logging level. (One of: `debug`, `info`, `warn`, `error`) logLevel: info +# -- Extra arguments to provide to the controller extraArgs: [] metrics: + # -- Enables prometheus metrics server enabled: false + # -- Metrics port port: 9001 service: + # -- Metrics service annotations annotations: {} + # -- Metrics service labels labels: {} serviceMonitor: + # -- Enable a prometheus ServiceMonitor enabled: false + # -- Prometheus ServiceMonitor labels additionalLabels: {} # namespace: monitoring # interval: 30s # scrapeTimeout: 10s -# Additional container environment variables +# -- Additional container environment variables extraEnv: [] +# -- Configures notification services +# @default -- See [values.yaml] +## For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/ notifiers: -# For more information: https://argocd-notifications.readthedocs.io/en/stable/services/overview/ - service.slack: | token: $slack-token +# -- Annotations to be applied to the controller Pods podAnnotations: {} +# -- Labels to be applied to the controller Pods podLabels: {} -## Pod Security Context +# -- Pod Security Context securityContext: runAsNonRoot: true -## Container Security Context +# -- Container Security Context containerSecurityContext: {} +# -- Resource limits and requests for the controller resources: {} # limits: # cpu: 100m @@ -94,22 +115,23 @@ resources: {} # memory: 128Mi serviceAccount: - # Specifies whether a service account should be created + # -- 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 + # -- 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 + # -- Annotations applied to created service account annotations: {} cm: - # Whether helm chart creates controller config map + # -- Whether helm chart creates controller config map create: true -subscriptions: - # For more information: https://argocd-notifications.readthedocs.io/en/stable/subscriptions/ - +# -- Contains centrally managed global application subscriptions +## For more information: https://argocd-notifications.readthedocs.io/en/stable/subscriptions/ +subscriptions: {} # # subscription for on-sync-status-unknown trigger notifications # - recipients: # - slack:test2 @@ -123,9 +145,9 @@ subscriptions: # triggers: # - on-sync-status-unknown -templates: - # For more information: https://argocd-notifications.readthedocs.io/en/stable/templates/ - +# -- The notification template is used to generate the notification content +## For more information: https://argocd-notifications.readthedocs.io/en/stable/templates/ +templates: {} # template.app-deployed: | # email: # subject: New version of an application {{.app.metadata.name}} is up and running. @@ -314,12 +336,12 @@ templates: # slack: # attachments: "[{\n \"title\": \"{{ .app.metadata.name}}\",\n \"title_link\":\"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}\",\n \"color\": \"#18be52\",\n \"fields\": [\n {\n \"title\": \"Sync Status\",\n \"value\": \"{{.app.status.sync.status}}\",\n \"short\": true\n },\n {\n \"title\": \"Repository\",\n \"value\": \"{{.app.spec.source.repoURL}}\",\n \"short\": true\n }\n {{range $index, $c := .app.status.conditions}}\n {{if not $index}},{{end}}\n {{if $index}},{{end}}\n {\n \"title\": \"{{$c.type}}\",\n \"value\": \"{{$c.message}}\",\n \"short\": true\n }\n {{end}}\n ]\n}] " - +# -- [Tolerations] for use with node taints tolerations: [] -triggers: - # For more information: https://argocd-notifications.readthedocs.io/en/stable/triggers/ - +# -- The trigger defines the condition when the notification should be sent +## For more information: https://argocd-notifications.readthedocs.io/en/stable/triggers/ +triggers: {} # trigger.on-deployed: | # - description: Application is synced and healthy. Triggered once per commit. # oncePer: app.status.sync.revision @@ -356,37 +378,49 @@ triggers: # defaultTriggers: | # - on-sync-status-unknown +## The optional bot component simplifies managing subscriptions +## For more information: https://argocd-notifications.readthedocs.io/en/stable/bots/overview/ bots: - # For more information: https://argocd-notifications.readthedocs.io/en/stable/bots/overview/ slack: - # You have to set secret.notifiers.slack.signingSecret + # -- Enable slack bot + ## You have to set secret.notifiers.slack.signingSecret enabled: false + # -- The deployment strategy to use to replace existing pods with new ones updateStrategy: type: Recreate image: + # -- Repository to use for the Slack bot repository: argoprojlabs/argocd-notifications - tag: v1.1.1 + # -- Overrides the image tag whose default is the chart appVersion + tag: "" + # -- Image pull policy for the Slack bot pullPolicy: IfNotPresent + # -- Secrets with credentials to pull images from a private registry imagePullSecrets: [] service: + # -- Service annotations for Slack bot annotations: {} + # -- Service port for Slack bot port: 80 + # -- Service type for Slack bot type: LoadBalancer serviceAccount: - # Specifies whether a service account should be created + # -- 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 + # -- 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 + # -- Annotations applied to created service account annotations: {} + # -- Resource limits and requests for the Slack bot resources: {} # limits: # cpu: 100m @@ -395,8 +429,11 @@ bots: # cpu: 100m # memory: 128Mi + # -- Assign custom [affinity] rules affinity: {} + # -- [Tolerations] for use with node taints tolerations: [] + # -- [Node selector] nodeSelector: {}