# Kubernetes deployment which creates a DokuWiki application, a LoadBalancer
# that exposes the service, and a PVC that stores the data.
---
apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: dokuwiki
  name: dokuwiki-deployment
  labels:
    app: dokuwiki
spec:
  replicas: 1
  selector:
    matchLabels:
      app: dokuwiki
  template:
    metadata:
      labels:
        app: dokuwiki
    spec:
      containers:
      - name: dokuwiki
        image: lscr.io/linuxserver/dokuwiki
        ports:
        - containerPort: 80
        - containerPort: 443
        securityContext:
          runAsUser: 0
        volumeMounts:
        - name: dokuwiki-storage
          mountPath: /config
        env:
        - name: PUID
          value: '1000'
        - name: PGID
          value: '1000'
        - name: TZ
          value: 'Europe/London'
        resources:
          limits:
            cpu: 512m
            memory: 1Gi
      serviceAccountName: priveys
      volumes:
      - name: dokuwiki-storage
        persistentVolumeClaim:
          claimName: dokuwiki-pvc
