Working With Replication Controller & Replication Set

0 76

A replication controller (RC) is a supervisor for long-running pods. An RC will launch a specified number of pods called replicas and makes sure that they keep running, for example when a node fails or something inside of a pod, that is, in one of its containers goes wrong.

  1. Lets deploy some pod with replication controller using yml file, please refer this link
    kubectl create -f rc-definition.yml
  2. Get list of replication controller
    kubectl get replicationcontroller
  3. Get list of Pods
    kubectl get pods

A ReplicaSet’s purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods.

  1. Lets deploy some pod with replication controller using yml file, please refer this link
    kubectl create -f rs-definition.yml
  2. Get list of replication controller
    kubectl get replicationset
  3. Get list of Pods
    kuberctl get pods
  4. You can increase the number of pods by updating the yml definition file then running:
    kubectl replace -f rs-definition.yml
  5. You can also increase the number of pods by using scale command:
    kubectl scale -replicas=6 -f rs-definition.yml
  6. Delete replication set using:
    kubectl delete replication myapp-rs

Leave A Reply

Your email address will not be published.