deployment - ReplicaSet 和 ReplicationController 有什么区别?

标签 deployment kubernetes replicaset

从我在文档中可以看出, ReplicaSet 在运行 Deployment 时创建.它似乎支持 ReplicationController 的一些相同功能。 - 向上/向下扩展和自动重启,但不清楚它是否支持滚动升级或自动扩展。

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

威尔ReplicaSet最终替换 ReplicationController ?我为什么要使用 DeploymentReplicaSet而不是 ReplicationController ?

最佳答案

Replica Set 是下一代的 Replication Controller。复制 Controller 有点势在必行,但副本集尝试尽可能声明性。

1.现在副本集和复制 Controller 之间的主要区别是选择器支持。

+--------------------------------------------------+-----------------------------------------------------+
|                   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 。
+-------------------------------------------------------+-----------------------------------------------+
|                      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 的部署被广泛使用,因为它更具声明性。

关于deployment - ReplicaSet 和 ReplicationController 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36220388/

相关文章:

amazon-web-services - 如何在 NetworkLoadbalancer 中将公共(public) IP 更改为弹性 IP

mongodb - 添加节点 MongoDB 时 ReplicaSetId 冲突

flask - 如何使用 flask app 中的 heroku 环境变量进行配置

ASP.NET 部署 : How to avoid losing session state when updating code?

docker - Minikube - 无法访问updates.jenkins.io

mongodb - 仲裁者不接受连接

linux - Linux 中的 Mongodb 复制错误

php - 您首选的 php 部署策略是什么?

deployment - 当我希望使用 node.js 在我的项目中部署库时,应该包含哪些文件?

kubernetes - kubectl命令给出错误