You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
进而实现其存在价值。当 ReplicaSet 需要创建新的 Pod 时,会使用所提供的 Pod 模板。
43
43
44
44
<!--
45
-
A ReplicaSet is linked to its Pods via the Pods' [metadata.ownerReferences](/docs/concepts/workloads/controllers/garbage-collection/#owners-and-dependents)
45
+
A ReplicaSet is linked to its Pods via the Pods' [metadata.ownerReferences](/docs/concepts/architecture/garbage-collection/#owners-and-dependents)
46
46
field, which specifies what resource the current object is owned by. All Pods acquired by a ReplicaSet have their owning
47
47
ReplicaSet's identifying information within their ownerReferences field. It's through this link that the ReplicaSet
48
48
knows of the state of the Pods it is maintaining and plans accordingly.
For 2 ReplicaSets specifying the same `.spec.selector` but different `.spec.template.metadata.labels` and `.spec.template.spec` fields, each ReplicaSet ignores the Pods created by the other ReplicaSet.
411
+
For 2 ReplicaSets specifying the same `.spec.selector` but different
412
+
`.spec.template.metadata.labels`and `.spec.template.spec` fields, each ReplicaSet ignores the
@@ -435,19 +437,21 @@ ReplicaSet 创建、删除 Pod 以与此值匹配。
435
437
436
438
### Deleting a ReplicaSet and its Pods
437
439
438
-
To delete a ReplicaSet and all of its Pods, use [`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete). The [Garbage collector](/docs/concepts/workloads/controllers/garbage-collection/) automatically deletes all of the dependent Pods by default.
440
+
To delete a ReplicaSet and all of its Pods, use
441
+
[`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete). The
442
+
[Garbage collector](/docs/concepts/architecture/garbage-collection/) automatically deletes all of
443
+
the dependent Pods by default.
439
444
440
-
When using the REST API or the `client-go` library, you must set `propagationPolicy` to `Background` or `Foreground` in
441
-
the -d option.
442
-
For example:
445
+
When using the REST API or the `client-go` library, you must set `propagationPolicy` to
446
+
`Background` or `Foreground` in the `-d` option. For example:
443
447
-->
444
448
## 使用 ReplicaSet {#working-with-replicasets}
445
449
446
450
### 删除 ReplicaSet 和它的 Pod {#deleting-a-replicaset-and-its-pods}
You can delete a ReplicaSet without affecting any of its Pods using [`kubectl delete`](/docs/reference/generated/kubectl/kubectl-commands#delete) with the `--cascade=orphan` option.
470
+
You can delete a ReplicaSet without affecting any of its Pods using
Unlike the case where a user directly created Pods, a ReplicaSet replaces Pods that are deleted or terminated for any reason, such as in the case of node failure or disruptive node maintenance, such as a kernel upgrade. For this reason, we recommend that you use a ReplicaSet even if your application requires only a single Pod. Think of it similarly to a process supervisor, only it supervises multiple Pods across multiple nodes instead of individual processes on a single node. A ReplicaSet delegates local container restarts to some agent on the node such as kubelet.
687
+
Unlike the case where a user directly created Pods, a ReplicaSet replaces Pods that are deleted or
688
+
terminated for any reason, such as in the case of node failure or disruptive node maintenance,
689
+
such as a kernel upgrade. For this reason, we recommend that you use a ReplicaSet even if your
690
+
application requires only a single Pod. Think of it similarly to a process supervisor, only it
691
+
supervises multiple Pods across multiple nodes instead of individual processes on a single node. A
692
+
ReplicaSet delegates local container restarts to some agent on the node such as Kubelet.
0 commit comments