diff --git a/apps/obsidian/base/deployment.yaml b/apps/obsidian/base/deployment.yaml new file mode 100644 index 0000000..67ee155 --- /dev/null +++ b/apps/obsidian/base/deployment.yaml @@ -0,0 +1,42 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: obsidian + namespace: obsidian + labels: + app.kubernetes.io/name: obsidian +spec: + selector: + matchLabels: + app.kubernetes.io/name: obsidian + template: + metadata: + labels: + app.kubernetes.io/name: obsidian + spec: + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + containers: + - name: obsidian + image: ghcr.io/sytone/obsidian-remote:0.1.1 + securityContext: + allowPrivilegeEscalation: false + ports: + - protocol: TCP + containerPort: 8080 + name: http + volumeMounts: + - name: obsidian-config + mountPath: /config + - name: obsidian-vaults + mountPath: /vaults + volumes: + - name: obsidian-config + hostPath: + path: /mnt/nfs/AppData/obsidian/config + type: Directory + - name: obsidian-vaults + hostPath: + path: /mnt/nfs/AppData/obsidian/vaults + type: Directory diff --git a/apps/obsidian/base/kustomization.yaml b/apps/obsidian/base/kustomization.yaml new file mode 100644 index 0000000..87b09a3 --- /dev/null +++ b/apps/obsidian/base/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./deployment.yaml + - ./service.yaml \ No newline at end of file diff --git a/apps/obsidian/base/service.yaml b/apps/obsidian/base/service.yaml new file mode 100644 index 0000000..ee950da --- /dev/null +++ b/apps/obsidian/base/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: obsidian + namespace: obsidian + labels: + app.kubernetes.io/name: obsidian +spec: + selector: + app.kubernetes.io/name: obsidian + type: ClusterIP + internalTrafficPolicy: Cluster + ports: + - protocol: TCP + port: 8080 + targetPort: 8080 + name: http diff --git a/apps/obsidian/env/k3s-cluster/config.json b/apps/obsidian/env/k3s-cluster/config.json new file mode 100644 index 0000000..b3ec9c2 --- /dev/null +++ b/apps/obsidian/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "obsidian", + "userGivenName": "obsidian", + "namespace": "obsidian", + "destNamespace": "obsidian", + "destServer": "https://kubernetes.default.svc", + "srcPath": "apps/obsidian/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/obsidian/env/k3s-cluster/ingress.yaml b/apps/obsidian/env/k3s-cluster/ingress.yaml new file mode 100644 index 0000000..cd2be23 --- /dev/null +++ b/apps/obsidian/env/k3s-cluster/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: obsidian-ingress + namespace: obsidian + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" +spec: + ingressClassName: nginx + rules: + - host: "obsidian.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: obsidian + port: + number: 8080 \ No newline at end of file diff --git a/apps/obsidian/env/k3s-cluster/kustomization.yaml b/apps/obsidian/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..3ea3085 --- /dev/null +++ b/apps/obsidian/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base + - ./ingress.yaml \ No newline at end of file diff --git a/resources/namespaces/env/k3s-cluster/templates/obsidian.yaml b/resources/namespaces/env/k3s-cluster/templates/obsidian.yaml new file mode 100644 index 0000000..e6594f2 --- /dev/null +++ b/resources/namespaces/env/k3s-cluster/templates/obsidian.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Namespace +metadata: + annotations: + argocd.argoproj.io/sync-options: Prune=false + creationTimestamp: null + name: obsidian +spec: {} +status: {}