diff --git a/customers/base/db1-service.yml b/customers/base/db1-service.yml new file mode 100644 index 0000000..4a538dc --- /dev/null +++ b/customers/base/db1-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: multinode-db + namespace: nextcloud +spec: + type: ExternalName + externalName: multinode-db1.drive.test.sunet.se + ports: + - port: 3306 diff --git a/customers/base/db2-service.yml b/customers/base/db2-service.yml new file mode 100644 index 0000000..85ab3d0 --- /dev/null +++ b/customers/base/db2-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: multinode-db + namespace: nextcloud +spec: + type: ExternalName + externalName: multinode-db2.drive.test.sunet.se + ports: + - port: 3306 diff --git a/customers/base/db3-service.yml b/customers/base/db3-service.yml new file mode 100644 index 0000000..36c745e --- /dev/null +++ b/customers/base/db3-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: multinode-db + namespace: nextcloud +spec: + type: ExternalName + externalName: multinode-db3.drive.test.sunet.se + ports: + - port: 3306 diff --git a/customers/base/kustomization.yaml b/customers/base/kustomization.yaml new file mode 100644 index 0000000..dfd53a6 --- /dev/null +++ b/customers/base/kustomization.yaml @@ -0,0 +1,8 @@ +resources: + - db-service.yml + - nextcloud-deployment.yml + - nextcloud-ingress.yml + - nextcloud-namespace.yml + - nextcloud-pvc.yml + - nextcloud-service.yml + - s3-service.yml diff --git a/customers/base/nextcloud-deployment.yml b/customers/base/nextcloud-deployment.yml new file mode 100644 index 0000000..5438d54 --- /dev/null +++ b/customers/base/nextcloud-deployment.yml @@ -0,0 +1,80 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: customer-node + namespace: customer + labels: + app: customer-node +spec: + replicas: 1 + selector: + matchLabels: + app: customer-node + template: + metadata: + creationTimestamp: + labels: + app: customer-node + spec: + volumes: + - name: server-storage + persistentVolumeClaim: + claimName: customer-shared-storage-claim + containers: + - name: customer + image: customer + volumeMounts: + - name: server-storage + mountPath: /var/www/html + subPath: server-data + env: + - name: MYSQL_DATABASE + value: "customer_customer" + - name: MYSQL_USER + value: "customer" + - name: MYSQL_HOST + value: "proxysql.proxysql" + - name: MYSQL_PASSWORD + valueFrom: + secretKeyRef: + name: db-secret + key: "db_password" + - name: MYSQL_PORT + value: "6033" + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: "customer.drive.test.sunet.se" + - name: NEXTCLOUD_ADMIN_USER + value: _customer + - name: NEXTCLOUD_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: nc-secret + key: "nc_admin_password" + - name: OBJECTSTORE_S3_REGION + value: "us-east-1" + - name: OBJECTSTORE_S3_HOST + value: "s3.sto4.safedc.net" + - name: OBJECTSTORE_S3_BUCKET + value: "primary-customer-drive-test.sunet.se" + - name: OBJECTSTORE_S3_KEY + valueFrom: + secretKeyRef: + name: s3-secret + key: "s3_key" + - name: OBJECTSTORE_S3_SECRET + valueFrom: + secretKeyRef: + name: s3-secret + key: "s3_secret" + - name: OBJECTSTORE_S3_USEPATH_STYLE + value: "true" + - name: OBJECTSTORE_S3_AUTOCREATE + value: "true" + - name: OBJECTSTORE_S3_SSL + value: "true" + - name: REDIS_HOST + value: "redis.redis" + resources: {} + strategy: {} +status: {} diff --git a/customers/base/nextcloud-ingress.yml b/customers/base/nextcloud-ingress.yml new file mode 100644 index 0000000..3dcfe37 --- /dev/null +++ b/customers/base/nextcloud-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: customer-ingress + namespace: customer + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: customer-node + port: + number: 8443 + tls: + - hosts: + - customer.drive.test.sunet.se + secretName: tls-secret + + rules: + - host: customer.drive.test.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: customer-node + port: + number: 80 diff --git a/customers/base/nextcloud-namespace.yml b/customers/base/nextcloud-namespace.yml new file mode 100644 index 0000000..160597c --- /dev/null +++ b/customers/base/nextcloud-namespace.yml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: customer +spec: + finalizers: + - kubernetes diff --git a/customers/base/nextcloud-pvc.yml b/customers/base/nextcloud-pvc.yml new file mode 100644 index 0000000..d361ab1 --- /dev/null +++ b/customers/base/nextcloud-pvc.yml @@ -0,0 +1,15 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: customer-shared-storage-claim + namespace: customer + annotations: + volume.beta.kubernetes.io/storage-class: openebs-jiva-3repl +spec: + storageClassName: openebs-jiva-3repl + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5G diff --git a/customers/base/nextcloud-service.yml b/customers/base/nextcloud-service.yml new file mode 100644 index 0000000..b65148a --- /dev/null +++ b/customers/base/nextcloud-service.yml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +items: +- apiVersion: v1 + kind: Service + metadata: + labels: + app: customer-node + name: customer-node + namespace: customer + spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: customer-node + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +kind: List +metadata: + resourceVersion: "" + selfLink: "" diff --git a/customers/base/s3-service.yml b/customers/base/s3-service.yml new file mode 100644 index 0000000..3211602 --- /dev/null +++ b/customers/base/s3-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: sto4 + namespace: customer +spec: + type: ExternalName + externalName: s3.sto4.safedc.net + ports: + - port: 443 diff --git a/customers/overlays/vr/prod/kustomization.yaml b/customers/overlays/vr/prod/kustomization.yaml new file mode 100644 index 0000000..970167b --- /dev/null +++ b/customers/overlays/vr/prod/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: 'kustomize.config.k8s.io/v1beta1' +kind: Kustomization +bases: +- ../../../base +patchesStrategicMerge: + - nextcloud-deployment.yml + - nextcloud-ingress.yml + - nextcloud-namespace.yml + - nextcloud-pvc.yml + - nextcloud-service.yml + - s3-service.yml diff --git a/customers/overlays/vr/prod/nextcloud-deployment.yml b/customers/overlays/vr/prod/nextcloud-deployment.yml new file mode 100644 index 0000000..02f2933 --- /dev/null +++ b/customers/overlays/vr/prod/nextcloud-deployment.yml @@ -0,0 +1,39 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: vr-node + namespace: vr + labels: + app: vr-node +spec: + replicas: 1 + selector: + matchLabels: + app: vr-node + template: + metadata: + creationTimestamp: + labels: + app: vr-node + spec: + volumes: + - name: server-storage + persistentVolumeClaim: + claimName: vr-shared-storage-claim + containers: + - name: vr + env: + - name: MYSQL_DATABASE + value: "vr_nextcloud" + - name: MYSQL_USER + value: "vr_nextcloud" + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: "vr.drive.sunet.se" + - name: OBJECTSTORE_S3_HOST + value: "s3.sto4.safedc.net" + - name: OBJECTSTORE_S3_BUCKET + value: "primary-vr-drive.sunet.se" + resources: {} + strategy: {} +status: {} diff --git a/customers/overlays/vr/prod/nextcloud-ingress.yml b/customers/overlays/vr/prod/nextcloud-ingress.yml new file mode 100644 index 0000000..29679c6 --- /dev/null +++ b/customers/overlays/vr/prod/nextcloud-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: vr-ingress + namespace: vr + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: vr-node + port: + number: 8443 + tls: + - hosts: + - vr.drive.sunet.se + secretName: tls-secret + + rules: + - host: vr.drive.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: vr-node + port: + number: 80 diff --git a/customers/overlays/vr/prod/nextcloud-namespace.yml b/customers/overlays/vr/prod/nextcloud-namespace.yml new file mode 100644 index 0000000..087798c --- /dev/null +++ b/customers/overlays/vr/prod/nextcloud-namespace.yml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: vr +spec: + finalizers: + - kubernetes diff --git a/customers/overlays/vr/prod/nextcloud-pvc.yml b/customers/overlays/vr/prod/nextcloud-pvc.yml new file mode 100644 index 0000000..e6251e9 --- /dev/null +++ b/customers/overlays/vr/prod/nextcloud-pvc.yml @@ -0,0 +1,15 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: vr-shared-storage-claim + namespace: vr + annotations: + volume.beta.kubernetes.io/storage-class: openebs-jiva-3repl +spec: + storageClassName: openebs-jiva-3repl + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5G diff --git a/customers/overlays/vr/prod/nextcloud-service.yml b/customers/overlays/vr/prod/nextcloud-service.yml new file mode 100644 index 0000000..91b8d22 --- /dev/null +++ b/customers/overlays/vr/prod/nextcloud-service.yml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +items: +- apiVersion: v1 + kind: Service + metadata: + labels: + app: vr-node + name: vr-node + namespace: vr + spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: vr-node + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +kind: List +metadata: + resourceVersion: "" + selfLink: "" diff --git a/customers/overlays/vr/prod/s3-service.yml b/customers/overlays/vr/prod/s3-service.yml new file mode 100644 index 0000000..6d054af --- /dev/null +++ b/customers/overlays/vr/prod/s3-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: sto4 + namespace: vr +spec: + type: ExternalName + externalName: s3.sto4.safedc.net + ports: + - port: 443 diff --git a/customers/overlays/vr/test/kustomization.yaml b/customers/overlays/vr/test/kustomization.yaml new file mode 100644 index 0000000..970167b --- /dev/null +++ b/customers/overlays/vr/test/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: 'kustomize.config.k8s.io/v1beta1' +kind: Kustomization +bases: +- ../../../base +patchesStrategicMerge: + - nextcloud-deployment.yml + - nextcloud-ingress.yml + - nextcloud-namespace.yml + - nextcloud-pvc.yml + - nextcloud-service.yml + - s3-service.yml diff --git a/customers/overlays/vr/test/nextcloud-deployment.yml b/customers/overlays/vr/test/nextcloud-deployment.yml new file mode 100644 index 0000000..0f29b63 --- /dev/null +++ b/customers/overlays/vr/test/nextcloud-deployment.yml @@ -0,0 +1,39 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: vr-node + namespace: vr + labels: + app: vr-node +spec: + replicas: 1 + selector: + matchLabels: + app: vr-node + template: + metadata: + creationTimestamp: + labels: + app: vr-node + spec: + volumes: + - name: server-storage + persistentVolumeClaim: + claimName: vr-shared-storage-claim + containers: + - name: vr + env: + - name: MYSQL_DATABASE + value: "vr_nextcloud" + - name: MYSQL_USER + value: "vr_nextcloud" + - name: NEXTCLOUD_TRUSTED_DOMAINS + value: "vr.drive.test.sunet.se" + - name: OBJECTSTORE_S3_HOST + value: "s3.sto4.safedc.net" + - name: OBJECTSTORE_S3_BUCKET + value: "primary-vr-drive-test.sunet.se" + resources: {} + strategy: {} +status: {} diff --git a/customers/overlays/vr/test/nextcloud-ingress.yml b/customers/overlays/vr/test/nextcloud-ingress.yml new file mode 100644 index 0000000..1fa027f --- /dev/null +++ b/customers/overlays/vr/test/nextcloud-ingress.yml @@ -0,0 +1,32 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: vr-ingress + namespace: vr + annotations: + kubernetes.io/ingress.class: traefik + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" +spec: + defaultBackend: + service: + name: vr-node + port: + number: 8443 + tls: + - hosts: + - vr.drive.test.sunet.se + secretName: tls-secret + + rules: + - host: vr.drive.test.sunet.se + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: vr-node + port: + number: 80 diff --git a/customers/overlays/vr/test/nextcloud-namespace.yml b/customers/overlays/vr/test/nextcloud-namespace.yml new file mode 100644 index 0000000..087798c --- /dev/null +++ b/customers/overlays/vr/test/nextcloud-namespace.yml @@ -0,0 +1,8 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: vr +spec: + finalizers: + - kubernetes diff --git a/customers/overlays/vr/test/nextcloud-pvc.yml b/customers/overlays/vr/test/nextcloud-pvc.yml new file mode 100644 index 0000000..e6251e9 --- /dev/null +++ b/customers/overlays/vr/test/nextcloud-pvc.yml @@ -0,0 +1,15 @@ +--- +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: vr-shared-storage-claim + namespace: vr + annotations: + volume.beta.kubernetes.io/storage-class: openebs-jiva-3repl +spec: + storageClassName: openebs-jiva-3repl + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5G diff --git a/customers/overlays/vr/test/nextcloud-service.yml b/customers/overlays/vr/test/nextcloud-service.yml new file mode 100644 index 0000000..91b8d22 --- /dev/null +++ b/customers/overlays/vr/test/nextcloud-service.yml @@ -0,0 +1,25 @@ +--- +apiVersion: v1 +items: +- apiVersion: v1 + kind: Service + metadata: + labels: + app: vr-node + name: vr-node + namespace: vr + spec: + ports: + - port: 80 + protocol: TCP + targetPort: 80 + selector: + app: vr-node + sessionAffinity: None + type: ClusterIP + status: + loadBalancer: {} +kind: List +metadata: + resourceVersion: "" + selfLink: "" diff --git a/customers/overlays/vr/test/s3-service.yml b/customers/overlays/vr/test/s3-service.yml new file mode 100644 index 0000000..6d054af --- /dev/null +++ b/customers/overlays/vr/test/s3-service.yml @@ -0,0 +1,11 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: sto4 + namespace: vr +spec: + type: ExternalName + externalName: s3.sto4.safedc.net + ports: + - port: 443