diff --git a/README.md b/README.md index 688433d..163c414 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,10 @@

+ +

+ +

@@ -25,6 +29,7 @@ The code in this repository is provided as-is with no warranties. | ----- | ----------- | | [# it-tools it-tools icon](https://github.com/plcnk/charts/tree/master/charts/it-tools/) | Collection of handy online tools for developers, with great UX. | | [# moodist moodist icon](https://github.com/plcnk/charts/tree/master/charts/moodist/) | Ambient sounds for focus and calm. | +| [# wikijs wikijs icon](https://github.com/plcnk/charts/tree/master/charts/wikijs/) | A modern, lightweight and powerful wiki app built on NodeJS. | ## License diff --git a/charts/wikijs/.helmignore b/charts/wikijs/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/charts/wikijs/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/wikijs/Chart.lock b/charts/wikijs/Chart.lock new file mode 100644 index 0000000..c06fe6b --- /dev/null +++ b/charts/wikijs/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: common + repository: https://bjw-s.github.io/helm-charts + version: 3.3.2 +- name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 15.5.20 +digest: sha256:5dcb60c693f2b80a844ae8bcfb1652a0753263147942875ede90f92e3d13a536 +generated: "2024-08-18T22:34:50.543553253+02:00" diff --git a/charts/wikijs/Chart.yaml b/charts/wikijs/Chart.yaml new file mode 100644 index 0000000..5654f86 --- /dev/null +++ b/charts/wikijs/Chart.yaml @@ -0,0 +1,33 @@ +apiVersion: v2 +name: wikijs +description: A modern, lightweight and powerful wiki app built on NodeJS. +home: https://github.com/plcnk/charts/tree/master/charts/wikijs +icon: https://raw.githubusercontent.com/plcnk/charts/master/charts/wikijs/icon.svg +type: application +version: 0.1.0 +# renovate datasource=docker depName=ghcr.io/requarks/wiki +appVersion: "2.5.303" +kubeVersion: ">=1.22.0-0" +keywords: + - wikijs + - wiki + - documentation +dependencies: + - name: common + repository: https://bjw-s.github.io/helm-charts + version: 3.3.2 + - name: postgresql + repository: https://charts.bitnami.com/bitnami + version: 15.5.20 + condition: postgresql.enabled +sources: + - https://github.com/Requarks/wiki +annotations: + artifacthub.io/changes: |- + - kind: added + description: Initial release + artifacthub.io/links: |- + - name: App Source + url: https://github.com/Requarks/wiki + - name: Chart Source + url: https://github.com/plcnk/charts/tree/master/charts/wikijs diff --git a/charts/wikijs/README.md b/charts/wikijs/README.md new file mode 100644 index 0000000..03ac5ea --- /dev/null +++ b/charts/wikijs/README.md @@ -0,0 +1,119 @@ +# # wikijs + +wikijs logo + +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat) +![AppVersion: 2.5.303](https://img.shields.io/badge/AppVersion-2.5.303-informational?style=flat) + +A modern, lightweight and powerful wiki app built on NodeJS. + +**Homepage:** + +**This chart is not maintained by the upstream project and any issues with the chart should be raised +[here](https://github.com/plcnk/charts/issues/new?assignees=plcnk&labels=bug&template=bug_report.yaml&name=wikijs&version=0.1.0)** + +## Source Code + +* + +## Requirements + +Kubernetes: `>=1.22.0-0` + +## Dependencies + +| Repository | Name | Version | +|------------|------|---------| +| | common | 3.3.2 | +| | postgresql | 15.5.20 | + +## Installing the Chart + +To install the chart with the release name `wikijs` + +### OCI (Recommended) + +```console +helm install wikijs oci://ghcr.io/plcnk/charts/wikijs +``` + +### Traditional + +```console +helm repo add plcnk https://charts.plcnk.net +helm repo update +helm install wikijs plcnk/wikijs +``` + +## Uninstalling the Chart + +To uninstall the `wikijs` deployment + +```console +helm uninstall wikijs +``` + +The command removes all the Kubernetes components associated with the chart **including persistent volumes** and deletes the release. + +## Configuration + +Read through the [values.yaml](./values.yaml) file. It has several commented out suggested values. +Other values may be used from the [values.yaml](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common/values.yaml) from the [bjw-s common library](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common). + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +```console +helm install wikijs \ + --set env.TZ="America/New York" \ + plcnk/wikijs +``` + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. + +```console +helm install wikijs plcnk/wikijs -f values.yaml +``` + +## Custom configuration + +This chart includes a subchart for PostgreSQL, made by [Bitnami](https://github.com/bitnami/charts/tree/main/bitnami/postgresql). + +This is fine for testing purposes but we strongly recommend you to use your own database for a production environment. + +If you want to use your own database and disable the included PostgreSQL database, you can do so in the `values.yaml` file: + +```yaml +postgresql: + enabled: false +``` + +## Values + +**Important**: When deploying an application Helm chart you can add more values from the bjw-s common library chart [here](https://github.com/bjw-s/helm-charts/tree/main/charts/library/common) + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| controllers.main.containers.app.env | object | See [values.yaml](./values.yaml) | Environment variables. The database environment variables **need** to be set if `postgresql.enabled` is set to `false` | +| controllers.main.containers.app.env.TZ | string | `"UTC"` | Set container timezone | +| controllers.main.containers.app.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy | +| controllers.main.containers.app.image.repository | string | `"ghcr.io/requarks/wiki"` | Image repository | +| controllers.main.containers.app.image.tag | string | `"2.5.303"` | Image tag | +| controllers.main.containers.app.securityContext.allowPrivilegeEscalation | bool | `false` | Disable privilege escalations | +| controllers.main.containers.app.securityContext.capabilities | object | `{"drop":["ALL"]}` | Drop all capabilities | +| controllers.main.containers.app.securityContext.readOnlyRootFilesystem | bool | `true` | Mount the container's root filesystem as read-only | +| controllers.main.pod.securityContext.fsGroup | int | `65534` | Volume binds will be granted to `nobody` group | +| controllers.main.pod.securityContext.runAsGroup | int | `65534` | Run as `nobody` group | +| controllers.main.pod.securityContext.runAsNonRoot | bool | `true` | Run container as a non-root user | +| controllers.main.pod.securityContext.runAsUser | int | `65534` | Run as `nobody` user | +| controllers.main.replicas | int | `1` | Number of desired pods **WARNING**: Set this to 1 when you first deploy Wiki.js. You can increase the number of replicas after the initial deployment. | +| controllers.main.resources | object | `{}` | Set the resource requests / limits for the container. | +| controllers.main.type | string | `"deployment"` | Controller type | +| data | object | See [values.yaml](./values.yaml) | Configure persistent storage for Wiki.js data. | +| ingress.main | object | See [values.yaml](./values.yaml) | Enable and configure ingress settings for the chart under this key. | +| postgresql | object | See [values.yaml](./values.yaml) | Enable and configure postgresql database subchart under this key. For more options see [postgresql chart documentation](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) | +| postgresql.enabled | bool | `true` | Set this to `false` if you want to use your own database. | +| service | object | See [values.yaml](./values.yaml) | Configure the services for the chart here. | + +--- +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/charts/wikijs/README_CONFIG.md.gotmpl b/charts/wikijs/README_CONFIG.md.gotmpl new file mode 100644 index 0000000..6a7b3fa --- /dev/null +++ b/charts/wikijs/README_CONFIG.md.gotmpl @@ -0,0 +1,22 @@ +{{- define "custom.chart.name" -}} +# {{ .Name }} +{{- end -}} + +{{- define "custom.custom.configuration.header" -}} +## Custom configuration +{{- end -}} + +{{- define "custom.custom.configuration" -}} +{{ template "custom.custom.configuration.header" . }} + +This chart includes a subchart for PostgreSQL, made by [Bitnami](https://github.com/bitnami/charts/tree/main/bitnami/postgresql). + +This is fine for testing purposes but we strongly recommend you to use your own database for a production environment. + +If you want to use your own database and disable the included PostgreSQL database, you can do so in the `values.yaml` file: + +```yaml +postgresql: + enabled: false +``` +{{- end -}} diff --git a/charts/wikijs/icon.svg b/charts/wikijs/icon.svg new file mode 100644 index 0000000..52c4a79 --- /dev/null +++ b/charts/wikijs/icon.svg @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/charts/wikijs/templates/common.yaml b/charts/wikijs/templates/common.yaml new file mode 100644 index 0000000..9a13270 --- /dev/null +++ b/charts/wikijs/templates/common.yaml @@ -0,0 +1,82 @@ +{{/* Append the hardcoded settings */}} +{{- define "wikijs.harcodedValues" -}} +persistence: + data: + enabled: true + {{- with .Values.data }} + storageClass: {{ .storageClass }} + accessMode: {{ .accessMode }} + size: {{ .size }} + {{- end }} + globalMounts: + - path: /wiki/data + readOnly: false + +controllers: + main: + containers: + app: + {{- if .Values.postgresql.enabled }} + {{- with .Values.postgresql }} + env: + DB_TYPE: postgres + DB_HOST: {{ $.Release.Name }}-postgresql + DB_PORT: 5432 + DB_NAME: {{ .auth.database }} + DB_USER: {{ .auth.username }} + {{ if .auth.password }} + DB_PASS: {{ .auth.password }} + {{ else if .auth.existingSecret }} + DB_PASS: + secretKeyRef: + name: {{ .auth.existingSecret }} + key: {{ .auth.secretKeys.userPasswordKey }} + {{ end }} + {{- end }} + {{- end}} + ports: + - containerPort: 3000 + name: http + protocol: TCP + probes: + liveness: + enabled: true + custom: true + spec: + httpGet: + path: /healthz + port: http + periodSeconds: 30 + timeoutSeconds: 30 + readiness: + enabled: true + custom: true + spec: + httpGet: + path: /healthz + port: http + periodSeconds: 30 + timeoutSeconds: 30 + startup: + enabled: true + custom: true + spec: + httpGet: + path: /healthz + port: http + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 60 + +{{- end -}} + +{{- $tmplVars := deepCopy . -}} +{{ include "bjw-s.common.loader.init" $tmplVars }} +{{- $defaultValues := include "wikijs.harcodedValues" $tmplVars | fromYaml -}} +{{- $_ := mustMerge .Values $defaultValues -}} + +{{/* Render the templates */}} +{{ include "bjw-s.common.loader.init" . }} +{{ include "bjw-s.common.loader.generate" . }} diff --git a/charts/wikijs/values.yaml b/charts/wikijs/values.yaml new file mode 100644 index 0000000..3f87b1f --- /dev/null +++ b/charts/wikijs/values.yaml @@ -0,0 +1,125 @@ +--- +# +# IMPORTANT NOTE +# +# This chart inherits from our common library chart. You can check the default values/options here: +# https://github.com/bjw-s/helm-charts/blob/main/charts/library/common/values.yaml +# + +controllers: + main: + # -- Controller type + type: deployment + # -- Number of desired pods + # **WARNING**: Set this to 1 when you first deploy Wiki.js. + # You can increase the number of replicas after the initial deployment. + replicas: 1 + containers: + app: + image: + # -- Image repository + repository: ghcr.io/requarks/wiki + # -- Image pull policy + pullPolicy: IfNotPresent + # -- Image tag + tag: 2.5.303 + + # -- Environment variables. + # The database environment variables **need** to be set if `postgresql.enabled` is set to `false` + # @default -- See [values.yaml](./values.yaml) + env: + # -- Set container timezone + TZ: UTC + # DB_TYPE: postgres + # DB_HOST: + # DB_PORT: + # DB_NAME: + # DB_USER: + # DB_PASS: + + securityContext: + # -- Mount the container's root filesystem as read-only + readOnlyRootFilesystem: true + # -- Disable privilege escalations + allowPrivilegeEscalation: false + # -- Drop all capabilities + capabilities: + drop: + - ALL + + pod: + securityContext: + # -- Run container as a non-root user + runAsNonRoot: true + # -- Run as `nobody` user + runAsUser: 65534 + # -- Run as `nobody` group + runAsGroup: 65534 + # -- Volume binds will be granted to `nobody` group + fsGroup: 65534 + + # -- Set the resource requests / limits for the container. + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +# -- Configure the services for the chart here. +# @default -- See [values.yaml](./values.yaml) +service: + main: + controller: main + ports: + http: + port: 3000 + +# -- Configure persistent storage for Wiki.js data. +# @default -- See [values.yaml](./values.yaml) +data: + storageClass: "" + accessMode: ReadWriteOnce + size: 8Gi + +ingress: + # -- Enable and configure ingress settings for the chart under this key. + # @default -- See [values.yaml](./values.yaml) + main: + enabled: false + # className: "" + # annotations: {} + # hosts: + # - host: &host-main "chart-example.local" + # paths: + # - path: / + # pathType: Prefix + # service: + # identifier: main + # port: http + # tls: + # - secretName: chart-example-tls + # hosts: + # - *host-main + +# -- Enable and configure postgresql database subchart under this key. +# For more options see [postgresql chart documentation](https://github.com/bitnami/charts/tree/main/bitnami/postgresql) +# @default -- See [values.yaml](./values.yaml) +postgresql: + # -- Set this to `false` if you want to use your own database. + enabled: true + architecture: standalone + primary: + persistence: + enabled: true + storageClass: "" + size: 8Gi + auth: + enablePostgresUser: false + username: wikijs + password: changeme + database: wikijs + existingSecret: "" + secretKeys: + userPasswordKey: ""