From what I can tell in the documentation, a ReplicaSet
is created when running a Deployment
. It seems to support some of the same features of a ReplicationController
- scale up/down and auto restart, but it's not clear if it supports rolling upgrades or autoscale.
The v1.1.8 user guide shows how to create a deployment in Deploying Applications (which automatically creates a ReplicaSet
), yet the kubectl get replicasets
command is not available until v1.2.0. I cannot find any other information about ReplicaSet
in the documentation.
Will ReplicaSet
eventually replace ReplicationController
? Why would I want to use Deployment
and ReplicaSet
instead of ReplicationController
?
The replica set and the replication controller's key difference is that the replication controller only supports equality-based selectors whereas the replica set supports set-based selectors.
A ReplicaSet ensures that a specified number of pod replicas are running at any given time. However, a Deployment is a higher-level concept that manages ReplicaSets and provides declarative updates to Pods along with a lot of other useful features.
Note: A Deployment that configures a ReplicaSet is now the recommended way to set up replication. A ReplicationController ensures that a specified number of pod replicas are running at any one time. In other words, a ReplicationController makes sure that a pod or a homogeneous set of pods is always up and available.
Generally, the replica set name is the cluster name plus -shard-0 . i.e. cluster name test , replica set name is test-shard-0 .
Replica Set is the next generation of Replication Controller. Replication controller is kinda imperative, but replica sets try to be as declarative as possible.
1.The main difference between a Replica Set and a Replication Controller right now is the selector support.
+--------------------------------------------------+-----------------------------------------------------+ | Replica Set | Replication Controller | +--------------------------------------------------+-----------------------------------------------------+ | Replica Set supports the new set-based selector. | Replication Controller only supports equality-based | | This gives more flexibility. for eg: | selector. for eg: | | environment in (production, qa) | environment = production | | This selects all resources with key equal to | This selects all resources with key equal to | | environment and value equal to production or qa | environment and value equal to production | +--------------------------------------------------+-----------------------------------------------------+
2.The second thing is the updating the pods.
+-------------------------------------------------------+-----------------------------------------------+ | Replica Set | Replication Controller | +-------------------------------------------------------+-----------------------------------------------+ | rollout command is used for updating the replica set. | rolling-update command is used for updating | | Even though replica set can be used independently, | the replication controller. This replaces the | | it is best used along with deployments which | specified replication controller with a new | | makes them declarative. | replication controller by updating one pod | | | at a time to use the new PodTemplate. | +-------------------------------------------------------+-----------------------------------------------+
These are the two things that differentiates RS and RC. Deployments with RS is widely used as it is more declarative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With