Welcome to the Linux Foundation Forum!

Lab 8.3 pvc-one stuck in "Pending" status

Hi!

I'm working through Lab 8.3 at the moment and somehow I can't create a PVC that works as expected.

I successfully created the PersistentVolume. The output of kubectl get pv pvvol-1 -o yaml looks like this:

  1. apiVersion: v1
  2. kind: PersistentVolume
  3. metadata:
  4. creationTimestamp: "2023-04-29T11:14:54Z"
  5. finalizers:
  6. - kubernetes.io/pv-protection
  7. name: pvvol-1
  8. resourceVersion: "14977"
  9. uid: b5efe537-6f46-4eb5-8d03-f03f79c161d9
  10. spec:
  11. accessModes:
  12. - ReadWriteMany
  13. capacity:
  14. storage: 1Gi
  15. nfs:
  16. path: /opt/sfw
  17. server: hammerhead
  18. persistentVolumeReclaimPolicy: Retain
  19. volumeMode: Filesystem
  20. status:
  21. phase: Available

But the PersistentVolumeClaim never leaved the status "Pending". The output of kubectl get pvc pvc-one -o yaml looks like this:

  1. apiVersion: v1
  2. kind: PersistentVolumeClaim
  3. metadata:
  4. creationTimestamp: "2023-04-29T11:15:00Z"
  5. finalizers:
  6. - kubernetes.io/pvc-protection
  7. name: pvc-one
  8. namespace: default
  9. resourceVersion: "14980"
  10. uid: 1e9a5f78-ac59-423d-85a5-49983b24b2a8
  11. spec:
  12. accessModes:
  13. - ReadWriteMany
  14. resources:
  15. requests:
  16. storage: 200Mi
  17. storageClassName: local-path
  18. volumeMode: Filesystem
  19. status:
  20. phase: Pending

I have to say, I run a single node k3s cluster at the moment, but I don't think that should matter here. All steps up to step 3 worked just fine.

Any ideas, what I might be wrong? Any hint on how do debug my problem?

Best regards,
Andreas

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 11

    Ok, I found a solution to my problem. I had to add storageClassName: "" in the pvc.yaml file. Now it looks like this:

    1. apiVersion: v1
    2. kind: PersistentVolumeClaim
    3. metadata:
    4. name: pvc-one
    5. spec:
    6. storageClassName: "" <-- added
    7. accessModes:
    8. - ReadWriteMany
    9. resources:
    10. requests:
    11. storage: 200Mi

    I came up with that after reading about Persistent Volumes on the kubernetes website. Apparently this has to do with whether or not the admission plugin in the cluster is turned on or not.

    Maybe this helps anyone with a similar problem.

  • Posts: 24

    Thanks! this post helped me :)

  • Thank you. Solved my issue!

  • Posts: 1

    Adding hostname "cp" to the hosts file of the node helped.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training