From 881696bc85ddf18aeceba94e8a94368673fd0e16 Mon Sep 17 00:00:00 2001 From: Engin Diri Date: Fri, 18 Mar 2022 11:36:20 +0100 Subject: [PATCH] feat: add support for sidecars (#85) * feat: add support for sidecars Signed-off-by: Engin Diri * feat: add support for sidecars Signed-off-by: Engin Diri --- charts/node-red/Chart.yaml | 4 +- charts/node-red/README.md | 91 ++++++++++++----------- charts/node-red/templates/deployment.yaml | 5 ++ charts/node-red/values.yaml | 11 ++- 4 files changed, 62 insertions(+), 49 deletions(-) diff --git a/charts/node-red/Chart.yaml b/charts/node-red/Chart.yaml index 13b7053c..07009dac 100644 --- a/charts/node-red/Chart.yaml +++ b/charts/node-red/Chart.yaml @@ -9,7 +9,7 @@ icon: https://nodered.org/about/resources/media/node-red-icon-2.png type: application -version: 0.11.0 +version: 0.12.0 appVersion: 2.2.2 keywords: @@ -29,7 +29,7 @@ maintainers: annotations: artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/changes: | - - add support for custom settings.js + - add sidcar support artifacthub.io/images: | - name: node-red image: docker.io/nodered/node-red:2.2.2 diff --git a/charts/node-red/README.md b/charts/node-red/README.md index 88c3dd41..b31ebd3c 100644 --- a/charts/node-red/README.md +++ b/charts/node-red/README.md @@ -1,6 +1,6 @@ # node-red ⚙ -![Version: 0.11.0](https://img.shields.io/badge/Version-0.11.0-informational?style=for-the-badge) +![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 2.2.2](https://img.shields.io/badge/AppVersion-2.2.2-informational?style=for-the-badge) @@ -26,7 +26,7 @@ helm repo update To install the chart with the release name node-red run: ```bash -helm install node-red node-red/node-red --version 0.11.0 +helm install node-red node-red/node-red --version 0.12.0 ``` After a few seconds, node-red should be running. @@ -52,46 +52,47 @@ The command removes all the Kubernetes components associated with the chart and ## Values -| Key | Type | Default | Description | -|------------------------------------|--------|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------| -| affinity | object | `{}` | The affinity constraint | -| deploymentStrategy | string | `""` | Specifies the strategy used to replace old Pods by new ones, default: `RollingUpdate` | -| env | list | `[]` | node-red env, see more environment variables in the [node-red documentation](https://nodered.org/docs/getting-started/docker) | -| extraVolumeMounts | string | `nil` | Extra Volume Mounts for the node-red pod | -| extraVolumes | string | `nil` | Extra Volumes for the pod | -| fullnameOverride | string | `""` | String to fully override "node-red.fullname" | -| image.pullPolicy | string | `"IfNotPresent"` | The image pull policy | -| image.registry | string | `"docker.io"` | The image registry to pull from | -| image.repository | string | `"nodered/node-red"` | The image repository to pull from | -| image.tag | string | `""` | The image tag to pull, default: `Chart.appVersion` | -| imagePullSecrets | string | `""` | The image pull secrets | -| ingress.annotations | object | `{}` | Additional ingress annotations | -| ingress.className | string | `""` | Defines which ingress controller will implement the resource | -| ingress.enabled | bool | `false` | Enable an ingress resource for the server | -| ingress.hosts[0] | object | `{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}` | Ingress accepted hostnames | -| ingress.hosts[0].paths[0] | object | `{"path":"/","pathType":"ImplementationSpecific"}` | The base path | -| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | Ingress type of path | -| ingress.tls | list | `[]` | Ingress TLS configuration | -| initContainers | list | `[]` | containers which are run before the app containers are started | -| nameOverride | string | `""` | Provide a name in place of node-red | -| nodeSelector | object | `{}` | Node selector | -| npmrc.enabled | bool | `false` | Enable custom npmrc config | -| npmrc.registry | string | `"https://registry.npmjs.org"` | Configuration to use any compatible registry | -| persistence.accessMode | string | `"ReadWriteOnce"` | Persistence access mode | -| persistence.enabled | bool | `false` | Use persistent volume to store data | -| persistence.size | string | `"5Gi"` | Size of persistent volume claim | -| podAnnotations | object | `{}` | Pod annotations | -| podSecurityContext | object | `{}` | Pod Security Context see [values.yaml](values.yaml) | -| replicaCount | int | `1` | Number of nodes | -| resources | object | `{}` | CPU/Memory resource requests/limits | -| securityContext | object | `{}` | Security Context see [values.yaml](values.yaml) | -| service.port | int | `1880` | Kubernetes port where service is exposed | -| service.type | string | `"ClusterIP"` | Kubernetes service type | -| serviceAccount.annotations | object | `{}` | Additional ServiceAccount annotations | -| serviceAccount.create | bool | `true` | Create service account | -| serviceAccount.name | string | `""` | Service account name to use, when empty will be set to created account if | -| settings | object | `{}` | You can configure Node-RED using a settings file. default: {} | -| tolerations | list | `[]` | Toleration labels for pod assignment | +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| affinity | object | `{}` | The affinity constraint | +| deploymentStrategy | string | `""` | Specifies the strategy used to replace old Pods by new ones, default: `RollingUpdate` | +| env | list | `[]` | node-red env, see more environment variables in the [node-red documentation](https://nodered.org/docs/getting-started/docker) | +| extraVolumeMounts | string | `nil` | Extra Volume Mounts for the node-red pod | +| extraVolumes | string | `nil` | Extra Volumes for the pod | +| fullnameOverride | string | `""` | String to fully override "node-red.fullname" | +| image.pullPolicy | string | `"IfNotPresent"` | The image pull policy | +| image.registry | string | `"docker.io"` | The image registry to pull from | +| image.repository | string | `"nodered/node-red"` | The image repository to pull from | +| image.tag | string | `""` | The image tag to pull, default: `Chart.appVersion` | +| imagePullSecrets | string | `""` | The image pull secrets | +| ingress.annotations | object | `{}` | Additional ingress annotations | +| ingress.className | string | `""` | Defines which ingress controller will implement the resource | +| ingress.enabled | bool | `false` | Enable an ingress resource for the server | +| ingress.hosts[0] | object | `{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}` | Ingress accepted hostnames | +| ingress.hosts[0].paths[0] | object | `{"path":"/","pathType":"ImplementationSpecific"}` | The base path | +| ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | Ingress type of path | +| ingress.tls | list | `[]` | Ingress TLS configuration | +| initContainers | list | `[]` | containers which are run before the app containers are started | +| nameOverride | string | `""` | Provide a name in place of node-red | +| nodeSelector | object | `{}` | Node selector | +| npmrc.enabled | bool | `false` | Enable custom npmrc config | +| npmrc.registry | string | `"https://registry.npmjs.org"` | Configuration to use any compatible registry | +| persistence.accessMode | string | `"ReadWriteOnce"` | Persistence access mode | +| persistence.enabled | bool | `false` | Use persistent volume to store data | +| persistence.size | string | `"5Gi"` | Size of persistent volume claim | +| podAnnotations | object | `{}` | Pod annotations | +| podSecurityContext | object | `{}` | Pod Security Context see [values.yaml](values.yaml) | +| replicaCount | int | `1` | Number of nodes | +| resources | object | `{}` | CPU/Memory resource requests/limits | +| securityContext | object | `{}` | Security Context see [values.yaml](values.yaml) | +| service.port | int | `1880` | Kubernetes port where service is exposed | +| service.type | string | `"ClusterIP"` | Kubernetes service type | +| serviceAccount.annotations | object | `{}` | Additional ServiceAccount annotations | +| serviceAccount.create | bool | `true` | Create service account | +| serviceAccount.name | string | `""` | Service account name to use, when empty will be set to created account if | +| settings | object | `{}` | You can configure node-red using a settings file. default: {} | +| sidecars | list | `[]` | You can configure a sidecar containers to run alongside the node-red pod. default: [] | +| tolerations | list | `[]` | Toleration labels for pod assignment | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, @@ -123,7 +124,7 @@ Apache License, Version 2.0 ## Maintainers -| Name | Email | Url | -|--------|-----------------------------|----------------------| -| dirien | engin.diri@mail.schwarz | https://jobs.schwarz | +| Name | Email | Url | +| ---- | ------ | --- | +| dirien | engin.diri@mail.schwarz | https://jobs.schwarz | | Kaktor | felix.kammerer@mail.schwarz | https://jobs.schwarz | \ No newline at end of file diff --git a/charts/node-red/templates/deployment.yaml b/charts/node-red/templates/deployment.yaml index d97d3d25..d2623fdd 100644 --- a/charts/node-red/templates/deployment.yaml +++ b/charts/node-red/templates/deployment.yaml @@ -50,6 +50,11 @@ spec: {{- end }} {{- end }} containers: + {{- if .Values.sidecars }} + {{- with .Values.sidecars }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end}} - name: {{ .Chart.Name }} {{- if .Values.securityContext }} securityContext: diff --git a/charts/node-red/values.yaml b/charts/node-red/values.yaml index 5498dd6c..5a825db1 100644 --- a/charts/node-red/values.yaml +++ b/charts/node-red/values.yaml @@ -175,10 +175,17 @@ extraVolumeMounts: # - name: test # mountPath: /test -# -- You can configure Node-RED using a settings file. default: {} +# -- You can configure node-red using a settings file. default: {} settings: {} # Details about the content of the settings.js, you can lookup under # https://nodered.org/docs/user-guide/runtime/settings-file # The ConfigMap should already exist and the key must be named `settings.js` # name: settings-config -# configMapName: settings-config \ No newline at end of file +# configMapName: settings-config + + +# -- You can configure a sidecar containers to run alongside the node-red pod. default: [] +sidecars: [] +# - name: sidecar-example +# image: busybox +# command: ["/bin/sh", "-c", "echo hello from sidecar"]