Persistent Volumes in Kubernetes

@Inderpreet, @kodekloud-support3 I’ve completed the task successfully. But it is still showing as failed.

image

@Lalit, can you please share your yml files ?


@rahul456 please check.

@rahul456 @kodekloud-support3 please check.

Hi @Lalit We can mark it Pending for you to give it an another shot. Could you please let us know if you already got assigned your today’s task ?

Hi @Inderpreet @kodekloud-support3
As of now, I haven’t got any new task for today.
Task “Persistent Volume in Kubernetes” is not in pending state, it is still marked as failed.

@Lalit make sure you double check persistent volume (host path) section.
remember
Local Persistent Volume mounts a local disk or partition into a Pod not, but I think the question is asking you to mount certain directory to the persistent volume.

@Inderpreet @kodekloud-support3 task is still marked as failed. please mark it as pending so I can work on it again.

@Lalit When did you complete Deploy Jenkins on Kubernetes task ?

Yesterday before 8:30pm IST

@Lalit This one is marked pending for you and you should have your today’s task assigned as well.

Thank you so much. Both the tasks are successful now.

@Inderpreet @kodekloud-support3

Even my task failed.

with following message
PersistentVolume's host path is not '/mnt/security'

i saw a proper curl output. Would you please let me know what went wrong.

---
apiVersion: v1
kind: PersistentVolume
metadata: 
  name: pv-xfusion
spec:
  capacity: 
     storage: 6Gi
  accessModes:
  - ReadWriteOnce
  storageClassName: manual 
  local:
    path: /mnt/security
  nodeAffinity:
    required:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/hostname
          operator: In
          values:
            - node01
 
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc-xfusion
spec:
  accessModes:
  - ReadWriteOnce
  volumeName: pv-xfusion
  resources: 
    requests:
      storage: 2Gi
  storageClassName: manual 
  

---
apiVersion: v1
kind: Pod
metadata:
  name: pod-xfusion
spec: 
  containers:
    - image: nginx:latest
      name: container-xfusion
      ports:
        - containerPort: 80 
          name: web
      volumeMounts: 
      - name: storage-xfusion
        mountPath: /usr/share/nginx/html
        
  volumes: 
    - name: storage-xfusion
      persistentVolumeClaim:
          claimName: pvc-xfusion

Hello, @mehulr
You need to define the hostPath section in the PersistentVolume.

There are two types of local volumes.

  • hostPath
  • local

i used local. It was not very clear in the task description to use volume type as hostPath.

@mehulr We can mark it as Pending for you to try again, Could you please let us know if you have your today’s task assigned already ?

Hi @Inderpreet
i have been assigned todays task . I will be completing it in next few hours.

thank you
Mehul

@mehulr

This is also marked pending for you.

1 Like