Challenge,ย Easy, ย onย  Kubernetes

Provision and configure a PersistentVolume (PV) and PersistentVolumeClaim (PVC) for deployment.

Scenario

You need to set up persistent storage for a project in the jupiter namespace. This involves creating a PersistentVolume with hostPath storage, binding it to a PersistentVolumeClaim, and using it in a Deployment.


๐Ÿ“‹ Tasks

Task 1: Create PersistentVolume

Create a PersistentVolume called jupiter-project-jupiter-pv with:

  • Capacity: 1Gi
  • Access mode: ReadWriteOnce
  • HostPath: /Volumes/Data
  • No storageClassName (must not have a storageClassName set)

Task 2: Create PersistentVolumeClaim

In the namespace jupiter, create a PersistentVolumeClaim called jupiter-project-jupiter-pvc with:

  • Requested storage: 1Gi
  • Access mode: ReadWriteOnce
  • No storageClassName (must not specify a storageClassName)
  • Ensure the PVC is bound to the PV

Task 3: Create Deployment

In the namespace jupiter, create a Deployment called project-jupiter with:

  • Image: httpd:alpine
  • Mount the PVC jupiter-project-jupiter-pvc at /tmp

๐Ÿ’ก Test Cases