Dokuwiki - Several improvements (#6326)

* Dokuwiki - Several improvements

* Fixing labels
This commit is contained in:
Juan Ariza Toledano
2018-06-26 08:07:51 -07:00
committed by k8s-ci-robot
parent 9a666b060f
commit 03414d6ea1
12 changed files with 279 additions and 68 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
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.
@@ -7,6 +7,9 @@ description: DokuWiki is a standards-compliant, simple to use wiki optimized for
keywords:
- dokuwiki
- wiki
- http
- web
- application
- php
home: http://www.dokuwiki.org/
sources:
+46 -21
View File
@@ -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.
+15 -3
View File
@@ -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
+15
View File
@@ -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 -}}
+5 -5
View File
@@ -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 }}
@@ -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 -}}
+24 -16
View File
@@ -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:
@@ -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:
+5 -5
View File
@@ -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 }}
@@ -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
View File
@@ -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 }}
+5 -5
View File
@@ -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 }}
+18 -6
View File
@@ -3,18 +3,30 @@ kind: Service
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:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}
ports:
- name: http
port: 80
targetPort: http
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.http)))}}
nodePort: {{ .Values.service.nodePorts.http }}
{{- end }}
- name: https
port: 443
targetPort: https
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePorts.https)))}}
nodePort: {{ .Values.service.nodePorts.https }}
{{- end }}
selector:
app: {{ template "dokuwiki.fullname" . }}
app: {{ template "dokuwiki.name" . }}
@@ -0,0 +1,18 @@
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.secrets }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
labels:
app: {{ template "dokuwiki.name" . }}
chart: {{ template "dokuwiki.chart" . }}
release: {{ .Release.Name | quote }}
heritage: {{ .Release.Service | quote }}
type: kubernetes.io/tls
data:
tls.crt: {{ .certificate | b64enc }}
tls.key: {{ .key | b64enc }}
---
{{- end }}
{{- end }}
+88 -6
View File
@@ -35,17 +35,82 @@ dokuwikiEmail: user@example.com
## User's Full Name
## ref: https://github.com/bitnami/bitnami-docker-dokuwiki#environment-variables
##
dokuwikiFullName: Full Name
dokuwikiFullName: User Name
## Name of the Wiki
## ref: https://github.com/bitnami/bitnami-docker-dokuwiki#environment-variables
##
dokuwikiWikiName: My Wiki
## Kubernetes configuration
## For minikube, set this to NodePort, elsewhere use LoadBalancer
## Kubernetes svc configuration
##
serviceType: LoadBalancer
service:
## Kubernetes svc type
## For minikube, set this to NodePort, elsewhere use LoadBalancer
##
type: LoadBalancer
## Use serviceLoadBalancerIP to request a specific static IP,
## otherwise leave blank
##
# loadBalancerIP:
## Use nodePorts to requets some specific ports when usin NodePort
## nodePorts:
## http: <to set explicitly, choose port between 30000-32767>
## https: <to set explicitly, choose port between 30000-32767>
##
nodePorts:
http: ""
https: ""
## Enable client source IP preservation
## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
##
externalTrafficPolicy: Local
## Configure the ingress resource that allows you to access the
## Dokuwiki installation. Set up the URL
## ref: http://kubernetes.io/docs/user-guide/ingress/
##
ingress:
## Set to true to enable ingress record generation
enabled: false
## The list of hostnames to be covered with this ingress record.
## Most likely this will be just one host, but in the event more hosts are needed, this is an array
hosts:
- name: dokuwiki.local
## Set this to true in order to enable TLS on the ingress record
## A side effect of this will be that the backend dokuwiki service will be connected at port 443
tls: false
## If TLS is set to true, you must declare what secret will store the key/certificate for TLS
tlsSecret: dokuwiki.local-tls
## Ingress annotations done as key:value pairs
## If you're using kube-lego, you will want to add:
## kubernetes.io/tls-acme: true
##
## For a full list of possible ingress annotations, please see
## ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/annotations.md
##
## If tls is set to true, annotation ingress.kubernetes.io/secure-backends: "true" will automatically be set
annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: true
secrets:
## If you're providing your own certificates, please use this to add the certificates as secrets
## key and certificate should start with -----BEGIN CERTIFICATE----- or
## -----BEGIN RSA PRIVATE KEY-----
##
## name should line up with a tlsSecret set further up
## If you're using kube-lego, this is unneeded, as it will create the secret for you if it is not set
##
## It is also possible to create and manage the certificates outside of this helm chart
## Please see README.md for more information
# - name: dokuwiki.local-tls
# key:
# certificate:
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
@@ -53,7 +118,7 @@ serviceType: LoadBalancer
persistence:
enabled: true
apache:
## apache data Persistent Volume Storage Class
## Apache data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
@@ -64,7 +129,7 @@ persistence:
accessMode: ReadWriteOnce
size: 1Gi
dokuwiki:
## dokuwiki data Persistent Volume Storage Class
## Dokuwiki data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
@@ -82,3 +147,20 @@ resources:
requests:
memory: 512Mi
cpu: 300m
## Configure extra options for liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
livenessProbe:
enbaled: true
initialDelaySeconds: 120
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1
readinessProbe:
enabled: true
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 6
successThreshold: 1