Skip to content

Commit

Permalink
feat: add "helm.sh/resource-policy" annotation
Browse files Browse the repository at this point in the history
Signed-off-by: Engin Diri <engin.diri@ediri.de>
  • Loading branch information
dirien committed Apr 25, 2023
1 parent ca1718e commit f0bb9f4
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
4 changes: 2 additions & 2 deletions charts/node-red/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ icon: https://nodered.org/about/resources/media/node-red-icon-2.png

type: application

version: 0.22.8
version: 0.23.0
appVersion: 3.0.2

keywords:
Expand All @@ -29,7 +29,7 @@ maintainers:
annotations:
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/changes: |
- update quay.io/kiwigrid/k8s-sidecar to 1.23.1
- add "helm.sh/resource-policy" annotation to prevent helm from deleting the PVC
artifacthub.io/images: |
- name: node-red
image: docker.io/nodered/node-red:3.0.2
Expand Down
7 changes: 4 additions & 3 deletions charts/node-red/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-red ⚙

![Version: 0.22.8](https://img.shields.io/badge/Version-0.22.8-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 3.0.2](https://img.shields.io/badge/AppVersion-3.0.2-informational?style=for-the-badge)
![Version: 0.23.0](https://img.shields.io/badge/Version-0.23.0-informational?style=for-the-badge) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=for-the-badge) ![AppVersion: 3.0.2](https://img.shields.io/badge/AppVersion-3.0.2-informational?style=for-the-badge)

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/node-red&style=for-the-badge)](https://artifacthub.io/packages/search?repo=node-red)
[![SIT](https://img.shields.io/badge/SIT-awesome-blueviolet.svg?style=for-the-badge)](https://jobs.schwarz)
Expand All @@ -16,7 +16,7 @@ A Helm chart for Node-Red, a low-code programming for event-driven applications
To install the chart using the OCI artifact, run:

```bash
helm install node-red oci://ghcr.io/schwarzit/charts/node-red --version 0.22.8
helm install node-red oci://ghcr.io/schwarzit/charts/node-red --version 0.23.0
```

## Usage
Expand All @@ -32,7 +32,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.22.8
helm install node-red node-red/node-red --version 0.23.0
```

After a few seconds, node-red should be running.
Expand Down Expand Up @@ -98,6 +98,7 @@ The command removes all the Kubernetes components associated with the chart and
| 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.keepPVC | bool | `false` | ## Keep a created Persistent volume claim when uninstalling the helm chart (default: false) |
| persistence.size | string | `"5Gi"` | Size of persistent volume claim |
| podAnnotations | object | `{}` | Pod annotations |
| podLabels | object | `{}` | Labels to add to the node-red pod. default: {} |
Expand Down
6 changes: 5 additions & 1 deletion charts/node-red/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ metadata:
helm.sh/chart: {{ include "node-red.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.persistence.keepPVC }}
annotations:
helm.sh/resource-policy: keep
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
Expand All @@ -21,4 +25,4 @@ spec:
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
56 changes: 29 additions & 27 deletions charts/node-red/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npmrc:
# Custom npmrc config
# -- node-red env, see more environment variables in the [node-red documentation](https://nodered.org/docs/getting-started/docker)
env: []
env: [ ]
# Possible Values:
# TZ:
# NODE_OPTIONS:
Expand All @@ -43,25 +43,25 @@ env: []
# example:
# env:
# - name: "NODE_RED_ENABLE_SAFE_MODE"
# value: ""
# value: ""

serviceAccount:
# Specifies whether a service account should be created
# -- Create service account
create: true
# Annotations to add to the service account
# -- Additional ServiceAccount annotations
annotations: {}
annotations: { }
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
# -- Service account name to use, when empty will be set to created account if
name: ""

# -- Pod annotations
podAnnotations: {}
podAnnotations: { }

# -- Deployment annotations
deploymentAnnotations: {}
deploymentAnnotations: { }

# -- Pod Security Context see [values.yaml](values.yaml)
podSecurityContext:
Expand Down Expand Up @@ -99,21 +99,21 @@ metrics:
# -- Enable a prometheus ServiceMonitor
enabled: false
# -- Prometheus basicAuth configuration for ServiceMonitor endpoint
basicAuth: {}
basicAuth: { }
# -- Prometheus ServiceMonitor interval
interval: 30s
# -- Prometheus [RelabelConfigs] to apply to samples before scraping
relabelings: []
relabelings: [ ]
# -- Prometheus [MetricRelabelConfigs] to apply to samples before ingestion
metricRelabelings: []
metricRelabelings: [ ]
# -- Prometheus ServiceMonitor selector
selector: {}
selector: { }
# prometheus: kube-prometheus

# -- Prometheus ServiceMonitor namespace
namespace: "" # "monitoring"
# -- Prometheus ServiceMonitor labels
additionalLabels: {}
additionalLabels: { }

persistence:
# -- Use persistent volume to store data
Expand All @@ -136,29 +136,31 @@ persistence:
accessMode: ReadWriteOnce
# -- Size of persistent volume claim
size: 5Gi
# -- ## Keep a created Persistent volume claim when uninstalling the helm chart (default: false)
keepPVC: false

# -- containers which are run before the app containers are started
initContainers: []
initContainers: [ ]

ingress:
# -- Enable an ingress resource for the server
enabled: false
# -- Defines which ingress controller will implement the resource
className: ""
# -- Additional ingress annotations
annotations: {}
annotations: { }
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# kubernetes.io/tls-acme: "true"
hosts:
# Ingress accepted hostnames
- host: chart-example.local
paths:
# -- The base path
# -- The base path
- path: /
# -- Ingress type of path
pathType: ImplementationSpecific
# -- Ingress TLS configuration
tls: []
tls: [ ]
# -- Secret name for the certificate
# - secretName: chart-example-tls
# -- Hostnames for the Ingress
Expand All @@ -175,7 +177,7 @@ ingress:
# -- Kind of the Issuer
# kind: ClusterIssuer
# -- Name of the Issuer
# name: "test"
# name: "test"

# -- CPU/Memory resource requests/limits
resources:
Expand All @@ -191,13 +193,13 @@ resources:
memory: 128Mi

# -- Node selector
nodeSelector: {}
nodeSelector: { }

# -- Toleration labels for pod assignment
tolerations: []
tolerations: [ ]

# -- The affinity constraint
affinity: {}
affinity: { }

# -- Extra Volumes for the pod
extraVolumes:
Expand All @@ -214,18 +216,18 @@ extraVolumeMounts:
# mountPath: /test

# -- You can configure node-red using a settings file. default: {}
settings: {}
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

# -- Labels to add to the node-red pod. default: {}
podLabels: {}
podLabels: { }

# -- You can configure extra sidecars containers to run alongside the node-red pod. default: []
extraSidecars: []
extraSidecars: [ ]
# - name: sidecar-example
# image: busybox
# command: ["/bin/sh", "-c", "echo hello from sidecar"]
Expand All @@ -251,17 +253,17 @@ sidecar:
# -- Password as key value pair
password: ""
# -- Password from existing secret
passwordFromExistingSecret: {}
passwordFromExistingSecret: { }
# -- Name of the secret that contains the password
# name: node-red-api-admin-password
# -- Key of the secret that contains the password
# key: password
# -- Extra Environments for the sidecar
extraEnv: []
extraEnv: [ ]
# -- Resources for the sidecar
resources: {}
resources: { }
# -- Security context for the sidecar
securityContext: {}
securityContext: { }
# Image for the sidecar
image:
# -- The image registry to pull the sidecar from
Expand All @@ -273,4 +275,4 @@ sidecar:
# -- The image pull policy, default: `IfNotPresent`
pullPolicy: IfNotPresent
# -- The extra volume mounts for the sidecar
volumeMounts: []
volumeMounts: [ ]

0 comments on commit f0bb9f4

Please sign in to comment.