-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
246 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v2 | ||
appVersion: "4.0.2" | ||
name: node-red | ||
description: Low-code programming for event-driven applications. | ||
type: application | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# node-red | ||
|
||
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 4.0.2](https://img.shields.io/badge/AppVersion-4.0.2-informational?style=flat-square) | ||
|
||
Low-code programming for event-driven applications. | ||
|
||
## Install | ||
|
||
> [!WARNING] | ||
> You won't be able to authenticate without setting `nodeRed.settings.adminAuth.users` properly. | ||
```shell | ||
$ helm upgrade \ | ||
--create-namespace \ | ||
--install node-red node-red \ | ||
--namespace node-red \ | ||
--repo https://th0th.github.io/helm-charts \ | ||
--values values.yaml \ | ||
--version 0.1.0 | ||
``` | ||
|
||
## Uninstall | ||
|
||
```shell | ||
$ helm uninstall --namespace node-red node-red | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|----------------------------------|--------|---------------------------------------------------|----------------------------------------| | ||
| ingress.annotations | object | `{}` | annotations for the ingress | | ||
| ingress.enabled | bool | `false` | enable the ingress | | ||
| ingress.host | string | `"node-red.local"` | host for the ingress | | ||
| ingress.tls | list | `[]` | tls configuration for the ingress | | ||
| nodeRed.image.repository | string | `"nodered/node-red"` | node-red image repository | | ||
| nodeRed.image.tag | string | `"latest"` | node-red image tag | | ||
| nodeRed.persistence.enabled | bool | `true` | enable persistence | | ||
| nodeRed.resources | object | `{}` | resources for the node-red statefulset | | ||
| nodeRed.settings | object | `{"adminAuth":{"type":"credentials","users":[]}}` | node-red settings | | ||
| nodeRed.settings.adminAuth | object | `{"type":"credentials","users":[]}` | admin authentication config | | ||
| nodeRed.settings.adminAuth.users | list | `[]` | list of users | | ||
| nodeRed.timeZone | string | `"America/New_York"` | time zone | | time zone | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{{- define "nodeRed.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{- define "nodeRed.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 }} | ||
|
||
{{- define "nodeRed.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{- define "nodeRed.labels" -}} | ||
helm.sh/chart: {{ include "nodeRed.chart" . }} | ||
{{ include "nodeRed.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{- define "nodeRed.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "nodeRed.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{- define "nodeRed.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "nodeRed.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "nodeRed.fullname" . }}-node-red | ||
labels: | ||
{{- include "nodeRed.labels" . | nindent 4 }} | ||
data: | ||
settings.js: | | ||
module.exports = { | ||
adminAuth: { | ||
type: "{{ required "A valid .Values.nodeRed.settings.adminAuth.type is required!" .Values.nodeRed.settings.adminAuth.type }}", | ||
users: [ | ||
{{- range (.Values.nodeRed.settings.adminAuth.users | default list) }} | ||
{ | ||
password: "{{ .password }}", | ||
permissions: "{{ .permissions }}", | ||
username: "{{ .username }}", | ||
}, | ||
{{- end }} | ||
], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{{ if .Values.ingress.enabled }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: {{ include "nodeRed.fullname" . }}-node-red | ||
labels: | ||
{{- include "nodeRed.labels" . | nindent 4 }} | ||
annotations: | ||
{{- toYaml .Values.ingress.annotations | nindent 4 }} | ||
spec: | ||
rules: | ||
- host: {{ .Values.ingress.host}} | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: '{{ include "nodeRed.fullname" . }}-node-red' | ||
port: | ||
name: http | ||
path: / | ||
pathType: Prefix | ||
tls: | ||
{{- toYaml .Values.ingress.tls | nindent 4 }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "nodeRed.fullname" . }}-node-red | ||
labels: | ||
{{- include "nodeRed.labels" . | nindent 4 }} | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
statefulSet: node-red | ||
{{- include "nodeRed.selectorLabels" . | nindent 4 }} | ||
ports: | ||
- name: http | ||
port: 1880 | ||
protocol: TCP | ||
targetPort: 1880 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: {{ include "nodeRed.fullname" . }}-node-red | ||
labels: | ||
{{- include "nodeRed.labels" . | nindent 4 }} | ||
spec: | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Retain | ||
whenScaled: Retain | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
statefulSet: node-red | ||
{{- include "nodeRed.selectorLabels" . | nindent 6 }} | ||
serviceName: node-red-hl | ||
template: | ||
metadata: | ||
labels: | ||
statefulSet: node-red | ||
{{- include "nodeRed.selectorLabels" . | nindent 8 }} | ||
name: node-red | ||
spec: | ||
containers: | ||
- env: | ||
- name: TZ | ||
value: {{ .Values.nodeRed.timeZone }} | ||
image: {{ .Values.nodeRed.image.repository }}:{{ .Values.nodeRed.image.tag }} | ||
name: node-red | ||
resources: {{- toYaml .Values.nodeRed.resources | nindent 12 }} | ||
volumeMounts: | ||
- mountPath: /data | ||
name: data | ||
subPath: node-red-data | ||
- mountPath: /data/settings.js | ||
name: configmap-node-red | ||
subPath: settings.js | ||
volumes: | ||
- configMap: | ||
name: {{ include "nodeRed.fullname" . }}-node-red | ||
name: configmap-node-red | ||
volumeClaimTemplates: | ||
- kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: data | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi | ||
volumeMode: Filesystem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ingress: | ||
# -- annotations for the ingress | ||
annotations: { } | ||
# -- enable the ingress | ||
enabled: false | ||
# -- host for the ingress | ||
host: node-red.local | ||
# -- tls configuration for the ingress | ||
tls: [ ] | ||
nodeRed: | ||
image: | ||
# -- node-red image repository | ||
repository: nodered/node-red | ||
# -- node-red image tag | ||
tag: latest | ||
persistence: | ||
# -- enable persistence | ||
enabled: true | ||
# -- resources for the node-red statefulset | ||
resources: { } | ||
# -- node-red settings | ||
settings: | ||
# -- admin authentication config | ||
adminAuth: | ||
type: credentials | ||
# -- list of users | ||
users: [ ] | ||
# - password: "$2y$08$q7DQYqhJrLC0.NnLelnre.IUaE2wQX3/xBiQ1cyAuNva8i5A6760q" | ||
# permissions: "*" | ||
# username: admin | ||
# -- time zone | ||
timeZone: America/New_York |