diff --git a/apps/nextcloud/base/deployment.yaml b/apps/nextcloud/base/deployment.yaml new file mode 100644 index 0000000..3a579a5 --- /dev/null +++ b/apps/nextcloud/base/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nextcloud + namespace: nextcloud + labels: + app.kubernetes.io/name: nextcloud +spec: + selector: + matchLabels: + app.kubernetes.io/name: nextcloud + template: + metadata: + labels: + app.kubernetes.io/name: nextcloud + spec: + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + containers: + - name: nextcloud + image: nextcloud/all-in-one + securityContext: + allowPrivilegeEscalation: false + ports: + - protocol: TCP + containerPort: 80 + name: 80-tcp + - protocol: TCP + containerPort: 8080 + name: 8080-tcp + - protocol: TCP + containerPort: 8443 + name: 8443-tcp + - protocol: TCP + containerPort: 3478 + name: 3478-tcp + - protocol: UDP + containerPort: 3478 + name: 3478-udp + volumeMounts: + - name: nextcloud_aio_mastercontainer + mountPath: /mnt/docker-aio-config + - name: docker-socket + mountPath: /var/run/docker.sock + readOnly: true + volumes: + - name: nextcloud_aio_mastercontainer + hostPath: + path: /mnt/nfs/AppData/nextcloud + type: Directory + - name: docker-socket + hostPath: + path: /var/run/docker.sock + type: Socket \ No newline at end of file diff --git a/apps/nextcloud/base/ingress.yaml b/apps/nextcloud/base/ingress.yaml new file mode 100644 index 0000000..a90b704 --- /dev/null +++ b/apps/nextcloud/base/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: nextcloud-ingress + namespace: nextcloud + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" +spec: + ingressClassName: nginx + rules: + - host: "nextcloud.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: nextcloud + port: + number: 8080 \ No newline at end of file diff --git a/apps/nextcloud/base/kustomization.yaml b/apps/nextcloud/base/kustomization.yaml new file mode 100644 index 0000000..1ad0930 --- /dev/null +++ b/apps/nextcloud/base/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./deployment.yaml + - ./service.yaml + - ./ingress.yaml \ No newline at end of file diff --git a/apps/nextcloud/base/service.yaml b/apps/nextcloud/base/service.yaml new file mode 100644 index 0000000..6e5e791 --- /dev/null +++ b/apps/nextcloud/base/service.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: Service +metadata: + name: nextcloud + namespace: nextcloud + labels: + app.kubernetes.io/name: nextcloud +spec: + selector: + app.kubernetes.io/name: nextcloud + type: ClusterIP + internalTrafficPolicy: Cluster + ports: + - protocol: TCP + port: 80 + targetPort: 80 + name: 80-tcp + - protocol: TCP + port: 8080 + targetPort: 8080 + name: 8080-tcp + - protocol: TCP + port: 8443 + targetPort: 8443 + name: 8443-tcp diff --git a/apps/nextcloud/env/k3s-cluster/config.json b/apps/nextcloud/env/k3s-cluster/config.json new file mode 100644 index 0000000..c9fb170 --- /dev/null +++ b/apps/nextcloud/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "nextcloud", + "userGivenName": "nextcloud", + "namespace": "nextcloud", + "destNamespace": "nextcloud", + "destServer": "https://kubernetes.default.svc", + "srcPath": "apps/nextcloud/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/apps/nextcloud/env/k3s-cluster/kustomization.yaml b/apps/nextcloud/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..a227ac4 --- /dev/null +++ b/apps/nextcloud/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base \ No newline at end of file diff --git a/resources/namespaces/base/kustomization.yaml b/resources/namespaces/base/kustomization.yaml index 4e15856..f33cb14 100644 --- a/resources/namespaces/base/kustomization.yaml +++ b/resources/namespaces/base/kustomization.yaml @@ -21,6 +21,7 @@ resources: - ./minio.yaml - ./mongodb.yaml - ./new-relic.yaml + - ./nextcloud.yaml - ./nexus.yaml - ./postgresql.yaml - ./prometheus.yaml diff --git a/resources/namespaces/base/nextcloud.yaml b/resources/namespaces/base/nextcloud.yaml new file mode 100644 index 0000000..797692b --- /dev/null +++ b/resources/namespaces/base/nextcloud.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Namespace +metadata: + annotations: + argocd.argoproj.io/sync-options: Prune=false + creationTimestamp: null + name: nextcloud +spec: {} +status: {}