From 173ad72188872a9ec6c5d3c09efc56bbb85739c9 Mon Sep 17 00:00:00 2001 From: Martyn Ranyard Date: Tue, 28 Nov 2023 23:24:08 +0100 Subject: [PATCH] nextcloud over Signed-off-by: Martyn Ranyard --- apps-kustomized/nextcloud/deploy.yaml | 109 +++++++++++++++++++++++++ apps-kustomized/nextcloud/ingress.yaml | 28 +++++++ apps-kustomized/nextcloud/pvc.yaml | 13 +++ apps-kustomized/nextcloud/service.yaml | 15 ++++ everything-app/nextcloud.yaml | 17 ++++ 5 files changed, 182 insertions(+) create mode 100644 apps-kustomized/nextcloud/deploy.yaml create mode 100644 apps-kustomized/nextcloud/ingress.yaml create mode 100644 apps-kustomized/nextcloud/pvc.yaml create mode 100644 apps-kustomized/nextcloud/service.yaml create mode 100644 everything-app/nextcloud.yaml diff --git a/apps-kustomized/nextcloud/deploy.yaml b/apps-kustomized/nextcloud/deploy.yaml new file mode 100644 index 0000000..f2ddfac --- /dev/null +++ b/apps-kustomized/nextcloud/deploy.yaml @@ -0,0 +1,109 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/name: nextcloud + name: nextcloud +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: nextcloud + template: + metadata: + creationTimestamp: null + labels: + app.kubernetes.io/name: nextcloud + spec: + containers: + - env: + - name: MYSQL_HOST + value: nextcloud-mysql-mariadb + - name: MYSQL_DATABASE + value: nextcloud + - name: MYSQL_USER + value: nextcloud + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: db-creds + key: mariadb-password + - name: NEXTCLOUD_ADMIN_USER + valueFrom: + secretKeyRef: + key: nextcloud-username + name: nextcloud + - name: NEXTCLOUD_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + key: nextcloud-password + name: nextcloud + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: nextcloud.martyn.berlin + - name: NEXTCLOUD_DATA_DIR + value: /var/www/html/data + image: nextcloud:27-apache + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + httpHeaders: + - name: Host + value: nextcloud.martyn.berlin + path: /status.php + port: http + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + name: nextcloud + ports: + - containerPort: 80 + name: http + protocol: TCP + readinessProbe: + failureThreshold: 3 + httpGet: + httpHeaders: + - name: Host + value: nextcloud.martyn.berlin + path: /status.php + port: http + scheme: HTTP + initialDelaySeconds: 10 + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 5 + volumeMounts: + - mountPath: /var/www/ + name: nextcloud-main + subPath: root + - mountPath: /var/www/html + name: nextcloud-main + subPath: html + - mountPath: /var/www/html/data + name: nextcloud-main + subPath: data + - mountPath: /var/www/html/config + name: nextcloud-main + subPath: config + - mountPath: /var/www/html/custom_apps + name: nextcloud-main + subPath: custom_apps + - mountPath: /var/www/tmp + name: nextcloud-main + subPath: tmp + - mountPath: /var/www/html/themes + name: nextcloud-main + subPath: themes + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: + fsGroup: 33 + terminationGracePeriodSeconds: 30 + volumes: + - name: nextcloud-main + persistentVolumeClaim: + claimName: nextcloud-nextcloud diff --git a/apps-kustomized/nextcloud/ingress.yaml b/apps-kustomized/nextcloud/ingress.yaml new file mode 100644 index 0000000..2455170 --- /dev/null +++ b/apps-kustomized/nextcloud/ingress.yaml @@ -0,0 +1,28 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + cert-manager.io/cluster-issuer: letsencrypt + external-dns.alpha.kubernetes.io/target: armnleg.martyn.berlin + nginx.ingress.kubernetes.io/proxy-body-size: 200m + labels: + app.kubernetes.io/name: nextcloud + name: nextcloud + namespace: nextcloud +spec: + ingressClassName: nginx + rules: + - host: nextcloud.martyn.berlin + http: + paths: + - backend: + service: + name: nextcloud + port: + number: 80 + path: / + pathType: Prefix + tls: + - hosts: + - nextcloud.martyn.berlin + secretName: nextcloud-tls diff --git a/apps-kustomized/nextcloud/pvc.yaml b/apps-kustomized/nextcloud/pvc.yaml new file mode 100644 index 0000000..1d82472 --- /dev/null +++ b/apps-kustomized/nextcloud/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app.kubernetes.io/name: nextcloud + name: nextcloud-nextcloud +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 18Gi + storageClassName: rook-ceph-block-ssd diff --git a/apps-kustomized/nextcloud/service.yaml b/apps-kustomized/nextcloud/service.yaml new file mode 100644 index 0000000..e5653e2 --- /dev/null +++ b/apps-kustomized/nextcloud/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/name: nextcloud + name: nextcloud + namespace: nextcloud +spec: + ports: + - name: http + port: 80 + targetPort: http + selector: + app.kubernetes.io/name: nextcloud + type: LoadBalancer diff --git a/everything-app/nextcloud.yaml b/everything-app/nextcloud.yaml new file mode 100644 index 0000000..78c7a01 --- /dev/null +++ b/everything-app/nextcloud.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: nextcloud + namespace: argocd +spec: + destination: + namespace: nextcloud + server: https://kubernetes.default.svc + project: apps + source: + path: apps-kustomized/nextcloud + repoURL: https://git.martyn.berlin/martyn/infra4talos + targetRevision: HEAD + syncPolicy: + automated: + selfHeal: true