[root@k8s-main dashboard]# kubectl explain ds.spec
GROUP: apps
KIND: DaemonSet
VERSION: v1
FIELD: spec <DaemonSetSpec>
DESCRIPTION:
The desired behavior of this daemon set. More info:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
DaemonSetSpec is the specification of a daemon set.
FIELDS:
minReadySeconds <integer>
The minimum number of seconds forwhich a newly created DaemonSet pod should
be ready without any of its container crashing, for it to be considered
available. Defaults to 0 (pod will be considered available as soon as it is
ready).
revisionHistoryLimit <integer>
The number of old history to retain to allow rollback. This is a pointer to
distinguish between explicit zero and not specified. Defaults to 10.
selector <LabelSelector> -required-
A label query over pods that are managed by the daemon set. Must match in
order to be controlled. It must match the pod template's labels. More info:
https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
template <PodTemplateSpec> -required-
An object that describes the pod that will be created. The DaemonSet will
create exactly one copy of this pod on every node that matches the
template's node selector (or on every node if no node selector is
specified). The only allowed template.spec.restartPolicy value is "Always".
More info:
https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
updateStrategy <DaemonSetUpdateStrategy>
An update strategy to replace existing DaemonSet pods with new pods.
Kubernetes 中的 Job 对象将创建一个或多个 Pod,并确保指定数量的 Pod 可以成功执行到进程正常结束:
当 Job 创建的 Pod 执行成功并正常结束时,Job 将记录成功结束的 Pod 数量。
当成功结束的 Pod 达到指定的数量时,Job 将完成执行。
删除 Job 对象时,将清理掉由 Job 创建的 Pod。
创建一个Job:
apiVersion:batch/v1kind:Jobmetadata:name:job-01namespace:defaultlabels:app:job-01spec:template:# Pod 模板metadata:name:pod-job-testlabels:app:job-01spec:restartPolicy:Nevercontainers:-name:job-01image:busyboxcommand: ['sh', '-c', '"sleep 5s;echo \"done\""']
# 最大失败次数backoffLimit:4# Pod 最大执行时间activeDeadlineSeconds:100# Pod 运行成功几次才算成功completions:4# Pod 并行数parallelism:2ttlSecondsAfterFinished:# 在job执行完成后多久,自动删除Pod, 单位为妙,设置为0时将会理解删除ttlSecondsAfterFinished:0