k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
27.92k stars 2.33k forks source link

Failure to Create PVs on latest Ubuntu 23.10 #9265

Closed mbrandeburg closed 9 months ago

mbrandeburg commented 9 months ago

Environmental Info: K3s Version: v1.28.5+k3s1; v1.29.0+k3s1; v1.28.3+k3s2

Node(s) CPU architecture, OS, and Version:

Cluster Configuration:

Describe the bug:

Steps To Reproduce:

Expected behavior:

  1. local-path-provisioner will make a helper pod.
  2. Helper-pod will make the pv which will bind to the pvc.
  3. kubectl get pvc will show that it is indeed bound.

Actual behavior:

  1. helper-pod simply terminates without creating the pv.
  2. pvc never gets bound to a pv, resulting in perpetual pending state.

Additional context / logs:

brandond commented 9 months ago

Are there any errors in the helper pod or k3s logs?

brandond commented 9 months ago

WaitForFirstConsumer would indicate that it's waiting for the PVC to be actually used by a pod. Have you created a pod that mounts the PVC?

You can find this in the docs here: https://kubernetes.io/docs/concepts/storage/storage-classes/#volume-binding-mode

mbrandeburg commented 9 months ago

yes, I'm realizing that. I just erased the previous message to re-run my vagrant tests. The issue first appeared when running terraform after a new update to ubuntu, so I was deploying pods alongside the pvc, which caused the helper to appear. Running these quick tests off the example yaml from rancher on the vagrant VM as a test case, I realized indeed I needed to be deploying the pod to cause it to create the pv to back the pvc. Running tests again on 23.10 on my Vagrant VM to confirm that this behavior isn't just confined to the Pi.

mbrandeburg commented 9 months ago

oh my, I'm realizing this may be the answer. My TF is riddled with depends on calls, and I'm now suspecting that what has occurred is that deployments prior to the latest update were done from scratch without those calls. The fresh deployment done post-update today is likely the first time I injected depends on for PVCs, which caused this "circular" waiting game -- the deployment never got created because the PVCs weren't ready, but they wouldn't get their backing PV without the deployment first exist. Unsure why helper pods still spawned then, but I'm assuming its a depends on issue with my TF and not actually k3s. (Which certainly would make sense, I kept saying how can I be the first to encounter a bug with 23.10.) My apologies for wasting people's time if this proves to be the case.

mbrandeburg commented 9 months ago

can confirm this works on an ubuntu 23.10 image up to date via vagrant. No idea what's up with the raspberry pi, but it's not the issue above. Closing for now, thanks all for the help!