本文介绍了ReplicaSet和ReplicationController有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据我在文档中看到的内容, ReplicaSet 是在运行 Deployment 时创建的.它似乎支持 ReplicationController 的某些相同功能-scale向上/向下并自动重启,但是尚不清楚它是否支持滚动升级或自动缩放.

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.

v1.1.8用户指南显示了如何在部署应用程序(会自动创建一个ReplicaSet),但是kubectl get replicasets命令在v1.2.0之前不可用.我在文档中找不到有关ReplicaSet的任何其他信息.

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.

ReplicaSet最终会取代ReplicationController吗?为什么我要使用DeploymentReplicaSet而不是ReplicationController?

Will ReplicaSet eventually replace ReplicationController? Why would I want to use Deployment and ReplicaSet instead of ReplicationController?

推荐答案

副本集是下一代Replication Controller.复制控制器是必不可少的,但是副本集尝试尽可能声明性.

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.现在,副本集和复制控制器之间的主要区别是对选择器的支持.

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.第二件事是更新Pod.

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.         |
+-------------------------------------------------------+-----------------------------------------------+

这是区分RS和RC的两件事. RS更具声明性,因此广泛使用RS进行部署.

These are the two things that differentiates RS and RC. Deployments with RS is widely used as it is more declarative.

这篇关于ReplicaSet和ReplicationController有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!