Merge pull request #38798 from Zhuzhenghao/fix/field-selector

[zh-cn] Sync field-selector.md with en page
pull/38820/head
Kubernetes Prow Robot 2023-01-06 21:15:26 -08:00 committed by GitHub
commit c783bb37c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 9 deletions

View File

@ -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 >}}
<!--