Skip to content

Commit

Permalink
Add n8n chart
Browse files Browse the repository at this point in the history
  • Loading branch information
th0th committed Oct 13, 2024
1 parent 5b70f35 commit ecf8322
Show file tree
Hide file tree
Showing 17 changed files with 548 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.idea/GOHCache.xml
.DS_Store
6 changes: 0 additions & 6 deletions .idea/GOHCache.xml

This file was deleted.

203 changes: 203 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions charts/n8n/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v2
appVersion: "1.62.5"
name: n8n
description: An extendable workflow automation tool.
type: application
version: 0.1.0
44 changes: 44 additions & 0 deletions charts/n8n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# n8n

![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: 1.62.5](https://img.shields.io/badge/AppVersion-1.62.5-informational?style=flat-square)

An extendable workflow automation tool.

## Install

```shell
$ helm upgrade n8n n8n \
--create-namespace \
--install \
--namespace n8n \
--repo https://th0th.github.io/helm-charts \
--values values.yaml \
--version 0.1.0
```

## Uninstall

```shell
$ helm uninstall --namespace n8n n8n
```

## Values

| Key | Type | Default | Description |
|---------------------------|--------|-----------------------------|--------------------------------------------------------------------------------------------------------------------------|
| encryptionKey | string | `""` | n8n encryption key (see [docs](https://docs.n8n.io/hosting/configuration/environment-variables/deployment/)) |
| env | object | `{}` | environment variables to be passed to n8n (see [docs](https://docs.n8n.io/hosting/configuration/environment-variables/)) |
| image.pullPolicy | string | `"IfNotPresent"` | n8n image pull policy |
| image.repository | string | `"docker.n8n.io/n8nio/n8n"` | n8n image repository |
| image.tag | string | `"1.62.5"` | n8n image tag |
| ingress.annotations | object | `{}` | the ingress annotations |
| ingress.enabled | bool | `false` | enable the ingress |
| ingress.hosts | list | `[]` | the ingress host |
| postgres.database | string | `"n8n"` | the postgres database name |
| postgres.enabled | bool | `true` | enable the postgres statefulset |
| postgres.image.repository | string | `"postgres"` | the postgres image repository |
| postgres.image.tag | string | `"17-alpine"` | the postgres image tag |
| postgres.password | string | `"n8n"` | the postgres password |
| postgres.resources | object | `{}` | resources configuration for the postgres statefulset |
| postgres.user | string | `"n8n"` | the postgres user |
| replicas | int | `1` | number of n8n deployment replicas | |
42 changes: 42 additions & 0 deletions charts/n8n/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- define "n8n.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "n8n.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 "n8n.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "n8n.labels" -}}
helm.sh/chart: {{ include "n8n.chart" . }}
{{ include "n8n.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "n8n.selectorLabels" -}}
app.kubernetes.io/name: {{ include "n8n.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "n8n.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "n8n.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/n8n/templates/configmap-n8n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "n8n.fullname" . }}-n8n
labels:
{{- include "n8n.labels" . | nindent 4 }}
data:
{{ .Values.env | toYaml | nindent 2 }}
10 changes: 10 additions & 0 deletions charts/n8n/templates/configmap-postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "n8n.fullname" . }}-postgres
labels:
{{- include "n8n.labels" . | nindent 4 }}
data:
DATABASE: "{{ .Values.postgres.database}}"
HOST: "{{ include "n8n.fullname" . }}-postgres"
PORT: "5432"
Loading

0 comments on commit ecf8322

Please sign in to comment.