Merge pull request #38798 from Zhuzhenghao/fix/field-selector
[zh-cn] Sync field-selector.md with en pagepull/38820/head
commit
c783bb37c9
|
@ -10,7 +10,7 @@ weight: 70
|
|||
-->
|
||||
|
||||
<!--
|
||||
_Field selectors_ let you [select Kubernetes resources](/docs/concepts/overview/working-with-objects/kubernetes-objects) based on the value of one or more resource fields. Here are some example field selector queries:
|
||||
_Field selectors_ let you [select Kubernetes resources](/docs/concepts/overview/working-with-objects/kubernetes-objects) based on the value of one or more resource fields. Here are some examples of field selector queries:
|
||||
-->
|
||||
“字段选择器(Field selectors)”允许你根据一个或多个资源字段的值
|
||||
[筛选 Kubernetes 资源](/zh-cn/docs/concepts/overview/working-with-objects/kubernetes-objects)。
|
||||
|
@ -29,18 +29,15 @@ This `kubectl` command selects all Pods for which the value of the [`status.phas
|
|||
```shell
|
||||
kubectl get pods --field-selector status.phase=Running
|
||||
```
|
||||
<!--
|
||||
Field selectors are essentially resource *filters*. By default, no selectors/filters are applied, meaning that all resources of the specified type are selected. This makes the following `kubectl` queries equivalent:
|
||||
-->
|
||||
|
||||
{{< note >}}
|
||||
<!--
|
||||
Field selectors are essentially resource *filters*. By default, no selectors/filters are applied, meaning that all resources of the specified type are selected. This makes the `kubectl` queries `kubectl get pods` and `kubectl get pods --field-selector ""` equivalent.
|
||||
-->
|
||||
字段选择器本质上是资源“过滤器(Filters)”。默认情况下,字段选择器/过滤器是未被应用的,
|
||||
这意味着指定类型的所有资源都会被筛选出来。
|
||||
这使得以下的两个 `kubectl` 查询是等价的:
|
||||
这使得 `kubectl get pods` 和 `kubectl get pods --field-selector ""` 这两个 `kubectl` 查询是等价的。
|
||||
|
||||
```shell
|
||||
kubectl get pods
|
||||
kubectl get pods --field-selector ""
|
||||
```
|
||||
{{< /note >}}
|
||||
|
||||
<!--
|
||||
|
|
Loading…
Reference in New Issue