From a8d1141cb0a45ab5d54510b0188f9751c0c91648 Mon Sep 17 00:00:00 2001 From: "jona.klaess" Date: Sun, 7 Jun 2026 12:21:07 +0200 Subject: [PATCH] configure longhorn for pvc --- longhorn/kustomization.yaml | 17 +++++++++++++ longhorn/longhorn-application.yaml | 20 ++++++++++++++++ longhorn/longhorn-istio.yaml | 38 ++++++++++++++++++++++++++++++ ptp-chat/ptp-chat-application.yaml | 2 +- ptp-chat/ptp-chat-backend.yaml | 2 +- ptp-chat/ptp-chat-db.yaml | 4 ++-- ptp-chat/ptp-chat-hpa.yaml | 25 -------------------- 7 files changed, 79 insertions(+), 29 deletions(-) create mode 100644 longhorn/kustomization.yaml create mode 100644 longhorn/longhorn-application.yaml create mode 100644 longhorn/longhorn-istio.yaml diff --git a/longhorn/kustomization.yaml b/longhorn/kustomization.yaml new file mode 100644 index 0000000..4c3e2d4 --- /dev/null +++ b/longhorn/kustomization.yaml @@ -0,0 +1,17 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +helmCharts: + - name: longhorn + repo: https://charts.longhorn.io + releaseName: longhorn + namespace: longhorn-system + version: v1.12.0 + valuesInline: + preUpgradeChecker: + jobEnabled: false + csi: + kubeletRootDir: /var/snap/microk8s/common/var/lib/kubelet + +resources: + - longhorn-istio.yaml \ No newline at end of file diff --git a/longhorn/longhorn-application.yaml b/longhorn/longhorn-application.yaml new file mode 100644 index 0000000..bd52a38 --- /dev/null +++ b/longhorn/longhorn-application.yaml @@ -0,0 +1,20 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: longhorn + namespace: longhorn-system +spec: + project: longhorn + source: + repoURL: https://gitea.controller.bittehackmichnicht.de/argocd/kubernetes-config.git + targetRevision: main + path: longhorn + destination: + server: https://kubernetes.default.svc + namespace: longhorn-system + syncPolicy: + syncOptions: + - ServerSideApply=true + automated: + prune: true + selfHeal: true diff --git a/longhorn/longhorn-istio.yaml b/longhorn/longhorn-istio.yaml new file mode 100644 index 0000000..993ee69 --- /dev/null +++ b/longhorn/longhorn-istio.yaml @@ -0,0 +1,38 @@ +apiVersion: networking.istio.io/v1beta1 +kind: Gateway +metadata: + name: longhorn-gateway + namespace: longhorn-system +spec: + selector: + istio: ingressgateway + servers: + - port: + number: 443 + name: https-longhorn + protocol: HTTPS + hosts: + - longhorn.k8s.bittehackmichnicht.de + tls: + mode: PASSTHROUGH +--- +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + name: longhorn-vs + namespace: longhorn-system +spec: + hosts: + - longhorn.k8s.bittehackmichnicht.de + gateways: + - longhorn-gateway + tls: + - match: + - port: 443 + sniHosts: + - longhorn.k8s.bittehackmichnicht.de + route: + - destination: + host: longhorn-ui.longhorn-system.svc.cluster.local + port: + number: 80 diff --git a/ptp-chat/ptp-chat-application.yaml b/ptp-chat/ptp-chat-application.yaml index 32ff143..f35f121 100644 --- a/ptp-chat/ptp-chat-application.yaml +++ b/ptp-chat/ptp-chat-application.yaml @@ -4,7 +4,7 @@ metadata: name: ptp-chat namespace: ptp-chat spec: - project: default + project: ptp-chat source: repoURL: https://gitea.controller.bittehackmichnicht.de/argocd/kubernetes-config.git targetRevision: main diff --git a/ptp-chat/ptp-chat-backend.yaml b/ptp-chat/ptp-chat-backend.yaml index 214092a..88e6ddc 100644 --- a/ptp-chat/ptp-chat-backend.yaml +++ b/ptp-chat/ptp-chat-backend.yaml @@ -17,7 +17,7 @@ spec: spec: containers: - name: ptp-chat-backend - image: gitea.controller.bittehackmichnicht.de/apps/ptpchat-frontend/ptp-chat-backend:latest + image: gitea.controller.bittehackmichnicht.de/apps/ptpchat-backend/ptp-chat-backend:latest imagePullPolicy: Always envFrom: - secretRef: diff --git a/ptp-chat/ptp-chat-db.yaml b/ptp-chat/ptp-chat-db.yaml index 376ed4c..79f830a 100644 --- a/ptp-chat/ptp-chat-db.yaml +++ b/ptp-chat/ptp-chat-db.yaml @@ -7,10 +7,10 @@ metadata: namespace: ptp-chat spec: accessModes: - - ReadWriteMany + - ReadWriteOnce resources: requests: - storage: 2Gi + storage: 1Gi --- apiVersion: apps/v1 kind: Deployment diff --git a/ptp-chat/ptp-chat-hpa.yaml b/ptp-chat/ptp-chat-hpa.yaml index 2156ac7..3dc6fa8 100644 --- a/ptp-chat/ptp-chat-hpa.yaml +++ b/ptp-chat/ptp-chat-hpa.yaml @@ -41,28 +41,3 @@ spec: target: type: Utilization averageUtilization: 70 ---- -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: ptp-chat-db-hpa -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: ptp-chat-db - minReplicas: 1 - maxReplicas: 5 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 70 - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: 70 \ No newline at end of file