Deployment #
Deployment controller is used to specify replicas, rollback,
the keyword of deployment is scale.
replicas: the numbers of replicas
MinReadySeconds: min seconds to get Ready
Template: PodTemplateSpec...
Paused: is this deployment paused...
RevisionHistoryLimit: revision stack size limit, will keep given size history
ProgressDeadlineSeconds: the deadline of this disployment, (still run while time out, but given condition, reason: ProgressDeadlineExceeded)
Strategy: 更新时的策略,包括滚动和替换(recreate),下面包含两个滚动更新的平滑策略。
MaxUnavailable: 缩容时,最大一次砍掉多少个 pod 或百分比。
MaxSurge: 扩容时,最大一次扩容的百分比或绝对数量。
Service #
Service is used to expose Deployment and Stateful resource.
For example, there are 3 replicas of user service, the product service will issue RPC calls to user service, it can request service name directly.
Use label to point out the real working Pod in a Service.
Selector: 选择器,可以通过 label 来选取后面要暴露的 Deployment 或 Pod。
Ports: 一个 需要映射的端口列表
Protocol: TCP 或 UDP,都支持
Port: 服务端口
TargetPort: 后面那个 Pod 或 Deployment 的实际端口。
Ingress #
Expose the cluster internal Pod to outside network like a gateway.
Rules: 代理规则
Job #
Run job with container.
Completions: 代表几个 Pod 成功算整个任务成功
Parallelism: 并行度,是指同时允许的 Pod 数
PodFailurePolicy: Pod 退出码和状态(PodScheduled/Initialized等)不同时,如何响应(比如设置为失败)
ActiveDeadlineSeconds: 任务最长能运行多久
BackoffLimit: 最大重试次数,默认6次
BackoffLimitPerIndex: 索引模式下,每个 index 的最大重试次数
MaxFailedIndexes: 一个任务被切成了几个索引,多少个索引失败了,就算整个任务失败。
TTLSecondsAfterFinished: 完成后的TTL,用于任务的自动清理,或说自动垃圾回收
CompletionMode: 可以是索引模式和普通模式,索引模式会把 Pod 建立0~n的编号,写在 Pod 名字上
Suspend: 是否正在休眠
PodReplacementPolicy: 当 Pod 处于 terminating 状态时,是否不等待,直接建立新的
ReplicaSet #
Scale a specific Pod to n replicas.
replicas: 副本数
MinReadySeconds: 达到 Ready 状态的最小秒数 # TODO: 暂时没想到用处
Template: PodTemplateSpec...
DaemonSet #
Tell you container keep running, if it crarshed, launch it in place,
usually work as a process/resource monitor, log collector.
MinReadySeconds: 达到 Ready 状态的最小秒数 # TODO: 暂时没想到用处
Template: PodTemplateSpec...
RevisionHistoryLimit: 回滚栈大小。历史记录保留的长度
UpdateStrategy: 更新时的策略,包括滚动和等待用户手动删除(onDelete),下面包含两个滚动更新的平滑策略。
MaxUnavailable: 缩容时,最大一次砍掉多少个 pod 或百分比。虽然没有副本集,但是有多个节点,所以依然有百分比。
MaxSurge: 扩容时,最大一次扩容的百分比或绝对数量。