refactor(helm): adjust helm templates for clarity

pull/7936/head
NGPixel 5 days ago
parent 109b1d21e2
commit b3843ade7f
No known key found for this signature in database

@ -1,11 +1,7 @@
apiVersion: v2
name: wiki
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.4.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
AppVersion: latest
name: wiki-js
version: '3.0.0'
appVersion: '2'
description: The most powerful and extensible open source Wiki software.
keywords:
- wiki
@ -14,25 +10,8 @@ keywords:
- docs
- reference
- editor
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
home: https://wiki.js.org
home: https://js.wiki
icon: https://cdn.js.wiki/images/wikijs-butterfly.svg
sources:
- https://github.com/Requarks/wiki
maintainers:
- name: Nicolas Giard
email: github@ngpixel.com
url: https://github.com/NGPixel
- name: James Greenhill
email: james@fuziontech.net
url: https://github.com/fuziontech
engine: gotpl
- https://github.com/requarks/wiki

@ -59,7 +59,7 @@ $ helm repo add requarks https://charts.js.wiki
To install the chart with the release name `my-release` run the following:
### Using Helm 3:
### Using Helm 3/4:
```console
$ helm install my-release requarks/wiki
```
@ -95,7 +95,7 @@ The following table lists the configurable parameters of the Wiki.js chart and t
| Parameter | Description | Default |
| ------------------------------- | ------------------------------- | ---------------------------------------------------------- |
| `image.repository` | Wiki.js image | `requarks/wiki` |
| `image.tag` | Wiki.js image tag | `latest` |
| `image.tag` | Wiki.js image tag | `2` |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `replicacount` | Number of Wiki.js pods to run | `1` |
| `revisionHistoryLimit` | Total number of revision history points | `10` |
@ -119,16 +119,16 @@ The following table lists the configurable parameters of the Wiki.js chart and t
| `sideload.resources.limits` | Resource limits for the sideload container | `nil` |
| `sideload.resources.requests` | Resource requests for the sideload container | `nil` |
| `nodeExtraCaCerts` | Trusted certificates path | `nil` |
| `externalPostgresql.databaseURL` | External postgres connection string | `nil` |
| `postgresql.enabled` | Deploy postgres server (see below) | `true` |
| `postgresql.postgresqlDatabase` | Postgres database name | `wiki` |
| `postgresql.postgresqlUser` | Postgres username | `postgres` |
| `postgresql.postgresqlHost` | External postgres host | `nil` |
| `postgresql.postgresqlPassword` | External postgres password | `nil` |
| `postgresql.postgresqlHost` | Postgres host | `nil` |
| `postgresql.postgresqlPassword` | Postgres password | `nil` |
| `postgresql.existingSecret` | Provide an existing `Secret` for postgres | `nil` |
| `postgresql.existingSecretKey` | The postgres password key in the existing `Secret` | `postgresql-password` |
| `postgresql.existingSecretUserKey` | The postgres username key in the existing `Secret` | `postgresql-username` |
| `postgresql.existingSecretDatabaseKey` | The postgres database name key in the existing `Secret` | `postgresql-database` |
| `postgresql.postgresqlPort` | External postgres port | `5432` |
| `postgresql.postgresqlPort` | Postgres port | `5432` |
| `postgresql.ssl` | Enable external postgres SSL connection | `false` |
| `postgresql.ca` | Certificate of Authority content for postgres | `nil` |
| `postgresql.persistence.enabled` | Enable postgres persistence using PVC | `true` |
@ -137,7 +137,7 @@ The following table lists the configurable parameters of the Wiki.js chart and t
| `postgresql.persistence.size` | Postgres PVC Storage Request | `8Gi` |
| `postgresql.persistence.accessMode` | Postgres Persistent Volume Access Mode | `ReadWriteOnce` |
| `postgresql.image.repository` | PostgreSQL image repository | `postgres` |
| `postgresql.image.tag` | PostgreSQL image tag | `17.4` |
| `postgresql.image.tag` | PostgreSQL image tag | `18` |
| `postgresql.image.pullPolicy` | PostgreSQL image pull policy | `IfNotPresent` |
| `postgresql.resources` | PostgreSQL resource requests/limits | `{}` |
| `postgresql.nodeSelector` | PostgreSQL node selector labels | `{}` |
@ -165,24 +165,23 @@ $ helm install --name my-release -f values.yaml requarks/wiki
## PostgreSQL
By default, PostgreSQL is installed as part of the chart using the official PostgreSQL image from Docker Hub (version 17.4).
By default, PostgreSQL is installed as part of the chart using the official PostgreSQL image from Docker Hub (version 18).
### Using an external PostgreSQL server
To use an external PostgreSQL server, set `postgresql.enabled` to `false` and then set `postgresql.postgresqlHost` and `postgresql.postgresqlPassword`. To use an existing `Secret`, set `postgresql.existingSecret`. The other options (`postgresql.postgresqlDatabase`, `postgresql.postgresqlUser`, `postgresql.postgresqlPort` and `postgresql.existingSecretKey`) may also want changing from their default values.
To use an external PostgreSQL server, set `postgresql.enabled` to `false`, then use either:
To use an SSL connection you can set `postgresql.ssl` to `true` and if needed the path to a Certificate of Authority can be set using `postgresql.ca` to `/path/to/ca`. Default `postgresql.ssl` value is `false`.
#### Connection String
If `postgresql.existingSecret` is not specified, you also need to add the following Helm template to your deployment in order to create the postgresql `Secret`:
Set `externalPostgresql.databaseURL` to the full PostgreSQL connection string.
```yaml
kind: Secret
apiVersion: v1
metadata:
name: {{ template "wiki.postgresql.secret" . }}
data:
{{ template "wiki.postgresql.secretKey" . }}: "{{ .Values.postgresql.postgresqlPassword | b64enc }}"
```
#### Connection Parameters
Set `externalPostgresql.host`, `externalPostgres.port`, `externalPostgres.database`, `externalPostgres.username`, `externalPostgres.existingSecret` *(secret name)* and `externalPostgres.existingSecretKey` *(key in the secret containing the password)*
Ensure the secret specified in `externalPostgresql.existingSecret` already exists, with a password set at the path specified in `externalPostgres.existingSecretKey`.
To use an SSL connection you can set `externalPostgresql.ssl` to `true` and if needed the path to a Certificate of Authority can be set using `externalPostgresql.ca` to `/path/to/ca`. Default `externalPostgresql.ssl` value is `false`.
### Using an existing PostgreSQL secret with built-in PostgreSQL
@ -191,15 +190,12 @@ When using the built-in PostgreSQL (default behavior with `postgresql.enabled: t
- `postgresql.existingSecret`: Name of the existing secret containing the credentials
- `postgresql.existingSecretKey`: Key in the secret containing the password (defaults to `postgresql-password`)
- `postgresql.existingSecretUserKey`: Key in the secret containing the username (defaults to `postgresql-username`)
- `postgresql.existingSecretDatabaseKey`: Key in the secret containing the database name (defaults to `postgresql-database`)
Example usage:
```bash
# Create your existing secret
kubectl create secret generic my-postgres-secret \
--from-literal=postgresql-username=postgres \
--from-literal=postgresql-password=yourpassword \
--from-literal=postgresql-database=wiki
--from-literal=postgresql-password=yourpassword
# Deploy with existing secret
helm install my-release requarks/wiki \

@ -29,7 +29,7 @@ spec:
- name: {{ .Chart.Name }}-sideload
securityContext:
{{- toYaml .Values.sideload.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
image: "{{ .Values.image.repository }}:{{ default "2" .Values.image.tag }}"
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
env:
{{- toYaml .Values.sideload.env | nindent 12 }}
@ -42,7 +42,7 @@ spec:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ default "latest" .Values.image.tag }}"
image: "{{ .Values.image.repository }}:{{ default "2" .Values.image.tag }}"
imagePullPolicy: {{ default "IfNotPresent" .Values.image.imagePullPolicy }}
env:
{{- if .Values.nodeExtraCaCerts }}
@ -62,14 +62,7 @@ spec:
- name: DB_PORT
value: "{{ default "5432" .Values.postgresql.postgresqlPort }}"
- name: DB_NAME
{{- if .Values.postgresql.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.existingSecret }}
key: {{ template "wiki.postgresql.secretDatabaseKey" . }}
{{- else }}
value: {{ default "wiki" .Values.postgresql.postgresqlDatabase }}
{{- end }}
value: {{ default "wiki" .Values.postgresql.postgresqlDatabase | quote }}
- name: DB_USER
{{- if .Values.postgresql.existingSecret }}
valueFrom:
@ -103,6 +96,10 @@ spec:
secretKeyRef:
name: {{ required "External PostgreSQL secret name is required when postgresql.enabled is false" .Values.externalPostgresql.existingSecret | quote }}
key: {{ required "External PostgreSQL secret key is required when postgresql.enabled is false" .Values.externalPostgresql.existingSecretKey | quote }}
- name: DB_SSL
value: "{{ default "false" .Values.externalPostgresql.ssl }}"
- name: DB_SSL_CA
value: "{{ default "" .Values.externalPostgresql.ca }}"
{{- end }}
- name: HA_ACTIVE
value: {{ .Values.replicaCount | int | le 2 | quote }}

@ -9,5 +9,4 @@ type: Opaque
data:
postgresql-password: {{ .Values.postgresql.postgresqlPassword | b64enc | quote }}
postgresql-username: {{ .Values.postgresql.postgresqlUser | b64enc | quote }}
postgresql-database: {{ .Values.postgresql.postgresqlDatabase | b64enc | quote }}
{{- end }}

@ -37,17 +37,7 @@ spec:
name: postgresql
env:
- name: POSTGRES_DB
{{- if .Values.postgresql.existingSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.postgresql.existingSecret }}
key: {{ default "postgresql-database" .Values.postgresql.existingSecretDatabaseKey | quote }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "wiki.postgresql.fullname" . }}
key: postgresql-database
{{- end }}
value: {{ .Values.postgresql.postgresqlDatabase | quote }}
- name: POSTGRES_USER
{{- if .Values.postgresql.existingSecret }}
valueFrom:

