...

/

Removing the Resources and Exploring the Effects

Removing the Resources and Exploring the Effects

In this lesson, we will play around with the deployment by removing the created resources and exploring the effects of removal.

Deleting the Deployment

Let’s delete the jenkins Deployment.

Press + to interact
kubectl --namespace jenkins delete \
deploy jenkins

The output shows us that the deployment "jenkins" was deleted.

Did anything happen with the PersistentVolumeClaim and the PersistentVolume?

Press + to interact
kubectl --namespace jenkins get pvc
kubectl get pv

The combined output of both commands is as follows.

Press + to interact
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
jenkins Bound manual-ebs-02 5Gi RWO manual-ebs 57s
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
manual-ebs-01 5Gi RWO Retain Available jenkins/jenkins manual-ebs 10m
manual-ebs-02 5Gi RWO Retain Bound jenkins/jenkins manual-ebs 10m
manual-ebs-03 5Gi RWO Retain Available jenkins/jenkins manual-ebs 10m

Even though we removed Jenkins Deployment and, with it, the Pod that used the claim, both the PersistentVolumeClaim and PersistentVolumes are intact. The manual-ebs-01 volume is still bound to the jenkins claim.

Deleting the PersistentVolumeClaim

What would happen if we remove the PersistentVolumeClaim jenkins?

Press + to interact
kubectl --namespace jenkins \
delete pvc jenkins

The output ...

Access this course and 1400+ top-rated courses and projects.