1

I have a pod using a pvc. When I start the deployment, the pvc is stuck in the "pending" state, because of a local-path: "configuration error, no node was specified":

Name:          grafana-data
Namespace:     default
StorageClass:  local-path
Status:        Pending
Volume:
Labels:        io.kompose.service=grafana-data
Annotations:   volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
               volume.kubernetes.io/storage-provisioner: rancher.io/local-path
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
Used By:       <none>
Events:
  Type     Reason                Age              From                                                                                                Message
  ----     ------                ----             ----                                                                                                -------
  Normal   Provisioning          8s               rancher.io/local-path_local-path-provisioner-7f68f98c9b-hqf5j_6e774f0a-bb44-4a4e-bfe8-a8781c321cf3  External provisioner is provisioning volume for claim "default/grafana-data"
  Warning  ProvisioningFailed    8s               rancher.io/local-path_local-path-provisioner-7f68f98c9b-hqf5j_6e774f0a-bb44-4a4e-bfe8-a8781c321cf3  failed to provision volume with StorageClass "local-path": configuration error, no node was specified
  Normal   ExternalProvisioning  8s (x2 over 8s)  persistentvolume-controller                                                                         waiting for a volume to be created, either by external provisioner "rancher.io/local-path" or manually created by system administrator

To note is that I previously used volumeBindingMode: WaitForConsumer and it worked there (because it waits for the pod to be scheduled). I understand that when using volumeBindingMode: Immediate (like above) I have to somehow specify the node (because the pod is not scheduled yet). Sadly I haven't figured out a way to specify it.

Marko E
  • 13,362
  • 2
  • 19
  • 28
kaffarell
  • 639
  • 5
  • 16
  • Check PSP was not updated to use local-path, which may not allow attaching pvc. Refer to this similar [SO](https://stackoverflow.com/questions/71023450/local-storage-provisioner-in-rancher-not-creating-the-pvc) & [Kubernetes Blog](https://kubernetes.io/blog/2021/04/06/podsecuritypolicy-deprecation-past-present-and-future/) for more information. – Veera Nagireddy Jan 31 '23 at 05:03
  • How do I update it? I have not found a resource on how to edit the psp... – kaffarell Jan 31 '23 at 07:25
  • Which version of Kubernetes did you use and how did you set up the cluster? Did you use bare metal installation or some cloud provider? – Veera Nagireddy Jan 31 '23 at 07:32
  • 1
    Refer to this [Local Path Provisioner usage](https://github.com/rancher/local-path-provisioner) for more info. – Veera Nagireddy Jan 31 '23 at 08:04
  • I use k3s on bare-metal. k8s version is: 1.25. – kaffarell Feb 01 '23 at 07:26

1 Answers1

-1

Based on the warning message failed to provision volume with StorageClass "local-path": configuration error, no node was specified, this may be because of PodSecurityPolicy was not updated to use local-path, which may not allow attaching pvc. Refer to this similar SO & Kubernetes Blog for more information.

Local Path Provisioner : Provides a way for the Kubernetes users to utilize the local storage in each node. Based on the user configuration, the Local Path Provisioner will create either hostPath or local based persistent volume on the node automatically. It utilizes the features introduced by Kubernetes Local Persistent Volume feature, but makes it a simpler solution than the built-in local volume feature in Kubernetes. Please go through Local Path Provisioner for more information.

Edit:

Refer to How Rancher's Local Path Provisioner works blog for more info.

Alternate solution: Migrate from PodSecurityPolicy to the Built-In PodSecurity Admission Controller for more info.

Veera Nagireddy
  • 1,656
  • 1
  • 3
  • 12
  • How do I set the PodSecurityPolicy for local-path? – kaffarell Feb 01 '23 at 07:48
  • Please go through the [Link](https://github.com/longhorn/longhorn/issues/4003) – Veera Nagireddy Feb 01 '23 at 08:10
  • I don't get it. I'm running k8s 1.25 so psp is not used anymore. I couldn't find anything in the links you provided. (The github issue is also about longhorn, not local-storage) – kaffarell Feb 03 '23 at 14:20
  • Yes your right, Please check the edit in answer for Alternate solution. – Veera Nagireddy Feb 03 '23 at 14:41
  • Hello @kaffarell, Did you had time to check my edit in answer? It helped you to solve your problem? If yes, Please consider to accepting (✔️) and upvote it for greater visibility for community members. I am happy to help if you have any further queries. – Veera Nagireddy Mar 02 '23 at 10:11
  • Sadly It didn't fix anything. And after further questions, you just answered with more links which had nothing to do with the problem and didn't provide a solution. – kaffarell Mar 02 '23 at 13:25
  • @kaffarell, not able to concentrate during the last time. If still your issue is not yet resolved, try the cluster that has a persistent disk CSI Driver enabled. Also check the **spec.accessModes** in the pvc yaml. If you're using **ReadWriteMany** try changing to **ReadWriteOnce**. – Veera Nagireddy Mar 02 '23 at 13:39
  • Hello @Kaffarell, Feel free to update the status of the question. Let me know if the comment above helps to resolve your issue? I am happy to help you if you have any further queries. – Veera Nagireddy Mar 08 '23 at 11:06