当前位置: 首页 > news >正文

专业深圳网站建设公关公司排行榜

专业深圳网站建设,公关公司排行榜,免费cad图纸下载网站,如何建立网站建设方案ReplicaSet 和 ReplicationController 是 Kubernetes 中用于管理应用程序副本的两种资源,它们有类似的功能,但 ReplicaSet 是 ReplicationController 的增强版本。 以下是它们的主要区别: 1. 功能的演进 ReplicationController 是 Kubernete…

ReplicaSetReplicationController 是 Kubernetes 中用于管理应用程序副本的两种资源,它们有类似的功能,但 ReplicaSetReplicationController 的增强版本。

以下是它们的主要区别:

1. 功能的演进

  • ReplicationController 是 Kubernetes 的早期版本中用来确保一定数量的 Pod 副本运行的控制器。

  • ReplicaSetReplicationController 的增强版本,引入了更多的功能和灵活性,逐步取代了 ReplicationController

2. 标签选择器

  • ReplicationController 只支持基于 等式匹配 的标签选择器。例如:

    selector:app: myapp
    
  • ReplicaSet 支持更复杂的 集合匹配,可以使用 innotin 等操作符。例如:

    selector:matchLabels:app: myappmatchExpressions:- key: environmentoperator: Invalues:- production- staging
    

3. 推荐使用

  • Kubernetes 更推荐使用 ReplicaSet,因为它功能更强大,尤其是支持高级标签选择器。

  • 不过,ReplicationController 仍然受支持,用于与旧版本的 Kubernetes 配置兼容。

4. 与 Deployment 的关系

  • ReplicaSet 通常与 Deployment 一起使用,Deployment 会管理 ReplicaSet,从而实现滚动更新等功能。

  • ReplicationController 已经逐渐被 DeploymentReplicaSet 取代,功能上相对较弱。

示例对比

ReplicationController 配置示例:

 

apiVersion: v1
kind: ReplicationController
metadata:name: myapp-rc
spec:replicas: 3selector:app: myapptemplate:metadata:labels:app: myappspec:containers:- name: myapp-containerimage: nginx
ReplicaSet 配置示例:

apiVersion: apps/v1
kind: ReplicaSet
metadata:name: myapp-rs
spec:replicas: 3selector:matchLabels:app: myappmatchExpressions:- key: environmentoperator: Invalues:- productiontemplate:metadata:labels:app: myappspec:containers:- name: myapp-containerimage: nginx

 

 

Scale

总结

  • 如果是新项目,直接使用 ReplicaSetDeployment,避免使用 ReplicationController

  • 如果你的需求更复杂(比如基于集合匹配的调度策略),ReplicaSet 是更好的选择。

练习

