Hello! Thanks for platform .
I try pass lab practice-test-persistent-volume-claims-2
root@controlplane:~# kubectl get pod webapp -o yaml > pod.yaml
root@controlplane:~# kubectl get pod
NAME READY STATUS RESTARTS AGE
webapp 1/1 Running 0 72s
root@controlplane:~# kubectl delete pod webapp
pod "webapp" deleted
^C
root@controlplane:~# kubectl delete pod webapp --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.
pod "webapp" force deleted
root@controlplane:~# vim pod.yaml
root@controlplane:~# kubectl apply -f pod.yaml
pod/webapp created
root@controlplane:~# vim pv.yaml
root@controlplane:~# kubectl apply -f pv.yaml
persistentvolume/pv-log created
root@controlplane:~# kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pv-log 100Mi RWX Retain Available 7s
root@controlplane:~# kubectl delete pv pv-log
persistentvolume "pv-log" deleted
root@controlplane:~# vim pv.yaml
root@controlplane:~# kubectl explain persistentvolume --recursive | grep Reclaim
persistentVolumeReclaimPolicy <string>
root@controlplane:~# vim pv.yaml
root@controlplane:~# kubectl apply -f pv.yaml
persistentvolume/pv-log created
root@controlplane:~# vim pvc.yaml
root@controlplane:~# kubectl apply -f pvc.yaml
persistentvolumeclaim/claim-log-1 created
root@controlplane:~# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
claim-log-1 Pending 33s
root@controlplane:~# kubectl delete pvc claim-log-1
persistentvolumeclaim "claim-log-1" deleted
root@controlplane:~# vim pvc.yaml
root@controlplane:~# kubectl apply -f pvc.yaml
persistentvolumeclaim/claim-log-1 created
root@controlplane:~# kubectl get pod
NAME READY STATUS RESTARTS AGE
webapp 1/1 Running 0 5m56s
root@controlplane:~# kubectl delete pod webapp --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.
pod "webapp" force deleted
root@controlplane:~# vim pod.yaml
root@controlplane:~# kubectl apply -f pod.yaml
pod/webapp created
root@controlplane:~# kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
claim-log-1 Bound pv-log 100Mi RWX 2m
root@controlplane:~# kubectl delete pvc claim-log-1
**persistentvolumeclaim "claim-log-1" deleted**
cat pod.yaml
apiVersion: v1 kind: Pod metadata: creationTimestamp: "2021-11-25T09:40:25Z" managedFields: - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:spec: f:containers: k:{"name":"event-simulator"}: .: {} f:env: .: {} k:{"name":"LOG_HANDLERS"}: .: {} f:name: {} f:value: {} f:image: {} f:imagePullPolicy: {} f:name: {} f:resources: {} f:terminationMessagePath: {} f:terminationMessagePolicy: {} f:dnsPolicy: {} f:enableServiceLinks: {} f:restartPolicy: {} f:schedulerName: {} f:securityContext: {} f:terminationGracePeriodSeconds: {} manager: python-requests operation: Update time: "2021-11-25T09:40:25Z" - apiVersion: v1 fieldsType: FieldsV1 fieldsV1: f:status: f:conditions: k:{"type":"ContainersReady"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:status: {} f:type: {} k:{"type":"Initialized"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:status: {} f:type: {} k:{"type":"Ready"}: .: {} f:lastProbeTime: {} f:lastTransitionTime: {} f:status: {} f:type: {} f:containerStatuses: {} f:hostIP: {} f:phase: {} f:podIP: {} f:podIPs: .: {} k:{"ip":"10.244.0.4"}: .: {} f:ip: {} f:startTime: {} manager: kubelet operation: Update time: "2021-11-25T09:40:43Z" name: webapp namespace: default resourceVersion: "971" uid: af898ac5-a54b-4cb7-8c40-5da28a8eb673 spec: containers: - env: - name: LOG_HANDLERS value: file image: kodekloud/event-simulator imagePullPolicy: Always name: event-simulator resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /var/run/secrets/kubernetes.io/serviceaccount name: default-token-8s9m2 readOnly: true - name: mount-log mountPath: /log dnsPolicy: ClusterFirst enableServiceLinks: true nodeName: controlplane preemptionPolicy: PreemptLowerPriority priority: 0 restartPolicy: Always schedulerName: default-scheduler securityContext: {} serviceAccount: default serviceAccountName: default terminationGracePeriodSeconds: 30 tolerations: - effect: NoExecute key: node.kubernetes.io/not-ready operator: Exists tolerationSeconds: 300 - effect: NoExecute key: node.kubernetes.io/unreachable operator: Exists tolerationSeconds: 300 volumes: - name: default-token-8s9m2 secret: defaultMode: 420 secretName: default-token-8s9m2 - name: mount-log persistentVolumeClaim: claimName: claim-log-1
cat pvc.yaml
apiVersion: v1 kind: PersistentVolumeClaim metadata: name: claim-log-1 spec: accessModes: - ReadWriteMany resources: requests: storage: 50Mi