Possible workaround 1 : Persistent volumes not auto provisioned on k8s 1.24
Before k8s 1.24, the default StorageClass was standard
, which uses volumeBindingMode Immediate
. However, since k8s 1.24, the default StorageClass is standard-rwo
, which uses volumeBindingMode WaitForFirstConsumer
.
This behavior is intended and actually preferred. Please create a workload that consumes the PVC, then a PV will be created.
update your StorageClass to immediate:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: Immediate # <-- bind as soon as PVC is created
WaitForFirstConsumer will only bind when a Pod uses your PVC.
Please check Persistent volumes and dynamic provisioning for more information.
Possible workaround 2 : Check you might have created your PV on the master node. By default the master node is marked unschedulable by ordinary pods using so called taint. To be able to run some service on master node you have two options:
- Add toleration to some service to allow it to run on master node:
- You can remove taint from the master node, so any pod can run on
it. You should know that this is dangerous because it can make your
cluster very unstable.
Please go through the similar SO for more information.