Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Apple iOS & macOSPowerPhotos 3.4.7(22.09.2026 um 03:15 Uhr)
Apple iOS & macOSOmniOutliner Essentials and Pro 6.3(22.09.2026 um 03:18 Uhr)
Apple iOS & macOSOmniFocus 4.9(22.09.2026 um 03:20 Uhr)
Apple iOS & macOSFantastical 4.2 and Cardhop 2.5(22.09.2026 um 03:22 Uhr)
Apple iOS & macOSEvernote 11.34.8(22.09.2026 um 03:25 Uhr)
Apple iOS & macOSPowerPhotos 3.4.7(22.09.2026 um 03:15 Uhr)
Apple iOS & macOSOmniOutliner Essentials and Pro 6.3(22.09.2026 um 03:18 Uhr)
Apple iOS & macOSOmniFocus 4.9(22.09.2026 um 03:20 Uhr)
Apple iOS & macOSFantastical 4.2 and Cardhop 2.5(22.09.2026 um 03:22 Uhr)
Apple iOS & macOSEvernote 11.34.8(22.09.2026 um 03:25 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Day 36: Managing Persistent volume in your deployments

On Day 36 of your #90DaysOfDevOps journey, we’re tackling an important part of Kubernetes: Persistent Volumes (PVs) Let’s break this down and walk you through both tasks: What are Persistent Volumes (PV) in Kubernetes? Kubernetes Pods a…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

On Day 36 of your #90DaysOfDevOps journey, we’re tackling an important part of Kubernetes: Persistent Volumes (PVs)



Let’s break this down and walk you through both tasks:



What are Persistent Volumes (PV) in Kubernetes?



Kubernetes Pods are ephemeral — which means data inside a Pod is lost when the Pod is deleted or restarted. To persist data beyond the lifecycle of a Pod, we use:

• Persistent Volumes (PV): Storage resource in the cluster, provisioned by admins or dynamically via StorageClass.

• Persistent Volume Claims (PVC): A request for storage by a user or app.

• Deployment + PVC: Your app (e.g., the ToDo app) can claim storage by referencing a PVC.



Task 1: Add Persistent Volume to Your Deployment



Let’s go step-by-step.




  1. Create a Persistent Volume (pv.yml)



apiVersion: v1

kind: PersistentVolume

metadata:

name: todo-pv

spec:

capacity:

storage: 1Gi

accessModes:

- ReadWriteOnce

hostPath:

path: /mnt/data



This creates a 1Gi volume using the hostPath /mnt/data on the node (local path for testing).




  1. Create a Persistent Volume Claim (pvc.yml)



apiVersion: v1

kind: PersistentVolumeClaim

metadata:

name: todo-pvc

spec:

accessModes:

- ReadWriteOnce

resources:

requests:

storage: 1Gi



This PVC will bind to the todo-pv if the specs match.




  1. Update your deployment.yml to use the PVC



Here’s the updated Deployment with volume mounting:



apiVersion: apps/v1

kind: Deployment

metadata:

name: todo-app

spec:

replicas: 1

selector:

matchLabels:

app: todo

template:

metadata:

labels:

app: todo

spec:

containers:

- name: todo-container

image: your-todo-app-image

volumeMounts:

- name: todo-storage

mountPath: /app/data

volumes:

- name: todo-storage

persistentVolumeClaim:

claimName: todo-pvc



Make sure:

•image: your-todo-app-image is replaced with your actual image.

•/app/data is where your app stores persistent data.




  1. Apply the files



kubectl apply -f pv.yml

kubectl apply -f pvc.yml

kubectl apply -f deployment.yml




  1. Verify Everything



kubectl get pv

kubectl get pvc

kubectl get pods



Look for STATUS: Bound on the PVC and Running pods.



Task 2: Access Data Inside the Pod




  1. Connect to the Pod



kubectl get pods # get pod name

kubectl exec -it -- /bin/bash




  1. Verify Data Access



cd /app/data

ls -l






OR



cat



You should see files created or used by your app.



Optional: Test Persistence

1. Delete the pod:



kubectl delete pod




2.  A new pod will be created (Deployment ensures this).
3. Check if data is still present by repeating the steps to access /app/data.




You have Created and attached a Persistent Volume.

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Day 36: Managing Persistent volume in your deployments

Thematisch verwandte Begriffe: Managing, Persistent, volume, your · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-49449 | Joplin is an open source note-taking and to-do application that organise…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick