parent
93d6e08ce1
commit
e30a9c786b
|
@ -11,20 +11,19 @@ weight: 60
|
|||
|
||||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
In Kubernetes, some objects are *owners* of other objects. For example, a
|
||||
{{<glossary_tooltip text="ReplicaSet" term_id="replica-set">}} is the owner of a set of Pods. These owned objects are *dependents*
|
||||
of their owner.
|
||||
<!--
|
||||
In Kubernetes, some {{< glossary_tooltip text="objects" term_id="Object" >}} are *owners* of other objects. For example, a
|
||||
{{<glossary_tooltip text="ReplicaSet" term_id="replica-set">}} is the owner of a set of {{<glossary_tooltip text="Pods" term_id="pod">}}. These owned objects are *dependents*
|
||||
-->
|
||||
|
||||
在 Kubernetes 中,一些对象是其他对象的“属主(Owner)”。
|
||||
在 Kubernetes 中,一些{{< glossary_tooltip text="对象" term_id="Object" >}}是其他对象的“属主(Owner)”。
|
||||
例如,{{<glossary_tooltip text="ReplicaSet" term_id="replica-set">}} 是一组 Pod 的属主。
|
||||
具有属主的对象是属主的“附属(Dependent)”。
|
||||
|
||||
<!--
|
||||
Ownership is different from the [labels and selectors](/docs/concepts/overview/working-with-objects/labels/)
|
||||
mechanism that some resources also use. For example, consider a Service that
|
||||
creates `EndpointSlice` objects. The Service uses labels to allow the control plane to
|
||||
creates `EndpointSlice` objects. The Service uses {{<glossary_tooltip text="labels" term_id="label">}} to allow the control plane to
|
||||
determine which `EndpointSlice` objects are used for that Service. In addition
|
||||
to the labels, each `EndpointSlice` that is managed on behalf of a Service has
|
||||
an owner reference. Owner references help different parts of Kubernetes avoid
|
||||
|
@ -32,16 +31,17 @@ interfering with objects they don’t control.
|
|||
-->
|
||||
属主关系不同于一些资源使用的[标签和选择算符](/zh-cn/docs/concepts/overview/working-with-objects/labels/)机制。
|
||||
例如,有一个创建 `EndpointSlice` 对象的 Service,
|
||||
该 Service 使用标签来让控制平面确定,哪些 `EndpointSlice` 对象属于该 Service。
|
||||
除开标签,每个代表 Service 所管理的 `EndpointSlice` 都有一个属主引用。
|
||||
属主引用避免 Kubernetes 的不同部分干扰到不受它们控制的对象。
|
||||
该 Service 使用{{<glossary_tooltip text="标签" term_id="label">}}来让控制平面确定哪些
|
||||
`EndpointSlice` 对象属于该 Service。除开标签,每个代表 Service 所管理的
|
||||
`EndpointSlice` 都有一个属主引用。属主引用避免 Kubernetes
|
||||
的不同部分干扰到不受它们控制的对象。
|
||||
|
||||
<!--
|
||||
## Owner references in object specifications
|
||||
|
||||
Dependent objects have a `metadata.ownerReferences` field that references their
|
||||
owner object. A valid owner reference consists of the object name and a UID
|
||||
within the same namespace as the dependent object. Kubernetes sets the value of
|
||||
owner object. A valid owner reference consists of the object name and a {{<glossary_tooltip text="UID" term_id="uid">}}
|
||||
within the same {{<glossary_tooltip text="namespace" term_id="namespace">}} as the dependent object. Kubernetes sets the value of
|
||||
this field automatically for objects that are dependents of other objects like
|
||||
ReplicaSets, DaemonSets, Deployments, Jobs and CronJobs, and ReplicationControllers.
|
||||
You can also configure these relationships manually by changing the value of
|
||||
|
@ -50,8 +50,9 @@ automatically manage the relationships.
|
|||
-->
|
||||
## 对象规约中的属主引用 {#owner-references-in-object-specifications}
|
||||
|
||||
附属对象有一个 `metadata.ownerReferences` 字段,用于引用其属主对象。
|
||||
一个有效的属主引用,包含与附属对象同在一个命名空间下的对象名称和一个 UID。
|
||||
附属对象有一个 `metadata.ownerReferences` 字段,用于引用其属主对象。一个有效的属主引用,
|
||||
包含与附属对象同在一个{{<glossary_tooltip text="命名空间" term_id="namespace">}}下的对象名称和一个
|
||||
{{<glossary_tooltip text="UID" term_id="uid">}}。
|
||||
Kubernetes 自动为一些对象的附属资源设置属主引用的值,
|
||||
这些对象包含 ReplicaSet、DaemonSet、Deployment、Job、CronJob、ReplicationController 等。
|
||||
你也可以通过改变这个字段的值,来手动配置这些关系。
|
||||
|
@ -124,10 +125,10 @@ When you tell Kubernetes to delete a resource, the API server allows the
|
|||
managing controller to process any [finalizer rules](/docs/concepts/overview/working-with-objects/finalizers/)
|
||||
for the resource. {{<glossary_tooltip text="Finalizers" term_id="finalizer">}}
|
||||
prevent accidental deletion of resources your cluster may still need to function
|
||||
correctly. For example, if you try to delete a `PersistentVolume` that is still
|
||||
correctly. For example, if you try to delete a [PersistentVolume](/docs/concepts/storage/persistent-volumes/) that is still
|
||||
in use by a Pod, the deletion does not happen immediately because the
|
||||
`PersistentVolume` has the `kubernetes.io/pv-protection` finalizer on it.
|
||||
Instead, the volume remains in the `Terminating` status until Kubernetes clears
|
||||
Instead, the [volume](/docs/concepts/storage/volumes/) remains in the `Terminating` status until Kubernetes clears
|
||||
the finalizer, which only happens after the `PersistentVolume` is no longer
|
||||
bound to a Pod.
|
||||
-->
|
||||
|
@ -138,9 +139,11 @@ bound to a Pod.
|
|||
{{<glossary_tooltip text="Finalizer" term_id="finalizer">}}
|
||||
防止意外删除你的集群所依赖的、用于正常运作的资源。
|
||||
例如,如果你试图删除一个仍被 Pod 使用的 `PersistentVolume`,该资源不会被立即删除,
|
||||
因为 `PersistentVolume` 有 `kubernetes.io/pv-protection` Finalizer。
|
||||
相反,它将进入 `Terminating` 状态,直到 Kubernetes 清除这个 Finalizer,
|
||||
而这种情况只会发生在 `PersistentVolume` 不再被挂载到 Pod 上时。
|
||||
因为 [PersistentVolume](/zh-cn/docs/concepts/storage/persistent-volumes/) 有
|
||||
`kubernetes.io/pv-protection` Finalizer。
|
||||
相反,[数据卷](/zh-cn/docs/concepts/storage/volumes/)将进入 `Terminating` 状态,
|
||||
直到 Kubernetes 清除这个 Finalizer,而这种情况只会发生在 `PersistentVolume`
|
||||
不再被挂载到 Pod 上时。
|
||||
|
||||
<!--
|
||||
Kubernetes also adds finalizers to an owner resource when you use either
|
||||
|
|
|
@ -167,13 +167,6 @@ Kubernetes 关键组件在 Windows 上的工作方式与在 Linux 上相同。
|
|||
|
||||
`.spec.os.name` 字段应设置为 `windows` 以表明当前 Pod 使用 Windows 容器。
|
||||
|
||||
{{< note >}}
|
||||
<!--
|
||||
Starting from 1.25, the `IdentifyPodOS` feature gate is in GA stage and defaults to be enabled.
|
||||
-->
|
||||
从 1.25 开始,`IdentifyPodOS` 特性门控进入 GA 阶段,默认启用。
|
||||
{{< /note >}}
|
||||
|
||||
<!--
|
||||
If you set the `.spec.os.name` field to `windows`,
|
||||
you must not set the following fields in the `.spec` of that Pod:
|
||||
|
|
|
@ -266,13 +266,6 @@ to `windows`.
|
|||
对于运行 Linux 容器的 Pod,将 `.spec.os.name` 设置为 `linux`。
|
||||
对于运行 Windows 容器的 Pod,将 `.spec.os.name` 设置为 `windows`。
|
||||
|
||||
{{< note >}}
|
||||
<!--
|
||||
Starting from 1.25, the `IdentifyPodOS` feature is in GA stage and defaults to be enabled.
|
||||
-->
|
||||
从 1.25 开始,`IdentifyPodOS` 特性处于 GA 阶段,默认启用。
|
||||
{{< /note >}}
|
||||
|
||||
<!--
|
||||
The scheduler does not use the value of `.spec.os.name` when assigning Pods to nodes. You should
|
||||
use normal Kubernetes mechanisms for
|
||||
|
|
|
@ -378,6 +378,15 @@ GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
<!--
|
||||
- **sendInitialEvents** (*in query*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
-->
|
||||
- **sendInitialEvents** (**查询参数**): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
<!--
|
||||
- **timeoutSeconds** (*in query*): integer
|
||||
|
||||
|
@ -500,6 +509,15 @@ GET /apis/apps/v1/controllerrevisions
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
<!--
|
||||
- **sendInitialEvents** (*in query*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
-->
|
||||
- **sendInitialEvents** (**查询参数**): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
<!--
|
||||
- **timeoutSeconds** (*in query*): integer
|
||||
|
||||
|
@ -1039,6 +1057,15 @@ DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
<!--
|
||||
- **sendInitialEvents** (*in query*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
-->
|
||||
- **sendInitialEvents** (**查询参数**): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
<!--
|
||||
- **timeoutSeconds** (*in query*): integer
|
||||
|
||||
|
|
|
@ -84,13 +84,14 @@ ReplicationControllerSpec 表示一个副本控制器的规约。
|
|||
|
||||
- **template** (<a href="{{< ref "../workload-resources/pod-template-v1#PodTemplateSpec" >}}">PodTemplateSpec</a>)
|
||||
|
||||
Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
|
||||
Template is the object that describes the pod that will be created if insufficient replicas are detected. This takes precedence over a TemplateRef. The only allowed template.spec.restartPolicy value is "Always". More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#pod-template
|
||||
-->
|
||||
- **selector** (map[string]string)
|
||||
|
||||
selector 是针对 Pod 的标签查询,符合条件的 Pod 个数应与 replicas 匹配。
|
||||
如果 selector 为空,则默认为出现在 Pod 模板中的标签。
|
||||
如果置空以表示默认使用 Pod 模板中的标签,则标签的主键和取值必须匹配,以便由这个副本控制器进行控制。
|
||||
`template.spec.restartPolicy` 唯一被允许的值是 `Always`。
|
||||
更多信息:
|
||||
https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/labels/#label-selectors
|
||||
|
||||
|
@ -424,6 +425,10 @@ GET /api/v1/namespaces/{namespace}/replicationcontrollers
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
- **sendInitialEvents** (*查询参数*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
- **timeoutSeconds** (**查询参数**): integer
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
|
||||
|
@ -498,6 +503,10 @@ GET /api/v1/replicationcontrollers
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
- **sendInitialEvents** (*查询参数*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
- **timeoutSeconds** (**查询参数**): integer
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
|
||||
|
@ -955,6 +964,10 @@ DELETE /api/v1/namespaces/{namespace}/replicationcontrollers
|
|||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
|
||||
|
||||
- **sendInitialEvents** (*查询参数*): boolean
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#sendInitialEvents" >}}">sendInitialEvents</a>
|
||||
|
||||
- **timeoutSeconds** (**查询参数**): integer
|
||||
|
||||
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
|
||||
|
|
|
@ -131,7 +131,7 @@ You can run the `dashboard` command again to create another proxy to access the
|
|||
|
||||
<!--
|
||||
If you don't want minikube to open a web browser for you, run the dashboard command with the
|
||||
`--url` flag. `minikube` outputs a URL that you can open in the browser you prefer.
|
||||
`--url` flag. `minikube` outputs a URL that you can open in the browser you prefer:
|
||||
|
||||
Open a **new** terminal, and run:
|
||||
-->
|
||||
|
@ -139,6 +139,7 @@ Open a **new** terminal, and run:
|
|||
`minikube` 会输出一个 URL,你可以在你喜欢的浏览器中打开该 URL。
|
||||
|
||||
打开一个**新的**终端,然后运行:
|
||||
|
||||
```shell
|
||||
# 启动一个新的终端,并保持此命令运行。
|
||||
minikube dashboard --url
|
||||
|
|
|
@ -102,7 +102,7 @@ that are most appropriate for your configuration, do the following:
|
|||
|
||||
```
|
||||
Creating cluster "psa-wo-cluster-pss" ...
|
||||
✓ Ensuring node image (kindest/node:v{{< skew currentVersion >}}.0) 🖼
|
||||
✓ Ensuring node image (kindest/node:v{{< skew currentPatchVersion >}}) 🖼
|
||||
✓ Preparing nodes 📦
|
||||
✓ Writing configuration 📜
|
||||
✓ Starting control-plane 🕹️
|
||||
|
@ -398,7 +398,7 @@ following:
|
|||
|
||||
```
|
||||
Creating cluster "psa-with-cluster-pss" ...
|
||||
✓ Ensuring node image (kindest/node:v{{< skew currentVersion >}}.0) 🖼
|
||||
✓ Ensuring node image (kindest/node:v{{< skew currentPatchVersion >}}) 🖼
|
||||
✓ Preparing nodes 📦
|
||||
✓ Writing configuration 📜
|
||||
✓ Starting control-plane 🕹️
|
||||
|
|
Loading…
Reference in New Issue