Steps to Edit and Delete the Replication controller

In this blog, we will show you the steps to edit and delete the replication controller in the kubernetes environment.

 

REQUIREMENTS

  • 2 Node Cluster ( 1 Master VM with 2 Nodes)
  • Kubernetes Components

 

INFRASTRUCTURE OVERVIEW

  • We have already installed and configured the 2 Node cluster in our demo environment.

 

REPLICATION CONTROLLER OVERVIEW

  • We have already created a replication controller in our environment.

Steps to Edit and Delete the Replication controller

 

  • Currently, there are four PODs available in this replication controller. It created pods on both nodes randomly.

Steps to Edit and Delete the Replication controller

 

EDITING REPLICATION CONTROLLER

  • Use the below command to edit the replication controller.

Syntax: kubectl edit rc <replication controller name>

Example: kubectl edit rc rep-pod

Steps to Edit and Delete the Replication controller

 

  • It opens in the default text editor.

Steps to Edit and Delete the Replication controller

 

  • We are editing the total number of replicas from 4 to 6.

Steps to Edit and Delete the Replication controller

 

Steps to Edit and Delete the Replication controller

 

  • Save and close the file.

Steps to Edit and Delete the Replication controller

 

  • After few minutes, we can see two new pods are in running status.

Steps to Edit and Delete the Replication controller

 

 

  • We can also scale down the PODS by editing the replication controller.

Steps to Edit and Delete the Replication controller

 

  • Now we can see the excess POD’s are terminating.

Steps to Edit and Delete the Replication controller

 

DELETING THE REPLICATION CONTROLLER

  • Use the below command to delete a replication controller.

Syntax: kubectl delete rc <replication controller name>

Example: kubectl delete rc rep-pod

Steps to Edit and Delete the Replication controller

 

  • Replication controller deleted successfully.

Steps to Edit and Delete the Replication controller

 

  • Also, there are no pods are available related to the replication controller.

Steps to Edit and Delete the Replication controller

 

DELETING REPLICATION CONTROLLER WITHOUT DELETING THE PODS

 

  • Use the below command to delete the replication controller without deleting the pods.

Syntax: kubectl delete rc <replication controller name> --cascade=false

Example: kubectl delete rc rep-pod --cascade=false

Steps to Edit and Delete the Replication controller

 

  • Command executed successfully.

Steps to Edit and Delete the Replication controller

 

  • You can see the POD’s are available after deleting the replication controller.

Steps to Edit and Delete the Replication controller

 

EXTERNAL LINKS

https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn about edit and deleting the replication controller.



Author: Loges
Logeswaran holds Microsoft certified engineer & solution architect certifications with over 11+ years of experience in the fields of hosting technologies and IMS/Cloud consulting. At AssistanZ, Logeswaran spearheads the strategic planning and execution of the company’s Microsoft based core technologies to Enterprise clients.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.