feat: migrate dokuwiki to k8s
This commit is contained in:
parent
95b33315cd
commit
75e4957d3d
9 changed files with 338 additions and 15 deletions
|
|
@ -1,13 +0,0 @@
|
||||||
---
|
|
||||||
services:
|
|
||||||
wiki:
|
|
||||||
image: dokuwiki/dokuwiki:2024-02-06b
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "44344:8080"
|
|
||||||
volumes:
|
|
||||||
- /mnt/nas1/shared/dokuwiki/dokuwiki:/storage
|
|
||||||
environment:
|
|
||||||
PHP_TIMEZONE: Europe/Madrid
|
|
||||||
PHP_MEMORYLIMIT: 512M
|
|
||||||
PHP_UPLOADLIMIT: 128M
|
|
||||||
|
|
@ -3,13 +3,13 @@ services:
|
||||||
pluton:
|
pluton:
|
||||||
image: plutonhq/pluton:0.18.2
|
image: plutonhq/pluton:0.18.2
|
||||||
container_name: pluton-backup
|
container_name: pluton-backup
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "${SERVER_PORT:-5173}:${SERVER_PORT:-5173}"
|
- "${SERVER_PORT:-5173}:${SERVER_PORT:-5173}"
|
||||||
volumes:
|
volumes:
|
||||||
- ${PLUTON_DATA:-/mnt/nas1/shared/pluton/data}:/data
|
- ${PLUTON_DATA:-/mnt/nas1/shared/pluton/data}:/data
|
||||||
- ${PLUTON_BACKUP_VOLUME_SHARED:-/mnt/nas1/shared}:/backups/shared
|
- ${PLUTON_BACKUP_VOLUME_SHARED:-/mnt/nas1/shared}:/backups/shared
|
||||||
- ${PLUTON_BACKUP_VOLUME_DCSI:-/mnt/nas1/dcsi}:/backups/dcsi
|
- ${PLUTON_BACKUP_VOLUME_DCSI:-/mnt/dcsi}:/backups/dcsi
|
||||||
environment:
|
environment:
|
||||||
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
|
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
|
||||||
USER_NAME: ${USER_NAME}
|
USER_NAME: ${USER_NAME}
|
||||||
|
|
|
||||||
51
k8s/argo-apps/dokuwiki.yaml
Normal file
51
k8s/argo-apps/dokuwiki.yaml
Normal file
|
|
@ -0,0 +1,51 @@
|
||||||
|
---
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: dokuwiki
|
||||||
|
namespace: argo-cd
|
||||||
|
spec:
|
||||||
|
destination:
|
||||||
|
name: ''
|
||||||
|
namespace: apps-roboces
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
sources:
|
||||||
|
- repoURL: git.roboces.dev/catalin/fukuops
|
||||||
|
chart: dokuwiki
|
||||||
|
targetRevision: 0.1.2
|
||||||
|
helm:
|
||||||
|
valuesObject:
|
||||||
|
replicaCount: 1
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: false
|
||||||
|
runAsUser: 33
|
||||||
|
runAsGroup: 33
|
||||||
|
capabilities:
|
||||||
|
drop:
|
||||||
|
- all
|
||||||
|
service:
|
||||||
|
type: LoadBalancer
|
||||||
|
port: 8004
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: "traefik"
|
||||||
|
hosts:
|
||||||
|
- host: wiki.roboces.dev
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
storageClass: "truenas-nfs-csi"
|
||||||
|
accessMode: ReadWriteMany
|
||||||
|
size: 20Gi
|
||||||
|
env:
|
||||||
|
PHP_TIMEZONE: Europe/Madrid
|
||||||
|
PHP_MEMORYLIMIT: 512M
|
||||||
|
PHP_UPLOADLIMIT: 128M
|
||||||
|
project: roboces
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: true
|
||||||
|
selfHeal: true
|
||||||
8
k8s/charts/dokuwiki/Chart.yaml
Normal file
8
k8s/charts/dokuwiki/Chart.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
apiVersion: v2
|
||||||
|
name: dokuwiki
|
||||||
|
description: A Helm chart for DokuWiki
|
||||||
|
type: application
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: 2024-02-06b
|
||||||
|
annotations:
|
||||||
|
artifacthub.io/images: "- name: dokuwiki\n image: dokuwiki/dokuwiki:2024-02-06b\n"
|
||||||
60
k8s/charts/dokuwiki/templates/_helpers.tpl
Normal file
60
k8s/charts/dokuwiki/templates/_helpers.tpl
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "dokuwiki.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
*/}}
|
||||||
|
{{- define "dokuwiki.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- if contains $name .Release.Name }}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- 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 }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "dokuwiki.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "dokuwiki.chart" . }}
|
||||||
|
{{ include "dokuwiki.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "dokuwiki.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "dokuwiki.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Service account name
|
||||||
|
*/}}
|
||||||
|
{{- define "dokuwiki.serviceAccountName" -}}
|
||||||
|
{{- if .Values.serviceAccount.create }}
|
||||||
|
{{- default (include "dokuwiki.fullname" .) .Values.serviceAccount.name }}
|
||||||
|
{{- else }}
|
||||||
|
{{- default "default" .Values.serviceAccount.name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
45
k8s/charts/dokuwiki/templates/ingress.yaml
Normal file
45
k8s/charts/dokuwiki/templates/ingress.yaml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
{{- if .Values.ingress.enabled -}}
|
||||||
|
{{- $fullName := include "dokuwiki.fullname" . -}}
|
||||||
|
{{- $svcPort := .Values.service.port -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
labels:
|
||||||
|
{{- include "dokuwiki.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- if .Values.ingress.className }}
|
||||||
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ .host | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
{{- range .paths }}
|
||||||
|
- path: {{ .path }}
|
||||||
|
{{- if .pathType }}
|
||||||
|
pathType: {{ .pathType }}
|
||||||
|
{{- end }}
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
port:
|
||||||
|
number: {{ $svcPort }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
15
k8s/charts/dokuwiki/templates/service.yaml
Normal file
15
k8s/charts/dokuwiki/templates/service.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "dokuwiki.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "dokuwiki.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.service.port }}
|
||||||
|
targetPort: {{ .Values.service.targetPort }}
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
{{- include "dokuwiki.selectorLabels" . | nindent 4 }}
|
||||||
91
k8s/charts/dokuwiki/templates/statefulset.yaml
Normal file
91
k8s/charts/dokuwiki/templates/statefulset.yaml
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: {{ include "dokuwiki.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "dokuwiki.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
serviceName: {{ include "dokuwiki.fullname" . }}-headless
|
||||||
|
{{- if not .Values.autoscaling.enabled }}
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
{{- end }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "dokuwiki.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- with .Values.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "dokuwiki.selectorLabels" . | nindent 8 }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
env:
|
||||||
|
{{- range $key, $value := .Values.env }}
|
||||||
|
- name: {{ $key }}
|
||||||
|
value: {{ $value | quote }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
||||||
|
readinessProbe:
|
||||||
|
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /storage
|
||||||
|
{{- if .Values.persistence.existingClaim }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Values.persistence.existingClaim }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
restartPolicy: Always
|
||||||
|
automountServiceAccountToken: false
|
||||||
|
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode }}
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
{{- if eq "-" .Values.persistence.storageClass }}
|
||||||
|
storageClassName: ""
|
||||||
|
{{- else }}
|
||||||
|
storageClassName: {{ .Values.persistence.storageClass | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size }}
|
||||||
|
{{- end }}
|
||||||
66
k8s/charts/dokuwiki/values.yaml
Normal file
66
k8s/charts/dokuwiki/values.yaml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
image:
|
||||||
|
repository: dokuwiki/dokuwiki
|
||||||
|
pullpolicy: IfNotPresent
|
||||||
|
tag: ""
|
||||||
|
|
||||||
|
imagePullSecrets: []
|
||||||
|
podAnnotations: {}
|
||||||
|
podSecurityContext: {}
|
||||||
|
securityContext: {}
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: LoadBalancer
|
||||||
|
port: 8004
|
||||||
|
targetPort: 8080
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
className: ""
|
||||||
|
annotations: {}
|
||||||
|
hosts:
|
||||||
|
- host: wiki.roboces.dev
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
tls: []
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled: true
|
||||||
|
storageClass: "truenas-nfs-csi"
|
||||||
|
accessMode: ReadWriteMany
|
||||||
|
size: 2Gi
|
||||||
|
existingClaim: ""
|
||||||
|
|
||||||
|
autoscaling:
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
resources: {}
|
||||||
|
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
timeoutSeconds: 15
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: 8080
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
timeoutSeconds: 2
|
||||||
|
successThreshold: 1
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
|
||||||
|
nodeSelector: {}
|
||||||
|
tolerations: []
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
env:
|
||||||
|
PHP_TIMEZONE: Europe/Madrid
|
||||||
|
PHP_MEMORYLIMIT: 512M
|
||||||
|
PHP_UPLOADLIMIT: 128M
|
||||||
Loading…
Add table
Add a link
Reference in a new issue