瀏覽代碼

misc: helm sideload initContainer option (#4325)

***NO_CI***
Nold 3 年之前
父節點
當前提交
f4d9fd43f0
共有 3 個文件被更改,包括 24 次插入0 次删除
  1. 3 0
      dev/helm/README.md
  2. 10 0
      dev/helm/templates/deployment.yaml
  3. 11 0
      dev/helm/values.yaml

+ 3 - 0
dev/helm/README.md

@@ -108,6 +108,9 @@ The following table lists the configurable parameters of the Wiki.js chart and t
 | `ingress.annotations`                | Ingress annotations                         | `{}`                                                       |
 | `ingress.hosts`                      | List of ingress rules                        | `[{"host": "wiki.local", "paths": ["/"]}]`                |
 | `ingress.tls`                        | Ingress TLS configuration                   | `[]`                                                       |
+| `sideload.enabled`                   | Enable sideloading of locale files from git | `false`                                                    |
+| `sideload.repoURL`                   | Git repository URL containing locale files  | `https://github.com/Requarks/wiki-localization`            |
+| `sideload.env`                       | Environment variables for sideload Container | `{}`                                                      |
 | `postgresql.enabled`                 | Deploy postgres server (see below)          | `true`                                                     |
 | `postgresql.postgresqlDatabase`        | Postgres database name                      | `wiki`                                                   |
 | `postgresql.postgresqlUser`            | Postgres username                           | `postgres`                                                   |

+ 10 - 0
dev/helm/templates/deployment.yaml

@@ -21,6 +21,16 @@ spec:
       serviceAccountName: {{ include "wiki.serviceAccountName" . }}
       securityContext:
         {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      {{- if .Values.sideload.enabled }}
+      initContainers:
+        - name: {{ .Chart.Name }}-sideload
+          image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
+          imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
+          env:
+            {{- toYaml .Values.sideload.env | nindent 12 }}
+          command: [ "sh", "-c" ]
+          args: [ "mkdir -p /wiki/data/sideload && git clone --depth=1 {{ .Values.sideload.repoURL }} /wiki/data/sideload/" ]
+      {{- end }}
       containers:
         - name: {{ .Chart.Name }}
           securityContext:

+ 11 - 0
dev/helm/values.yaml

@@ -85,6 +85,17 @@ tolerations: []
 
 affinity: {}
 
+# This will allow us to install locales even without internet access using a initContainer & wikjs "sideloading"
+sideload:
+  enabled: false
+  # Git-Repo containing all locales.json-files you need:
+  repoURL: https://github.com/Requarks/wiki-localization
+
+  ## This can be helpfull if you have internet access over a http proxy:
+  env: []
+  #  - name: HTTPS_PROXY
+  #    value: http://my.proxy.com:3128
+
 ## Configuration values for the postgresql dependency.
 ## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
 ##