From 71da566fb3172832bc28bc8e521d3fbc99e9d5e3 Mon Sep 17 00:00:00 2001 From: Marco Kilchhofer Date: Mon, 17 Jan 2022 15:01:41 +0100 Subject: [PATCH] feat(argo-events): Use helm-docs for Argo Events (#1090) Signed-off-by: Marco Kilchhofer --- .helmdocsignore | 1 - charts/argo-events/.helmignore | 1 + charts/argo-events/Chart.yaml | 4 +- charts/argo-events/README.md | 90 ++++++++++++++++++- charts/argo-events/README.md.gotmpl | 77 ++++++++++++++++ charts/argo-events/ci/test-values.yaml | 1 - .../deployment.yaml} | 0 .../deployment.yaml} | 0 .../deployment.yaml} | 0 charts/argo-events/values.yaml | 73 ++++++++++++--- 10 files changed, 231 insertions(+), 16 deletions(-) create mode 100644 charts/argo-events/README.md.gotmpl rename charts/argo-events/templates/{eventbus-controller-deployment.yaml => eventbus-controller/deployment.yaml} (100%) rename charts/argo-events/templates/{eventsource-controller-deployment.yaml => eventsource-controller/deployment.yaml} (100%) rename charts/argo-events/templates/{sensor-controller-deployment.yaml => sensor-controller/deployment.yaml} (100%) diff --git a/.helmdocsignore b/.helmdocsignore index a02fad29..61eef86a 100644 --- a/.helmdocsignore +++ b/.helmdocsignore @@ -1,2 +1 @@ -charts/argo-events charts/argo-rollouts diff --git a/charts/argo-events/.helmignore b/charts/argo-events/.helmignore index b4af6c20..a9f0b031 100644 --- a/charts/argo-events/.helmignore +++ b/charts/argo-events/.helmignore @@ -20,3 +20,4 @@ .idea/ *.tmproj ci/ +README.md.gotmpl diff --git a/charts/argo-events/Chart.yaml b/charts/argo-events/Chart.yaml index 2220c699..f69047bf 100644 --- a/charts/argo-events/Chart.yaml +++ b/charts/argo-events/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A Helm chart to install Argo-Events in k8s Cluster name: argo-events -version: 1.9.0 +version: 1.10.0 keywords: - argo-events - sensor-controller @@ -17,4 +17,4 @@ icon: https://argoproj.github.io/argo-events/assets/logo.png home: https://github.com/argoproj/argo-helm annotations: artifacthub.io/changes: | - - "[Added]: Allow specifying container security context for controllers" + - "[Changed]: Use helm-docs to generate README.md" diff --git a/charts/argo-events/README.md b/charts/argo-events/README.md index 2bece9b9..7f7d41c5 100644 --- a/charts/argo-events/README.md +++ b/charts/argo-events/README.md @@ -13,8 +13,96 @@ This is a **community maintained** chart. It installs the [argo-events](https:// - Cluster Roles - Cluster Role Bindings +To regenerate this document, from the root of this chart directory run: + +```shell +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest +``` + ## Notes on CRD Installation Some users would prefer to install the CRDs _outside_ of the chart. You can disable the CRD installation of this chart by using `--skip-crds` when installing the chart. -You can install the CRDs manually from `crds` folder. \ No newline at end of file +You can install the CRDs manually from `crds` folder. + +## Values + +### General parameters + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| additionalSaNamespaces | list | `[]` | Create service accounts in additional namespaces specified The SA will always be created in the release namespaces | +| additionalServiceAccountRules | list | (See [values.yaml]) | Additional rules | +| imagePullPolicy | string | `"Always"` | The image pull policy | +| imagePullSecrets | list | `[]` | Secrets with credentials to pull images from a private registry | +| registry | string | `"quay.io"` | docker registry | +| securityContext | object | `{"runAsNonRoot":true,"runAsUser":9731}` | Common PodSecurityContext for all controllers | +| serviceAccount | string | `"argo-events-sa"` | ServiceAccount to use for running controller. | +| serviceAccountAnnotations | object | `{}` | Annotations applied to created service account. Can be used to enable GKE workload identity, or other use-cases | +| singleNamespace | bool | `true` | Whether to run in namespaced scope. Set `singleNamespace` to false to have the controllers listen on all namespaces. Otherwise the controllers will listen on the namespace where the chart is installed in. | + +### Event Bus Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| eventbusController.affinity | object | `{}` | Assign custom [affinity] rules to the event bus controller | +| eventbusController.containerSecurityContext | object | `{}` | Event bus controller container-level security context | +| eventbusController.extraEnv | list | `[]` | Additional environment variables to pass to event bus controller | +| eventbusController.image | string | `"argoproj/argo-events"` | Repository to use for the event bus controller | +| eventbusController.name | string | `"eventbus-controller"` | Event bus controller name | +| eventbusController.natsMetricsExporterImage | string | `"natsio/prometheus-nats-exporter:0.8.0"` | NATS metrics exporter container image to use for the event bus | +| eventbusController.natsStreamingImage | string | `"nats-streaming:0.22.1"` | NATS streaming container image to use for the event bus | +| eventbusController.nodeSelector | object | `{}` | [Node selector] | +| eventbusController.podAnnotations | object | `{}` | Annotations to be added to event bus controller pods | +| eventbusController.podLabels | object | `{}` | Labels to be added to event event bus controller pods | +| eventbusController.priorityClassName | string | `""` | Priority class for the event bus controller | +| eventbusController.replicaCount | int | `1` | The number of event bus controller pods to run | +| eventbusController.resources | object | `{}` | Resource limits and requests for the event bus controller pods | +| eventbusController.tag | string | `""` (default is the chart appVersion) | Overrides the image tag | +| eventbusController.tolerations | list | `[]` | [Tolerations] for use with node taints | + +### Event Source Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| eventsourceController.affinity | object | `{}` | Assign custom [affinity] rules to the event source controller | +| eventsourceController.containerSecurityContext | object | `{}` | Event source controller container-level security context | +| eventsourceController.eventsourceImage | string | `"argoproj/argo-events"` | Repository to use for the event source image | +| eventsourceController.extraEnv | list | `[]` | Additional environment variables to pass to event source controller | +| eventsourceController.image | string | `"argoproj/argo-events"` | Repository to use for the event source controller | +| eventsourceController.name | string | `"eventsource-controller"` | Event source controller name | +| eventsourceController.nodeSelector | object | `{}` | [Node selector] | +| eventsourceController.podAnnotations | object | `{}` | Annotations to be added to event source controller pods | +| eventsourceController.podLabels | object | `{}` | Labels to be added to event source controller pods | +| eventsourceController.priorityClassName | string | `""` | Priority class for the event source controller | +| eventsourceController.replicaCount | int | `1` | The number of event source controller pods to run | +| eventsourceController.resources | object | `{}` | Resource limits and requests for the event source controller pods | +| eventsourceController.tag | string | `""` (default is the chart appVersion) | Overrides the image tag | +| eventsourceController.tolerations | list | `[]` | [Tolerations] for use with node taints | + +### Sensor Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| sensorController.affinity | object | `{}` | Assign custom [affinity] rules to the sensor controller | +| sensorController.containerSecurityContext | object | `{}` | Sensor controllers container-level security context | +| sensorController.extraEnv | list | `[]` | Additional environment variables to pass to sensor controller | +| sensorController.image | string | `"argoproj/argo-events"` | Repository to use for the sensor controller | +| sensorController.name | string | `"sensor-controller"` | Sensor controller name | +| sensorController.nodeSelector | object | `{}` | [Node selector] | +| sensorController.podAnnotations | object | `{}` | Annotations to be added to sensor controller pods | +| sensorController.podLabels | object | `{}` | Labels to be added to sensor controller pods | +| sensorController.priorityClassName | string | `""` | Priority class for the sensor controller | +| sensorController.replicaCount | int | `1` | The number of sensor controller pods to run | +| sensorController.resources | object | `{}` | Resource limits and requests for the sensor controller pods | +| sensorController.sensorImage | string | `"argoproj/argo-events"` | Repository to use for the sensor image | +| sensorController.tag | string | `""` (default is the chart appVersion) | Overrides the image tag | +| sensorController.tolerations | list | `[]` | [Tolerations] for use with node taints | + +---------------------------------------------- +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/argo-events/README.md.gotmpl b/charts/argo-events/README.md.gotmpl new file mode 100644 index 00000000..61654981 --- /dev/null +++ b/charts/argo-events/README.md.gotmpl @@ -0,0 +1,77 @@ +# Argo-Events Chart + +This is a **community maintained** chart. It installs the [argo-events](https://github.com/argoproj/argo-events) application. This application comes packaged with: +- Sensor Custom Resource Definition (See CRD Notes) +- EventSource Custom Resource Definition (See CRD Notes) +- EventBus Custom Resource Definition (See CRD Notes) +- Sensor Controller Deployment +- EventSource Controller Deployment +- EventBus Controller Deployment +- Service Account +- Roles +- Role Bindings +- Cluster Roles +- Cluster Role Bindings + +To regenerate this document, from the root of this chart directory run: + +```shell +docker run --rm --volume "$(pwd):/helm-docs" -u $(id -u) jnorwood/helm-docs:latest +``` + +## Notes on CRD Installation + +Some users would prefer to install the CRDs _outside_ of the chart. You can disable the CRD installation of this chart by using `--skip-crds` when installing the chart. + +You can install the CRDs manually from `crds` folder. + +## Values + +### General parameters + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if not (or (hasPrefix "eventbusController" .Key) (hasPrefix "eventsourceController" .Key) (hasPrefix "sensorController" .Key) ) }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + +### Event Bus Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if hasPrefix "eventbusController" .Key }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + + +### Event Source Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if hasPrefix "eventsourceController" .Key }} +| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | + {{- end }} +{{- end }} + +### Sensor Controller + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +{{- range .Values }} + {{- if hasPrefix "sensorController" .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/argo-events/ci/test-values.yaml b/charts/argo-events/ci/test-values.yaml index 3078a2d3..a15316ef 100644 --- a/charts/argo-events/ci/test-values.yaml +++ b/charts/argo-events/ci/test-values.yaml @@ -1,3 +1,2 @@ serviceAccount: argo-events-sa-test -instanceID: test-argo-events singleNamespace: false diff --git a/charts/argo-events/templates/eventbus-controller-deployment.yaml b/charts/argo-events/templates/eventbus-controller/deployment.yaml similarity index 100% rename from charts/argo-events/templates/eventbus-controller-deployment.yaml rename to charts/argo-events/templates/eventbus-controller/deployment.yaml diff --git a/charts/argo-events/templates/eventsource-controller-deployment.yaml b/charts/argo-events/templates/eventsource-controller/deployment.yaml similarity index 100% rename from charts/argo-events/templates/eventsource-controller-deployment.yaml rename to charts/argo-events/templates/eventsource-controller/deployment.yaml diff --git a/charts/argo-events/templates/sensor-controller-deployment.yaml b/charts/argo-events/templates/sensor-controller/deployment.yaml similarity index 100% rename from charts/argo-events/templates/sensor-controller-deployment.yaml rename to charts/argo-events/templates/sensor-controller/deployment.yaml diff --git a/charts/argo-events/values.yaml b/charts/argo-events/values.yaml index 1d3bb9dd..b6ea4d04 100644 --- a/charts/argo-events/values.yaml +++ b/charts/argo-events/values.yaml @@ -1,23 +1,26 @@ -# docker registry +# -- docker registry registry: quay.io -# The image pull policy +# -- The image pull policy imagePullPolicy: Always -# Secrets with credentials to pull images from a private registry +# -- Secrets with credentials to pull images from a private registry imagePullSecrets: [] # - name: argo-pull-secret -# ServiceAccount to use for running controller. +# -- ServiceAccount to use for running controller. serviceAccount: argo-events-sa -# serviceAccountAnnotations can be used to enable GKE workload identity, or other use-cases +# -- Annotations applied to created service account. Can be used to enable GKE workload identity, or other use-cases serviceAccountAnnotations: {} -# Create service accounts in additional namespaces specified +# -- Create service accounts in additional namespaces specified # The SA will always be created in the release namespaces additionalSaNamespaces: [] # - argo-prod + +# -- Additional rules +# @default -- (See [values.yaml]) additionalServiceAccountRules: - apiGroups: - apiextensions.k8s.io @@ -33,70 +36,118 @@ additionalServiceAccountRules: resources: - customresourcedefinitions -instanceID: argo-events - -# set `singleNamespace` to false to have the controllers +# -- Whether to run in namespaced scope. +# Set `singleNamespace` to false to have the controllers # listen on all namespaces. Otherwise the controllers will listen -# on the namespace provided -namespace: argo-events +# on the namespace where the chart is installed in. singleNamespace: true # sensor controller sensorController: + # -- Sensor controller name name: sensor-controller + # -- Repository to use for the sensor controller image: argoproj/argo-events + # -- Overrides the image tag + # @default -- `""` (default is the chart appVersion) tag: "" + # -- The number of sensor controller pods to run replicaCount: 1 + # -- Additional environment variables to pass to sensor controller extraEnv: [] # - name: DEBUG_LOG # value: "true" + + # -- Repository to use for the sensor image sensorImage: argoproj/argo-events + # -- Annotations to be added to sensor controller pods podAnnotations: {} + # -- [Node selector] nodeSelector: {} + # -- Labels to be added to sensor controller pods podLabels: {} + # -- Priority class for the sensor controller priorityClassName: "" + # -- [Tolerations] for use with node taints tolerations: [] + # -- Assign custom [affinity] rules to the sensor controller affinity: {} + # -- Resource limits and requests for the sensor controller pods resources: {} + # -- Sensor controllers container-level security context containerSecurityContext: {} eventsourceController: + # -- Event source controller name name: eventsource-controller + # -- Repository to use for the event source controller image: argoproj/argo-events + # -- Overrides the image tag + # @default -- `""` (default is the chart appVersion) tag: "" + # -- The number of event source controller pods to run replicaCount: 1 + # -- Additional environment variables to pass to event source controller extraEnv: [] # - name: DEBUG_LOG # value: "true" + + # -- Repository to use for the event source image eventsourceImage: argoproj/argo-events + # -- Annotations to be added to event source controller pods podAnnotations: {} + # -- [Node selector] nodeSelector: {} + # -- Labels to be added to event source controller pods podLabels: {} + # -- Priority class for the event source controller priorityClassName: "" + # -- [Tolerations] for use with node taints tolerations: [] + # -- Assign custom [affinity] rules to the event source controller affinity: {} + # -- Resource limits and requests for the event source controller pods resources: {} + # -- Event source controller container-level security context containerSecurityContext: {} eventbusController: + # -- Event bus controller name name: eventbus-controller + # -- Repository to use for the event bus controller image: argoproj/argo-events + # -- Overrides the image tag + # @default -- `""` (default is the chart appVersion) tag: "" + # -- The number of event bus controller pods to run replicaCount: 1 + # -- Additional environment variables to pass to event bus controller extraEnv: [] # - name: DEBUG_LOG # value: "true" + + # -- Annotations to be added to event bus controller pods podAnnotations: {} + # -- [Node selector] nodeSelector: {} + # -- Labels to be added to event event bus controller pods podLabels: {} + # -- Priority class for the event bus controller priorityClassName: "" + # -- [Tolerations] for use with node taints tolerations: [] + # -- Assign custom [affinity] rules to the event bus controller affinity: {} + # -- Resource limits and requests for the event bus controller pods resources: {} + # -- NATS streaming container image to use for the event bus natsStreamingImage: nats-streaming:0.22.1 + # -- NATS metrics exporter container image to use for the event bus natsMetricsExporterImage: natsio/prometheus-nats-exporter:0.8.0 + # -- Event bus controller container-level security context containerSecurityContext: {} +# -- Common PodSecurityContext for all controllers securityContext: runAsNonRoot: true runAsUser: 9731