From 170ef2d1161b463e6b41575d0a55051bf5bd44f2 Mon Sep 17 00:00:00 2001 From: ahmza Date: Thu, 3 Sep 2026 03:29:28 +0100 Subject: [PATCH] Give demo app a real Longhorn-backed PVC --- apps/demo/deployment.yaml | 8 ++++++++ apps/demo/pvc.yaml | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 apps/demo/pvc.yaml diff --git a/apps/demo/deployment.yaml b/apps/demo/deployment.yaml index 03dfbed..0b0691f 100644 --- a/apps/demo/deployment.yaml +++ b/apps/demo/deployment.yaml @@ -32,7 +32,15 @@ spec: # Mounts the ConfigMap's index.html over nginx's default page. - name: page mountPath: /usr/share/nginx/html + # Real, replicated storage from apps/demo/pvc.yaml — a harmless + # subdirectory nginx doesn't otherwise use, proving a Longhorn + # volume can actually be attached and written to. + - name: data + mountPath: /usr/share/nginx/html/data volumes: - name: page configMap: name: demo-page + - name: data + persistentVolumeClaim: + claimName: demo-data diff --git a/apps/demo/pvc.yaml b/apps/demo/pvc.yaml new file mode 100644 index 0000000..59e0a03 --- /dev/null +++ b/apps/demo/pvc.yaml @@ -0,0 +1,16 @@ +# A hands-on check that Longhorn actually works (see docs/06-longhorn.md). +# No storageClassName is set, so Kubernetes uses whichever StorageClass is +# marked default — Longhorn's own chart marks itself default, so this PVC +# gets real, replicated storage on the two Proxmox workers without naming +# Longhorn here explicitly. +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: demo-data + namespace: demo +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi