Skip to content

Commit f4d9fd4

Browse files
authored
misc: helm sideload initContainer option (#4325)
***NO_CI***
1 parent 5c99cf3 commit f4d9fd4

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

dev/helm/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ The following table lists the configurable parameters of the Wiki.js chart and t
108108
| `ingress.annotations` | Ingress annotations | `{}` |
109109
| `ingress.hosts` | List of ingress rules | `[{"host": "wiki.local", "paths": ["/"]}]` |
110110
| `ingress.tls` | Ingress TLS configuration | `[]` |
111+
| `sideload.enabled` | Enable sideloading of locale files from git | `false` |
112+
| `sideload.repoURL` | Git repository URL containing locale files | `https://github.com/Requarks/wiki-localization` |
113+
| `sideload.env` | Environment variables for sideload Container | `{}` |
111114
| `postgresql.enabled` | Deploy postgres server (see below) | `true` |
112115
| `postgresql.postgresqlDatabase` | Postgres database name | `wiki` |
113116
| `postgresql.postgresqlUser` | Postgres username | `postgres` |

dev/helm/templates/deployment.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ spec:
2121
serviceAccountName: {{ include "wiki.serviceAccountName" . }}
2222
securityContext:
2323
{{- toYaml .Values.podSecurityContext | nindent 8 }}
24+
{{- if .Values.sideload.enabled }}
25+
initContainers:
26+
- name: {{ .Chart.Name }}-sideload
27+
image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
28+
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
29+
env:
30+
{{- toYaml .Values.sideload.env | nindent 12 }}
31+
command: [ "sh", "-c" ]
32+
args: [ "mkdir -p /wiki/data/sideload && git clone --depth=1 {{ .Values.sideload.repoURL }} /wiki/data/sideload/" ]
33+
{{- end }}
2434
containers:
2535
- name: {{ .Chart.Name }}
2636
securityContext:

dev/helm/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ tolerations: []
8585

8686
affinity: {}
8787

88+
# This will allow us to install locales even without internet access using a initContainer & wikjs "sideloading"
89+
sideload:
90+
enabled: false
91+
# Git-Repo containing all locales.json-files you need:
92+
repoURL: https://github.com/Requarks/wiki-localization
93+
94+
## This can be helpfull if you have internet access over a http proxy:
95+
env: []
96+
# - name: HTTPS_PROXY
97+
# value: http://my.proxy.com:3128
98+
8899
## Configuration values for the postgresql dependency.
89100
## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
90101
##

0 commit comments

Comments
 (0)