Skip to content

Commit

Permalink
Dokuwiki - Several improvements (helm#6326)
Browse files Browse the repository at this point in the history
* Dokuwiki - Several improvements

* Fixing labels

Signed-off-by: voron <av@arilot.com>
  • Loading branch information
juan131 authored and voron committed Sep 5, 2018
1 parent 444988c commit b76adb2
Show file tree
Hide file tree
Showing 12 changed files with 279 additions and 68 deletions.
5 changes: 4 additions & 1 deletion stable/dokuwiki/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: dokuwiki
version: 1.0.3
version: 2.0.0
appVersion: 0.20180422.201805030840
description: DokuWiki is a standards-compliant, simple to use wiki optimized for creating
documentation. It is targeted at developer teams, workgroups, and small companies.
All data is stored in plain text files, so no database is required.
keywords:
- dokuwiki
- wiki
- http
- web
- application
- php
home: http://www.dokuwiki.org/
sources:
Expand Down
67 changes: 46 additions & 21 deletions stable/dokuwiki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,52 @@ The command removes all the Kubernetes components associated with the chart and

The following table lists the configurable parameters of the DokuWiki chart and their default values.

| Parameter | Description | Default |
|-------------------------------------|---------------------------------------------|---------------------------------------------------------|
| `image.registry` | DokuWiki image registry | `docker.io` |
| `image.repository` | DokuWiki Image name | `bitnami/dokuwiki` |
| `image.tag` | DokuWiki Image tag | `{VERSION}` |
| `image.pullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent` |
| `image.pullSecrets` | Specify image pull secrets | `nil` |
| `dokuwikiUsername` | User of the application | `user` |
| `dokuwikiFullName` | User's full name | `Full Name` |
| `dokuwikiPassword` | Application password | _random 10 character alphanumeric string_ |
| `dokuwikiEmail` | User email | `user@example.com` |
| `dokuwikiWikiName` | Wiki name | `My Wiki` |
| `serviceType` | Kubernetes Service type | `LoadBalancer` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
| `persistence.apache.storageClass` | PVC Storage Class for apache volume | `nil` (uses alpha storage class annotation) |
| `persistence.apache.accessMode` | PVC Access Mode for apache volume | `ReadWriteOnce` |
| `persistence.apache.size` | PVC Storage Request for apache volume | `1Gi` |
| `persistence.dokuwiki.storageClass` | PVC Storage Class for DokuWiki volume | `nil` (uses alpha storage class annotation) |
| `persistence.dokuwiki.accessMode` | PVC Access Mode for DokuWiki volume | `ReadWriteOnce` |
| `persistence.dokuwiki.size` | PVC Storage Request for DokuWiki volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
| Parameter | Description | Default |
|--------------------------------------|------------------------------------------------------------|-----------------------------------------------|
| `image.registry` | DokuWiki image registry | `docker.io` |
| `image.repository` | DokuWiki Image name | `bitnami/dokuwiki` |
| `image.tag` | DokuWiki Image tag | `{VERSION}` |
| `image.pullPolicy` | Image pull policy | `Always` |
| `image.pullSecrets` | Specify image pull secrets | `nil` |
| `dokuwikiUsername` | User of the application | `user` |
| `dokuwikiFullName` | User's full name | `User Name` |
| `dokuwikiPassword` | Application password | _random 10 character alphanumeric string_ |
| `dokuwikiEmail` | User email | `user@example.com` |
| `dokuwikiWikiName` | Wiki name | `My Wiki` |
| `service.loadBalancer` | Kubernetes LoadBalancerIP to request | `nil` |
| `service.externalTrafficPolicy` | Enable client source IP preservation | `Local` |
| `service.nodePorts.http` | Kubernetes http node port | `""` |
| `service.nodePorts.https` | Kubernetes https node port | `""` |
| `ingress.enabled` | Enable ingress controller resource | `false` |
| `ingress.hosts[0].name` | Hostname to your Joomla! installation | `joomla.local` |
| `ingress.hosts[0].path` | Path within the url structure | `/` |
| `ingress.hosts[0].tls` | Utilize TLS backend in ingress | `false` |
| `ingress.hosts[0].tlsSecret` | TLS Secret (certificates) | `joomla.local-tls-secret` |
| `ingress.hosts[0].annotations` | Annotations for this host's ingress record | `[]` |
| `ingress.secrets[0].name` | TLS Secret Name | `nil` |
| `ingress.secrets[0].certificate` | TLS Secret Certificate | `nil` |
| `ingress.secrets[0].key` | TLS Secret Key | `nil` |
| `persistence.enabled` | Enable persistence using PVC | `true` |
| `persistence.apache.storageClass` | PVC Storage Class for apache volume | `nil` (uses alpha storage class annotation) |
| `persistence.apache.accessMode` | PVC Access Mode for apache volume | `ReadWriteOnce` |
| `persistence.apache.size` | PVC Storage Request for apache volume | `1Gi` |
| `persistence.dokuwiki.storageClass` | PVC Storage Class for DokuWiki volume | `nil` (uses alpha storage class annotation) |
| `persistence.dokuwiki.accessMode` | PVC Access Mode for DokuWiki volume | `ReadWriteOnce` |
| `persistence.dokuwiki.size` | PVC Storage Request for DokuWiki volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
| `livenessProbe.enabled` | Enable/disable the liveness probe | `true` |
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 120 |
| `livenessProbe.periodSeconds` | How often to perform the probe | 10 |
| `livenessProbe.timeoutSeconds` | When the probe times out | 5 |
| `livenessProbe.failureThreshold` | Minimum consecutive failures to be considered failed | 6 |
| `livenessProbe.successThreshold` | Minimum consecutive successes to be considered successful | 1 |
| `readinessProbe.enabled` | Enable/disable the readiness probe | `true` |
| `readinessProbe.initialDelaySeconds` | Delay before readinessProbe is initiated | 30 |
| `readinessProbe.periodSeconds ` | How often to perform the probe | 10 |
| `readinessProbe.timeoutSeconds` | When the probe times out | 5 |
| `readinessProbe.failureThreshold` | Minimum consecutive failures to be considered failed | 6 |
| `readinessProbe.successThreshold` | Minimum consecutive successes to be considered successful | 1 |


The above parameters map to the env variables defined in [bitnami/dokuwiki](http://github.com/bitnami/bitnami-docker-dokuwiki). For more information please refer to the [bitnami/dokuwiki](http://github.com/bitnami/bitnami-docker-dokuwiki) image documentation.

Expand Down
18 changes: 15 additions & 3 deletions stable/dokuwiki/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@

** Please be patient while the chart is being deployed **

{{- if .Values.ingress.enabled }}

1. Get the DokuWiki URL indicated on the Ingress Rule and associate it to your cluster external IP:

export CLUSTER_IP=$(minikube ip) # On Minikube. Use: `kubectl cluster-info` on others K8s clusters
export HOSTNAME=$(kubectl get ingress --namespace {{ .Release.Namespace }} {{ template "dokuwiki.fullname" . }} -o jsonpath='{.spec.rules[0].host}')
echo "Dokuwiki URL: http://$HOSTNAME/"
echo "$CLUSTER_IP $HOSTNAME" | sudo tee -a /etc/hosts

{{- else }}

1. Get the DokuWiki URL by running:

{{- if contains "NodePort" .Values.serviceType }}
{{- if contains "NodePort" .Values.service.type }}

export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "dokuwiki.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/

{{- else if contains "LoadBalancer" .Values.serviceType }}
{{- else if contains "LoadBalancer" .Values.service.type }}

** Please ensure an external IP is associated to the {{ template "dokuwiki.fullname" . }} service before proceeding **
** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "dokuwiki.fullname" . }} **

