Day 36 Task: Managing Persistent Volumes in Your Deployment ๐Ÿ’ฅ

ยท

2 min read

Table of contents

No heading

No headings in the article.

๐Ÿ‘‹ Hey there, awesome DevOps challengers! ๐Ÿš€

๐ŸŽ‰ You've made it to Day 36 of the #90daysofDevOps challenge! ๐Ÿ™Œ Let's give a big shoutout to your conquering of ConfigMaps and Secrets in Kubernetes yesterday. You're on fire! ๐Ÿ”ฅ

Today, we're diving into the fascinating world of Persistent Volumes (PV) in Kubernetes. So, what exactly are Persistent Volumes? ๐Ÿค”

In simple terms, a Persistent Volume (PV) is like a storage locker ๐Ÿ“ฆ in your Kubernetes cluster. It's set up by a Kubernetes administrator and is ready to store your precious data. On the other hand, a Persistent Volume Claim (PVC) is your way of saying, "Hey, I need some storage space, please!" ๐Ÿ™‹โ€โ™€๏ธ The PVC connects to the PV, and the PV is like, "Sure, I'll store your stuff." The PV even picks a specific spot to keep your data, like a shelf in the locker.

Now, before we dive into today's tasks, here's an important announcement! ๐Ÿ“ฃ We want to hear from you! Your feedback means the world to us. Help us make this challenge even better by sharing your thoughts in our feedback form: Feedback Form ๐ŸŒŸ Your support and participation are priceless. Let's grow together! ๐ŸŒฑ

Now, let's get into today's tasks:

Task 1: Adding a Persistent Volume to your Deployment ๐Ÿ“ฆ

  1. Create a Persistent Volume (PV) using a file on your node. Think of it as finding a good spot in your locker.

  2. Create a Persistent Volume Claim (PVC) that points to the PV. This is like asking for a key to that locker.

  3. Update your deployment.yml file to include the PVC. This tells your app where to find its stuff.

  4. Apply the updated deployment using the command: kubectl apply -f deployment.yml. It's like saying, "Okay, app, go check your locker!"

  5. To make sure everything's working, check the status of the Pods and Persistent Volumes with these commands:

    • kubectl get pods

    • kubectl get pv

โš ๏ธ Remember, when you make changes or create files in your Kubernetes deployments, apply each file separately. โš ๏ธ

Task 2: Accessing data in the Persistent Volume ๐Ÿ“‚

  1. Connect to a Pod in your Deployment using this command: kubectl exec -it <pod-name> -- /bin/bash. It's like going inside your app's room.

  2. Check if you can find and access the data stored in the Persistent Volume from within the Pod. It's like opening the locker and grabbing your stuff!

And that's it for today's tasks! ๐ŸŽ‰ You're making amazing progress on your DevOps journey. Keep up the fantastic work, and remember, we're here to support you every step of the way. If you have any questions or need assistance, don't hesitate to ask. Happy DevOps-ing! ๐Ÿš€๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จโ€๐Ÿ’ป

ย