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。