controlplane ~ ➜  kubectl get pods
No resources found in default namespace.controlplane ~ ➜  kubectl get replicaSet
No resources found in default namespace.controlplane ~ ➜  kubectl get replicaSet
NAME              DESIRED   CURRENT   READY   AGE
new-replica-set   4         4         0       6scontrolplane ~ ➜  kubectl describe replicaSet new-replica-set
Name:         new-replica-set
Namespace:    default
Selector:     name=busybox-pod
Labels:       <none>
Annotations:  <none>
Replicas:     4 current / 4 desired
Pods Status:  0 Running / 4 Waiting / 0 Succeeded / 0 Failed
Pod Template:Labels:  name=busybox-podContainers:busybox-container:Image:      busybox777Port:       <none>Host Port:  <none>Command:sh-cecho Hello Kubernetes! && sleep 3600Environment:   <none>Mounts:        <none>Volumes:         <none>Node-Selectors:  <none>Tolerations:     <none>
Events:Type    Reason            Age   From                   Message----    ------            ----  ----                   -------Normal  SuccessfulCreate  44s   replicaset-controller  Created pod: new-replica-set-g2tmxNormal  SuccessfulCreate  44s   replicaset-controller  Created pod: new-replica-set-hjk29Normal  SuccessfulCreate  44s   replicaset-controller  Created pod: new-replica-set-dxcscNormal  SuccessfulCreate  44s   replicaset-controller  Created pod: new-replica-set-7vm2xcontrolplane ~ ➜  kubectl delete pod new-replica-set-g2tmx
pod "new-replica-set-g2tmx" deletedcontrolplane ~ ➜  kubectl describe replicaSet new-replica-set
Name:         new-replica-set
Namespace:    default
Selector:     name=busybox-pod
Labels:       <none>
Annotations:  <none>
Replicas:     4 current / 4 desired
Pods Status:  0 Running / 4 Waiting / 0 Succeeded / 0 Failed
Pod Template:Labels:  name=busybox-podContainers:busybox-container:Image:      busybox777Port:       <none>Host Port:  <none>Command:sh-cecho Hello Kubernetes! && sleep 3600Environment:   <none>Mounts:        <none>Volumes:         <none>Node-Selectors:  <none>Tolerations:     <none>
Events:Type    Reason            Age    From                   Message----    ------            ----   ----                   -------Normal  SuccessfulCreate  2m45s  replicaset-controller  Created pod: new-replica-set-g2tmxNormal  SuccessfulCreate  2m45s  replicaset-controller  Created pod: new-replica-set-hjk29Normal  SuccessfulCreate  2m45s  replicaset-controller  Created pod: new-replica-set-dxcscNormal  SuccessfulCreate  2m45s  replicaset-controller  Created pod: new-replica-set-7vm2xNormal  SuccessfulCreate  12s    replicaset-controller  Created pod: new-replica-set-p5pm4controlplane ~ ➜  kubectl get pod
NAME                    READY   STATUS             RESTARTS   AGE
new-replica-set-7vm2x   0/1     ErrImagePull       0          3m5s
new-replica-set-dxcsc   0/1     ImagePullBackOff   0          3m5s
new-replica-set-hjk29   0/1     ErrImagePull       0          3m5s
new-replica-set-p5pm4   0/1     ErrImagePull       0          32scontrolplane ~ ➜  kubectl create -f /root/replicaset-definition-1.yaml
error: resource mapping not found for name: "replicaset-1" namespace: "" from "/root/replicaset-definition-1.yaml": no matches for kind "ReplicaSet" in version "v1"
ensure CRDs are installed firstcontrolplane ~ ✖ vim /root/replicaset-definition-1.yamlcontrolplane ~ ➜  vim /root/replicaset-definition-1.yamlcontrolplane ~ ➜  cat /root/replicaset-definition-1.yaml
apiVersion: v1
kind: ReplicaSet
metadata:name: replicaset-1
spec:replicas: 2selector:matchLabels:tier: frontendtemplate:metadata:labels:tier: frontendcontainers:- name: nginximage: nginx

http://www.cadmedia.cn/news/15354.html

相关文章:

  • 维力安网站建设公司网络营销的概念与特点
  • 淘宝客自建网站做还是用微信qq做活动营销推广方案
  • 郑州高新区网站建设最新腾讯新闻
  • 深圳十大网站建设公司大连网站制作
  • 品牌形象策划官网整站优化
  • 库尔勒 网站建设网站友情链接美化代码
  • 芜湖网站设计音乐接单推广app平台
  • 制作公司网页思路怎么写百度seo推广计划类型包含
  • pr效果做的好的网站有哪些白帽seo公司
  • 上海企业建站方案网站运营工作的基本内容
  • 优秀手机网站模板图片自动点击器软件
  • 一般网站建设都用什么字体刚刚刚刚刚刚好痛
  • 总部基地网站建设公司域名查询网址
  • 湖南省绿色建筑信息平台全国seo搜索排名优化公司
  • 企业网站模板下载哪里培训机构学校
  • 网站建设需要哪些电商运营的基本流程
  • 52影院seo属于什么职业部门
  • 商品网站建设实验记录收录优美图片app
  • 电影采集网站建设太原百度seo排名
  • 镇江积分优化网站seo报价
  • 网站建设 工作建议站长工具查询官网
  • seo建站要求seo推广优化培训
  • 上海做网站就用乐云seo十年昆明seo案例
  • 网站建设色系搭配培训优化
  • 网站建设支付安全seo怎么学
  • bbs建站站长工具域名
  • 写小说的网站自己做封面网店推广策划方案
  • 最新的新开传奇网站惠州优化怎么做seo
  • 最便宜的重庆网站建设电脑培训班一般多少钱
  • 电子网站开发技术包括多层次网络营销合法吗