export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "dokuwiki.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP/
{{- else if contains "ClusterIP" .Values.serviceType }}
{{- else if contains "ClusterIP" .Values.service.type }}

export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "dokuwiki.fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:8080/
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{- end }}

2. Login with the following credentials

Expand Down
15 changes: 15 additions & 0 deletions stable/dokuwiki/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,18 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "dokuwiki.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Return the proper Dokuwiki image name
*/}}
{{- define "dokuwiki.image" -}}
{{- $tag := .Values.image.tag | toString -}}
{{- printf "%s/%s:%s" .Values.image.registry .Values.image.repository $tag -}}
{{- end -}}
10 changes: 5 additions & 5 deletions stable/dokuwiki/templates/apache-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ apiVersion: v1
metadata:
name: {{ template "dokuwiki.fullname" . }}-apache
labels:
app: {{ template "dokuwiki.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app: {{ template "dokuwiki.name" . }}
chart: {{ template "dokuwiki.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
accessModes:
- {{ .Values.persistence.apache.accessMode | quote }}
Expand All @@ -18,7 +18,7 @@ spec:
{{- if (eq "-" .Values.persistence.apache.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.apache.storageClass }}"
storageClassName: {{ .Values.persistence.apache.storageClass | quote }}
{{- end }}
{{- end }}
{{- end -}}
40 changes: 24 additions & 16 deletions stable/dokuwiki/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ kind: Deployment
metadata:
name: {{ template "dokuwiki.fullname" . }}
labels:
app: {{ template "dokuwiki.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app: {{ template "dokuwiki.name" . }}
chart: {{ template "dokuwiki.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
template:
metadata:
labels:
app: {{ template "dokuwiki.fullname" . }}
app: {{ template "dokuwiki.name" . }}
spec:
{{- if .Values.image.pullSecrets }}
imagePullSecrets:
Expand All @@ -21,41 +21,49 @@ spec:
{{- end }}
containers:
- name: {{ template "dokuwiki.fullname" . }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
image: {{ template "dokuwiki.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
env:
- name: DOKUWIKI_USERNAME
value: {{ default "" .Values.dokuwikiUsername | quote }}
value: {{ .Values.dokuwikiUsername | quote }}
- name: DOKUWIKI_FULL_NAME
value: {{ default "" .Values.dokuwikiFullName | quote }}
value: {{ .Values.dokuwikiFullName | quote }}
- name: DOKUWIKI_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "dokuwiki.fullname" . }}
key: dokuwiki-password
- name: DOKUWIKI_EMAIL
value: {{ default "" .Values.dokuwikiEmail | quote }}
value: {{ .Values.dokuwikiEmail | quote }}
- name: DOKUWIKI_WIKI_NAME
value: {{ default "" .Values.dokuwikiWikiName | quote }}
value: {{ .Values.dokuwikiWikiName | quote }}
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: /doku.php
port: http
initialDelaySeconds: 120
timeoutSeconds: 5
failureThreshold: 6
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }}
{{- if .Values.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: /doku.php
port: http
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 5
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
Expand Down
10 changes: 5 additions & 5 deletions stable/dokuwiki/templates/dokuwiki-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ apiVersion: v1
metadata:
name: {{ template "dokuwiki.fullname" . }}-dokuwiki
labels:
app: {{ template "dokuwiki.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app: {{ template "dokuwiki.name" . }}
chart: {{ template "dokuwiki.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
spec:
accessModes:
- {{ .Values.persistence.dokuwiki.accessMode | quote }}
Expand All @@ -18,7 +18,7 @@ spec:
{{- if (eq "-" .Values.persistence.dokuwiki.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.dokuwiki.storageClass }}"
storageClassName: {{ .Values.persistence.dokuwiki.storageClass | quote }}
{{- end }}
{{- end }}
{{- end -}}
36 changes: 36 additions & 0 deletions stable/dokuwiki/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "dokuwiki.fullname" $ }}
labels:
app: {{ template "dokuwiki.name" $ }}
chart: {{ template "dokuwiki.chart" $ }}
release: {{ $.Release.Name | quote }}
heritage: {{ $.Release.Service | quote }}
annotations:
{{- if .tls }}
ingress.kubernetes.io/secure-backends: "true"
{{- end }}
{{- range $key, $value := .annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
- host: {{ .name }}
http:
paths:
- path: {{ default "/" .path }}
backend:
serviceName: {{ template "dokuwiki.fullname" $ }}
servicePort: 80
{{- if .tls }}
tls:
- hosts:
- {{ .name }}
secretName: {{ .tlsSecret }}
{{- end }}
---
{{- end }}
{{- end }}
10 changes: 5 additions & 5 deletions stable/dokuwiki/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ kind: Secret
metadata:
name: {{ template "dokuwiki.fullname" . }}
labels:
app: {{ template "dokuwiki.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app: {{ template "dokuwiki.name" . }}
chart: {{ template "dokuwiki.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
type: Opaque
data:
{{ if .Values.dokuwikiPassword }}
dokuwiki-password: {{ default "" .Values.dokuwikiPassword | b64enc | quote }}
dokuwiki-password: {{ .Values.dokuwikiPassword | b64enc | quote }}
{{ else }}
dokuwiki-password: {{ randAlphaNum 10 | b64enc | quote }}
{{ end }}
Loading

0 comments on commit b76adb2

Please sign in to comment.