From eac0bdaa9e69ea28e3da5305a639f9c7c91f5f3c Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Tue, 16 Jul 2024 13:44:16 +1000 Subject: [PATCH] add app snippet-box --- apps/snippet-box/base/deployment.yaml | 34 +++++++++++++++++++ apps/snippet-box/base/ingress.yaml | 21 ++++++++++++ apps/snippet-box/base/kustomization.yaml | 6 ++++ apps/snippet-box/base/service.yaml | 17 ++++++++++ apps/snippet-box/env/k3s-cluster/config.json | 11 ++++++ .../env/k3s-cluster/kustomization.yaml | 4 +++ 6 files changed, 93 insertions(+) create mode 100644 apps/snippet-box/base/deployment.yaml create mode 100644 apps/snippet-box/base/ingress.yaml create mode 100644 apps/snippet-box/base/kustomization.yaml create mode 100644 apps/snippet-box/base/service.yaml create mode 100644 apps/snippet-box/env/k3s-cluster/config.json create mode 100644 apps/snippet-box/env/k3s-cluster/kustomization.yaml diff --git a/apps/snippet-box/base/deployment.yaml b/apps/snippet-box/base/deployment.yaml new file mode 100644 index 0000000..b7cf5e4 --- /dev/null +++ b/apps/snippet-box/base/deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: snippet-box + namespace: snippet-box + labels: + app.kubernetes.io/name: snippet-box +spec: + selector: + matchLabels: + app.kubernetes.io/name: snippet-box + template: + metadata: + labels: + app.kubernetes.io/name: snippet-box + spec: + containers: + - name: snippet-box + image: pawelmalak/snippet-box:arm + ports: + - protocol: TCP + containerPort: 5000 + name: snippet-box + env: + - name: TZ + value: Australia/Sydney + volumeMounts: + - name: snippet-box-data + mountPath: /app/data + volumes: + - name: snippet-box-data + hostPath: + path: /mnt/nfs/AppData/snippet-box + type: Directory diff --git a/apps/snippet-box/base/ingress.yaml b/apps/snippet-box/base/ingress.yaml new file mode 100644 index 0000000..fa1fcd5 --- /dev/null +++ b/apps/snippet-box/base/ingress.yaml @@ -0,0 +1,21 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: snippet-box-ingress + namespace: snippet-box + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" +spec: + ingressClassName: nginx + rules: + - host: "snippet-box.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: snippet-box + port: + number: 5000 \ No newline at end of file diff --git a/apps/snippet-box/base/kustomization.yaml b/apps/snippet-box/base/kustomization.yaml new file mode 100644 index 0000000..1ad0930 --- /dev/null +++ b/apps/snippet-box/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/snippet-box/base/service.yaml b/apps/snippet-box/base/service.yaml new file mode 100644 index 0000000..7261884 --- /dev/null +++ b/apps/snippet-box/base/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: snippet-box + namespace: snippet-box + labels: + app.kubernetes.io/name: snippet-box +spec: + selector: + app.kubernetes.io/name: snippet-box + type: ClusterIP + internalTrafficPolicy: Cluster + ports: + - protocol: TCP + port: 5000 + targetPort: 5000 + name: snippet-box diff --git a/apps/snippet-box/env/k3s-cluster/config.json b/apps/snippet-box/env/k3s-cluster/config.json new file mode 100644 index 0000000..98e6b4f --- /dev/null +++ b/apps/snippet-box/env/k3s-cluster/config.json @@ -0,0 +1,11 @@ +{ + "appName": "snippet-box", + "userGivenName": "snippet-box", + "destNamespace": "snippet-box", + "destServer": "https://kubernetes.default.svc", + "srcPath": "apps/snippet-box/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/snippet-box/env/k3s-cluster/kustomization.yaml b/apps/snippet-box/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..a227ac4 --- /dev/null +++ b/apps/snippet-box/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