I am been struggling to get my simple 3 node Kubernetes cluster running.
$ kubectl get nodes NAME STATUS ROLES AGE VERSION
ubu1 Ready master 31d v1.13.4
ubu2 Ready master,node 31d v1.13.4
ubu3 Ready node 31d v1.13.4
I tried creating a PVC, which was stuck in Pending forever. So I deleted it, but now it is stuck in Terminating status.
$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
task-pv-claim Terminating task-pv-volume 100Gi RWO manual 26d
How can I create a PV that is properly created and useable for the demos described on the official kubernetes web site?
PS: I used kubespray
to get this up and running.
On my Ubuntu 16.04 VMs, this is the Docker version installed:
ubu1:~$ docker version
Client:
Version: 18.06.2-ce
API version: 1.38
Go version: go1.10.3
Git commit: 6d37f41
Built: Sun Feb 10 03:47:56 2019
OS/Arch: linux/amd64
Experimental: false
Thanks in advance.
You need to patch the PVC to set the “finalizers” setting to null, this allows the final unmount from the node, and the PVC can be deleted.
Delete the PersistentVolume The kubectl delete command can be used to delete PVCs. To delete a PVC with kubectl, provide it by file or name.
kubectl patch pvc {PVC_NAME} -p '{"metadata":{"finalizers":null}}'
You need to patch the PVC to set the “finalizers” setting to null, this allows the final unmount from the node, and the PVC can be deleted.
kubectl edit pv (pv name)
FIND the following
finalizers: - kubernetes.io/pv-protection
AND delete it. Then exit and: kubectl delete pv (pv name) --grace-period=0 --force
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With