Sunday, 4 July 2021

PVC in terminating state

Referencee:https://veducate.co.uk/kubernetes-pvc-terminating/


 I still had errors performing deployment, till I released that although I previously was able to delete my PV, my PVC was still in a terminating state. Also realised that I need to be in the right project to see PVC (unless you used --all-namespaces):

[root@okd4-services okd4_files]# oc get pv

NAME          CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                             STORAGECLASS   REASON   AGE

registry-pv   100Gi      RWX            Retain           Bound    openshift-image-registry/image-registry-storage                           4h34m


[root@okd4-services ~]# oc get pvc

No resources found in wordpress-test namespace.


[root@okd4-services ~]# oc get pvc --all-namespaces
NAMESPACE                  NAME                     STATUS        VOLUME        CAPACITY   ACCESS MODES   STORAGECLASS   AGE
openshift-image-registry   image-registry-storage   Terminating   registry-pv   100Gi      RWX                           152d
[root@okd4-services ~]# oc get pvc --all-namespaces^C
[root@okd4-services ~]# kubectl get volumeattachment --all-namespaces
No resources found



[root@okd4-services ~]# oc project
Using project "wordpress-test" on server "https://api.lab.okd.local:6443".
[root@okd4-services ~]# oc project openshift-image-registry
Now using project "openshift-image-registry" on server "https://api.lab.okd.local:6443".



[root@okd4-services ~]# kubectl patch pvc image-registry-storage -p '{"metadata":{"finalizers":null}}'
persistentvolumeclaim/image-registry-storage patched
[root@okd4-services ~]# oc get pvc --all-namespaces
No resources found
[root@okd4-services ~]# oc get pv
NAME          CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS     CLAIM                                             STORAGECLASS   REASON   AGE
registry-pv   100Gi      RWX            Retain           Released   openshift-image-registry/image-registry-storage                           23h


After that I went thru the steps for deleting PV and recreating it.

Saturday, 3 July 2021

Cannot delete pv

 Hang when trying to delete PV:


[root@okd4-services ~]# oc get pv

NAME          CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS        CLAIM                                             STORAGECLASS   REASON   AGE

registry-pv   100Gi      RWX            Retain           Terminating   openshift-image-registry/image-registry-storage                           151d

[root@okd4-services ~]# kubectl delete pv registry-pv --grace-period=0 --force

warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.

persistentvolume "registry-pv" force deleted





^C




Solution:

[root@okd4-services ~]# kubectl describe pv registry-pv
Name:            registry-pv
Labels:          <none>
Annotations:     pv.kubernetes.io/bound-by-controller: yes
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:
Status:          Terminating (lasts 13h)
Claim:           openshift-image-registry/image-registry-storage
Reclaim Policy:  Retain
Access Modes:    RWX
VolumeMode:      Filesystem
Capacity:        100Gi
Node Affinity:   <none>
Message:
Source:
    Type:      NFS (an NFS mount that lasts the lifetime of a pod)
    Server:    192.168.1.210
    Path:      /var/nfsshare/registry
    ReadOnly:  false
Events:        <none>

[root@okd4-services ~]# kubectl edit pv registry-pv
persistentvolume/registry-pv edited


i.e. https://stackoverflow.com/questions/55672498/kubernetes-clustsr-stuck-on-removing-pv-pvc/55672788

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


Wednesday, 30 June 2021

Very important for setting up OpenShift on bare metal

 https://itnext.io/guide-installing-an-okd-4-5-cluster-508a2631cbee


Very detailed but good tutorial

Tuesday, 29 June 2021

VirtualBox : Cannot enable nested VT-x/AMD-V without nested-paging and unresricted guest execution!

 Got this error after I enabled nested virtualization on my vm (was working previously):



Solution:https://github.com/GNS3/gns3-gui/issues/3032


  1. run this at command prompt: bcdedit /set hypervisorlaunchtype off
  2. turn off windows feature "Virtual Machine Platform" *Hyper-V)
  3. reboot






Monday, 28 June 2021

Connection to the server api.crc.testing:6443 was refused

 Troubleshoot using this: https://github.com/code-ready/crc/issues/1201

CRC - If u have error connecting to api server

Check this: https://github.com/code-ready/crc/issues/1212

 root@master:~# cat /sys/module/kvm_intel/parameters/nested

N

So I tried the following command:

root@master:~# modprobe -r kvm-intel
root@master:~# modprobe kvm-intel nested=1

Interesting CRC troubleshooting threads

https://github.com/code-ready/crc/issues/695

https://github.com/code-ready/crc/issues/1212

https://github.com/code-ready/crc/issues/1201

PVC in terminating state

Referencee:https://veducate.co.uk/kubernetes-pvc-terminating/  I still had errors performing deployment, till I released that although I pre...