From f8eb20b20fefaeec13936808bd65e79795be0959 Mon Sep 17 00:00:00 2001 From: pierre Date: Thu, 13 Jun 2024 15:32:42 +0100 Subject: [PATCH] :rocket: add nextcloud_testing folder --- .../Nextcloud-webserver.kube.yaml | 91 ++++++++++ .../Nextcloud-webserver.kube.yaml.save | 89 ++++++++++ nextcloud_testing/helm_nextcloud.yaml | 156 ++++++++++++++++++ nextcloud_testing/namespace.yaml | 5 + nextcloud_testing/pvc.claim.yaml | 14 ++ 5 files changed, 355 insertions(+) create mode 100644 nextcloud_testing/Nextcloud-webserver.kube.yaml create mode 100644 nextcloud_testing/Nextcloud-webserver.kube.yaml.save create mode 100644 nextcloud_testing/helm_nextcloud.yaml create mode 100644 nextcloud_testing/namespace.yaml create mode 100644 nextcloud_testing/pvc.claim.yaml diff --git a/nextcloud_testing/Nextcloud-webserver.kube.yaml b/nextcloud_testing/Nextcloud-webserver.kube.yaml new file mode 100644 index 0000000..a83cfb3 --- /dev/null +++ b/nextcloud_testing/Nextcloud-webserver.kube.yaml @@ -0,0 +1,91 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: nextcloud-testing +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nextcloud-webserver + namespace: nextcloud-testing +spec: + replicas: 1 + selector: + matchLabels: + app: nextcloud-webserver + template: + metadata: + labels: + app: nextcloud-webserver + spec: +# nodeName: kube-master + containers: + - name: nextcloud-webserver +# image: nextcloud:apache + image: nextcloud:28.0.5-apache + imagePullPolicy: Always + ports: + - containerPort: 80 + name: webserver-port + env: + #- name: REDIS_HOST + # value: "redis://redis:6379" +# - name: POSTGRES_HOST +# value: "db" + - name: SQLITE_DATABASE + value: "nextcloud" + + volumeMounts: +# - name: nextcloud +# mountPath: /var/www/html + - name: nextcloud-webserver-data + mountPath: /var/www/html + +# - name: nextcloud-webserver-data-data +# mountPath: /var/www/html/data +# - name: nextcloud-webserver-config +# mountPath: /var/www/html/config +# - name: nextcloud-webserver-apps +# mountPath: /var/www/html/apps + + + volumes: +# - name: nextcloud +# hostPath: +# path: /opt/kubernetes/Nextcloud_kube/data/nextcloud + +# - name: nextcloud-webserver-data +# persistentVolumeClaim: +# claimName: nextcloud-webserver + + - name: nextcloud-webserver-data + persistentVolumeClaim: + claimName: nextcloud-webserver-data + +# - name: nextcloud-webserver-config +# persistentVolumeClaim: +# claimName: nextcloud-webserver-config + + # - name: nextcloud-webserver-apps +# persistentVolumeClaim: +# claimName: nextcloud-webserver-apps + securityContext: + # Will mount configuration files as www-data (id: 33) for nextcloud + fsGroup: 33 + +--- +apiVersion: v1 +kind: Service +metadata: + name: webserver + namespace: nextcloud-testing +spec: + ports: + - name: http + port: 80 +# targetPort: webserver-port + protocol: TCP +# nodePort: 31236 +# type: NodePort + selector: + app: nextcloud-webserver diff --git a/nextcloud_testing/Nextcloud-webserver.kube.yaml.save b/nextcloud_testing/Nextcloud-webserver.kube.yaml.save new file mode 100644 index 0000000..7bd4d3f --- /dev/null +++ b/nextcloud_testing/Nextcloud-webserver.kube.yaml.save @@ -0,0 +1,89 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: nextcloud-testing +--- +apiVersion: apps/v1 +kind: Deploymentx +metadata: + name: nextcloud-webserver + namespace: nextcloud +spec: + replicas: 1 + selector: + matchLabels: + app: nextcloud-webserver + template: + metadata: + labels: + app: nextcloud-webserver + spec: + nodeName: kube-master + containers: + - name: nextcloud-webserver +# image: nextcloud:apache + image: nextcloud:28.0.5-apache + imagePullPolicy: Always + ports: + - containerPort: 80 + name: webserver-port + env: + #- name: REDIS_HOST + # value: "redis://redis:6379" + - name: POSTGRES_HOST + value: "db" + + volumeMounts: +# - name: nextcloud +# mountPath: /var/www/html +# - name: nextcloud-webserver-data +# mountPath: /var/www/html + + - name: nextcloud-webserver-data-data + mountPath: /var/www/html/data + - name: nextcloud-webserver-config + mountPath: /var/www/html/config + - name: nextcloud-webserver-apps + mountPath: /var/www/html/apps + + + volumes: + - name: nextcloud + hostPath: + path: /opt/kubernetes/Nextcloud_kube/data/nextcloud + +# - name: nextcloud-webserver-data +# persistentVolumeClaim: +# claimName: nextcloud-webserver + + - name: nextcloud-webserver-data-data + persistentVolumeClaim: + claimName: nextcloud-webserver-data + + - name: nextcloud-webserver-config + persistentVolumeClaim: + claimName: nextcloud-webserver-config + + - name: nextcloud-webserver-apps + persistentVolumeClaim: + claimName: nextcloud-webserver-apps + securityContext: + # Will mount configuration files as www-data (id: 33) for nextcloud + fsGroup: 33 + +--- +apiVersion: v1 +kind: Service +metadata: + name: webserver + namespace: nextcloud +spec: + ports: + - name: http + port: 80 +# targetPort: webserver-port + protocol: TCP +# nodePort: 31236 +# type: NodePort + selector: + app: nextcloud-webserver diff --git a/nextcloud_testing/helm_nextcloud.yaml b/nextcloud_testing/helm_nextcloud.yaml new file mode 100644 index 0000000..ec85fa1 --- /dev/null +++ b/nextcloud_testing/helm_nextcloud.yaml @@ -0,0 +1,156 @@ +--- +# Source: nextcloud/templates/secrets.yaml +apiVersion: v1 +kind: Secret +metadata: + name: nextcloud + namespace: nextcloud-testing + labels: + app.kubernetes.io/name: nextcloud + helm.sh/chart: nextcloud-4.6.9 + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/managed-by: Helm +type: Opaque +data: + nextcloud-username: "bmV4dGNsb3Vk" + nextcloud-password: "bmV4dGNsb3Vk" +--- +# Source: nextcloud/templates/service.yaml +apiVersion: v1 +kind: Service +metadata: + namespace: nextcloud-testing + name: nextcloud + labels: + app.kubernetes.io/name: nextcloud + helm.sh/chart: nextcloud-4.6.9 + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: app +spec: + type: ClusterIP + ports: + - port: 8080 + targetPort: 80 + protocol: TCP + name: http + selector: + app.kubernetes.io/name: nextcloud + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/component: app +--- +# Source: nextcloud/templates/deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: nextcloud-testing + name: nextcloud + labels: + app.kubernetes.io/name: nextcloud + helm.sh/chart: nextcloud-4.6.9 + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: app +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: nextcloud + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/component: app + template: + metadata: + labels: + app.kubernetes.io/name: nextcloud + app.kubernetes.io/instance: nextcloud + app.kubernetes.io/component: app + annotations: + nextcloud-config-hash: a5aae02b1b8278a9c8a2dc143e82d3737fc295f62c34afd617207f37d1b2b438 + php-config-hash: 44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a + hooks-hash: 9525c2748a6c7cd0e28ec740623d0b3fa5a75c83b51ccfd136bc89c76737b204 + spec: + containers: + - name: nextcloud + image: nextcloud:29.0.0-apache + imagePullPolicy: IfNotPresent + env: + + - name: SQLITE_DATABASE + value: "nextcloud" + - name: NEXTCLOUD_ADMIN_USER + valueFrom: + secretKeyRef: + name: nextcloud + key: nextcloud-username + - name: NEXTCLOUD_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: nextcloud + key: nextcloud-password + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: nextcloud-testing.tryton.geeraert.eu + - name: NEXTCLOUD_DATA_DIR + value: "/var/www/html/data" + - name: APACHE_BODY_LIMIT + value: "0" + ports: + - name: http + containerPort: 80 + protocol: TCP +# livenessProbe: +# httpGet: +# path: /status.php +# port: 80 +# httpHeaders: +# - name: Host +# value: "nextcloud-testing.tryton.geeraert.eu" +# initialDelaySeconds: 10 +# periodSeconds: 10 +# timeoutSeconds: 5 +# successThreshold: 1 +# failureThreshold: 3 +# readinessProbe: +# httpGet: +# path: /status.php +# port: 80 +# httpHeaders: +# - name: Host +# value: "nextcloud-testing.tryton.geeraert.eu" +# initialDelaySeconds: 10 +# periodSeconds: 10 +# timeoutSeconds: 5 +# successThreshold: 1 +# failureThreshold: 3 + resources: + {} + volumeMounts: + - name: nextcloud-main + mountPath: /var/www/ + subPath: root + - name: nextcloud-main + mountPath: /var/www/html + subPath: html + - name: nextcloud-main + mountPath: /var/www/html/data + subPath: data + - name: nextcloud-main + mountPath: /var/www/html/config + subPath: config + - name: nextcloud-main + mountPath: /var/www/html/custom_apps + subPath: custom_apps + - name: nextcloud-main + mountPath: /var/www/tmp + subPath: tmp + - name: nextcloud-main + mountPath: /var/www/html/themes + subPath: themes + volumes: + - name: nextcloud-main + persistentVolumeClaim: + claimName: nextcloud-webserver + securityContext: + # Will mount configuration files as www-data (id: 33) for nextcloud + fsGroup: 33 diff --git a/nextcloud_testing/namespace.yaml b/nextcloud_testing/namespace.yaml new file mode 100644 index 0000000..b71a33c --- /dev/null +++ b/nextcloud_testing/namespace.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: nextcloud-testing +--- diff --git a/nextcloud_testing/pvc.claim.yaml b/nextcloud_testing/pvc.claim.yaml new file mode 100644 index 0000000..2284128 --- /dev/null +++ b/nextcloud_testing/pvc.claim.yaml @@ -0,0 +1,14 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: nextcloud-webserver-data + namespace: nextcloud-testing +spec: + storageClassName: nfs-storage-intelligent + accessModes: + - ReadWriteMany + resources: + requests: + storage: 2Gi +--- +