k8sRC&replicaSet

liveness-probe:通常是定时发送一个httpGet请求,最好是代码里面有healthCheck,能检查所有关键模块是否健康。

 

RC:通过label管理pods,发现少了会通过pod template去创建新的pod

 

Changing a ReplicationController’s pod template only affects pods created afterward and has no effect on existing pods

 

可以通过cascade=false来删除RC的同时不删除它管理的pods

 

ReplicaSets:

可以同时设置两个label,并将它们作为一个group来管理。

除了label,ReplicaSets还可以设置matchExpressions selector来管理pods。

selector:
   matchExpressions:
     - key: app                      1
       operator: In                  2
       values:                       2
         - kubia                     2

这表示pod要包含key为app,values为kubia的label。

它还有以下四个operators

  • In—Label’s value must match one of the specified values.
  • NotIn—Label’s value must not match any of the specified values.
  • Exists—Pod must include a label with the specified key (the value isn’t important). When using this operator, you shouldn’t specify the valuesfield.
  • DoesNotExist—Pod must not include a label with the specified key. The values property must not be specified.

 

当你想让一个pod运行在一个cluster的每一个node上,比如log collector或者resource monitor还有kube-proxy process 一个保证service能正常work的process,可以用daemonSets。

也可以用daemonSets来让固定的pod运行在固定的node上,比如是用来监测disk=ssd的pod就运行在disk=ssd的node上。

 

 

Job

和replicaSet一个级别的概念,管理pod来执行task。

一次性完成就退出的task,完成后不会再restart。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值