Train me Kubernetes – Phase 4 – Replication Controllers

In search of all the 7 phase information? Get started on the Evaluate

In Kubernetes, a ReplicationController (sometimes called a “ReplicaSet” in more moderen variations of Kubernetes) is a controller that guarantees {that a} specified collection of replicas of a Pod are working at any given time.

The ReplicationController is accountable for tracking the state of the Pods it manages and taking corrective motion if the specified state does no longer fit the real state. As an example, if a Pod fails or is terminated, the ReplicationController will create a brand new Pod to switch it.

Listed below are some key options of ReplicationControllers in Kubernetes:

  • ReplicationControllers make sure that a specified collection of replicas of a Pod are working: You’ll be able to specify the collection of replicas you wish to have to run within the desired state, and the ReplicationController will make sure that this quantity is maintained.

  • ReplicationControllers can be utilized for scaling and rolling updates: Via expanding or reducing the collection of replicas, you’ll scale your utility up or down. Moreover, you’ll use ReplicationControllers to accomplish rolling updates of your utility, through steadily changing previous Pods with new ones.

  • ReplicationControllers are self-healing: If a Pod fails or is terminated, the ReplicationController will create a brand new Pod to switch it. This guarantees that the specified collection of replicas is at all times maintained, even within the face of screw ups or mistakes.

  • ReplicationControllers can be utilized with labels and selectors: You’ll be able to use labels and selectors to specify which Pods are controlled through a ReplicationController. This lets you arrange teams of similar Pods as a unmarried unit.

  • ReplicationControllers are being changed through ReplicaSets: As of Kubernetes model 1.9, ReplicationControllers are being phased out and changed through ReplicaSets. ReplicaSets give you the similar capability as ReplicationControllers, however with extra complex options for managing Pods.

General, ReplicationControllers (and their more moderen similar, ReplicaSets) are a key part of Kubernetes for managing the deployment and scaling of containerized packages. Via making sure that the specified collection of replicas are working, and robotically changing failed or terminated Pods, ReplicationControllers supply a competent and self-healing basis for working containerized workloads in Kubernetes.

Replication Controllers had been changed through ReplicaSets in Kubernetes, however listed here are some examples of managing them the use of the command line interface (CLI):

Create a replication controller:

$ kubectl create -f rc-definition.yaml

This command will create a replication controller in accordance with the configuration specified within the rc-definition.yaml record.

Get details about the replication controllers:

$ kubectl get replicationcontroller

This command will show details about all of the replication controllers within the Kubernetes cluster, together with their title, desired and present collection of replicas, and the picture used.

Scale the replication controller:

$ kubectl scale replicationcontroller my-rc --replicas=3

This command will scale the my-rc replication controller to 3 replicas.

Replace the replication controller:

$ kubectl rolling-update my-rc --image=picture:v2

This command will replace the my-rc replication controller to make use of the picture:v2 picture, the use of a rolling replace solution to decrease downtime.

Delete a replication controller:

$ kubectl delete replicationcontroller my-rc

This command will delete the my-rc replication controller from the Kubernetes cluster.

Those are only a few examples of the various instructions to be had for managing replication controllers in Kubernetes.

Like this post? Please share to your friends:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: