apiVersion: apps/v1 kind: Deployment metadata: name: nextcloud labels: app: nextcloud spec: selector: matchLabels: app: nextcloud template: metadata: labels: app: nextcloud spec: containers: - name: nextcloud image: nextcloud:18.0.4 env: - name: TRUSTED_PROXIES value: 10.0.0.0/8 - name: MYSQL_HOST value: mariadb.nextcloud.svc:3306 - name: MYSQL_DATABASE valueFrom: secretKeyRef: name: mariadb-credentials-secret key: database - name: MYSQL_USER valueFrom: secretKeyRef: name: mariadb-credentials-secret key: username - name: MYSQL_PASSWORD valueFrom: secretKeyRef: name: mariadb-credentials-secret key: password ports: - name: http containerPort: 80 volumeMounts: - name: nextcloud-pvc mountPath: /var/www/html volumes: - name: nextcloud-pvc persistentVolumeClaim: claimName: nextcloud-pvc --- apiVersion: v1 kind: PersistentVolumeClaim metadata: name: nextcloud-pvc labels: app: nextcloud spec: accessModes: - ReadWriteOnce resources: requests: storage: 50Gi --- apiVersion: v1 kind: Service metadata: name: nextcloud labels: app: nextcloud spec: selector: app: nextcloud ports: - name: http protocol: TCP port: 80 targetPort: http --- apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: nextcloud labels: app: nextcloud annotations: nginx.ingress.kubernetes.io/rewrite-target: / cert-manager.io/cluster-issuer: letsencrypt spec: tls: - hosts: - nextcloud.127.0.0.1.nip.io secretName: letsencrypt-cert rules: - host: nextcloud.127.0.0.1.nip.io http: paths: - path: / backend: serviceName: nextcloud servicePort: http