@ -19,8 +19,4 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: {{ default "443" .Values.service.httpsPort}}
targetPort: http
protocol: TCP
name: https
selector: {{- include "wiki.selectorLabels" . | nindent 4}}

@ -3,7 +3,7 @@
# Declare variables to be passed into your templates.
replicaCount: 1
revisionHistoryLimit: 10
revisionHistoryLimit: 2
image:
repository: requarks/wiki
@ -61,7 +61,6 @@ service:
# Annotations applied for services such as externalDNS or
# service type LoadBalancer
# type: LoadBalancer
# httpsPort: 443
# annotations: {}
# loadBalancerIP: 172.16.0.1
@ -108,7 +107,7 @@ volumes: []
sideload:
enabled: false
# Git-Repo containing all locales.json-files you need:
repoURL: https://github.com/Requarks/wiki-localization
repoURL: https://github.com/requarks/wiki-localization
## This can be helpfull if you have internet access over a http proxy:
env: []
@ -156,7 +155,7 @@ extraEnvVars: []
# # For self signed CAs, like DigitalOcean
# NODE_TLS_REJECT_UNAUTHORIZED: "0"
## Configuration for the custom PostgreSQL 17.4 deployment
## Configuration for the custom PostgreSQL 18 deployment
##
postgresql:
enabled: true
@ -199,10 +198,6 @@ postgresql:
##
# existingSecretUserKey: "postgresql-username"
## Key in the existing secret containing the database name (defaults to "postgresql-database")
##
# existingSecretDatabaseKey: "postgresql-database"
## Persistent Volume Storage configuration.
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes
##
@ -228,7 +223,7 @@ postgresql:
## PostgreSQL Image Configuration
image:
repository: postgres
tag: "17.4"
tag: "18"
pullPolicy: IfNotPresent
## PostgreSQL Resources Configuration

Loading…
Cancel
Save