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
Since a namespace is a cluster-scoped resource type, you can retrieve the list
@@ -334,7 +339,9 @@ Kubernetes API 默认使用 [JSON](https://www.json.org/json-en.html) 来编码
334
339
<!--
335
340
### YAML resource encoding {#yaml-encoding}
336
341
337
-
Kubernetes also supports the [`application/yaml`](https://www.rfc-editor.org/rfc/rfc9512.html) media type for both requests and responses. [`YAML`](https://yaml.org/) can be used for defining Kubernetes manifests and API interactions.
342
+
Kubernetes also supports the [`application/yaml`](https://www.rfc-editor.org/rfc/rfc9512.html)
343
+
media type for both requests and responses. [`YAML`](https://yaml.org/)
344
+
can be used for defining Kubernetes manifests and API interactions.
338
345
339
346
For example:
340
347
-->
@@ -408,7 +415,7 @@ Kubernetes uses an envelope wrapper to encode [Protobuf](https://protobuf.dev/)
408
415
That wrapper starts with a 4 byte magic number to help identify content in disk or in etcd as Protobuf
409
416
(as opposed to JSON). The 4 byte magic number data is followed by a Protobuf encoded wrapper message, which
410
417
describes the encoding and type of the underlying object. Within the Protobuf wrapper message,
411
-
the inner object data is recorded using the `raw` field of Unknown (see the [IDL](##protobuf-encoding-idl)
418
+
the inner object data is recorded using the `raw` field of Unknown (see the [IDL](#protobuf-encoding-idl)
@@ -989,7 +996,7 @@ of 500 pods at a time, request those chunks as follows:
989
996
```
990
997
991
998
<!--
992
-
2. Continue the previous call, retrieving the next set of 500 pods.
999
+
1. Continue the previous call, retrieving the next set of 500 pods.
993
1000
-->
994
1001
2. 继续前面的调用,返回下一组 500 个 Pod:
995
1002
@@ -1013,7 +1020,7 @@ of 500 pods at a time, request those chunks as follows:
1013
1020
```
1014
1021
1015
1022
<!--
1016
-
3. Continue the previous call, retrieving the last 253 pods.
1023
+
1. Continue the previous call, retrieving the last 253 pods.
1017
1024
-->
1018
1025
3. 继续前面的调用,返回最后 253 个 Pod:
1019
1026
@@ -1076,10 +1083,10 @@ collections of different types of resource. Collections have a kind
1076
1083
named for the resource kind, with `List` appended.
1077
1084
1078
1085
When you query the API for a particular type, all items returned by that query are
1079
-
of that type.
1080
-
For example, when you **list** Services, the collection response
1086
+
of that type. For example, when you **list** Services, the collection response
1081
1087
has `kind` set to
1082
-
[`ServiceList`](/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceList); each item in that collection represents a single Service. For example:
the object and is randomly generated (non-deterministic)
1650
1663
* `resourceVersion`: tracks the persisted version of the object
1651
1664
* Any field set by a mutating admission controller
1652
1665
* For the `Service` resource: Ports or IP addresses that the kube-apiserver assigns to Service objects
@@ -1724,7 +1737,8 @@ Kubernetes 使用该 `resourceVersion` 信息,这样 API 服务器可以检测
1724
1737
<!--
1725
1738
Instead of sending a PUT request, the client can send an instruction to the API
1726
1739
server to **patch** an existing resource. A **patch** is typically appropriate
1727
-
if the change that the client wants to make isn't conditional on the existing data. Clients that need effective detection of lost updates should consider
1740
+
if the change that the client wants to make isn't conditional on the existing data.
1741
+
Clients that need effective detection of lost updates should consider
1728
1742
making their request conditional on the existing `resourceVersion` (either HTTP PUT or HTTP PATCH),
1729
1743
and then handle any retries that are needed in case there is a conflict.
1730
1744
@@ -1908,10 +1922,10 @@ A **patch** update is helpful, because:
1908
1922
<!--
1909
1923
However:
1910
1924
1911
-
* you need more local (client) logic to build the patch; it helps a lot if you have
1912
-
a library implementation of JSON Patch, or even for making a JSON Patch specifically against Kubernetes
1913
-
* as the author of client software, you need to be careful when building the patch
1914
-
(the HTTP request body) not to drop fields (the order of operations matters)
1925
+
* You need more local (client) logic to build the patch; it helps a lot if you have
1926
+
a library implementation of JSON Patch, or even for making a JSON Patch specifically against Kubernetes.
1927
+
* As the author of client software, you need to be careful when building the patch
1928
+
(the HTTP request body) not to drop fields (the order of operations matters).
1915
1929
-->
1916
1930
然而:
1917
1931
@@ -1932,28 +1946,28 @@ Server-Side Apply has some clear benefits:
1932
1946
* A single round trip: it rarely requires making a `GET` request first.
1933
1947
* and you can still detect conflicts for unexpected changes
1934
1948
* you have the option to force override a conflict, if appropriate
1935
-
* Client implementations are easy to make
1949
+
* Client implementations are easy to make.
1936
1950
* You get an atomic create-or-update operation without extra effort
1937
-
(similar to `UPSERT` in some SQL dialects)
1951
+
(similar to `UPSERT` in some SQL dialects).
1938
1952
-->
1939
1953
* 仅需一次轮询:通常无需先执行 `GET` 请求。
1940
1954
* 并且你仍然可以检测到意外更改造成的冲突
1941
1955
* 合适的时候,你可以选择强制覆盖冲突
1942
-
* 客户端实现简单
1956
+
* 客户端实现简单。
1943
1957
* 你可以轻松获得原子级别的 create 或 update 操作,无需额外工作
1944
-
(类似于某些 SQL 语句中的 `UPSERT`)
1958
+
(类似于某些 SQL 语句中的 `UPSERT`)。
1945
1959
1946
1960
<!--
1947
1961
However:
1948
1962
1949
-
* Server-Side Apply does not work at all for field changes that depend on a current value of the object
1963
+
* Server-Side Apply does not work at all for field changes that depend on a current value of the object.
1950
1964
* You can only apply updates to objects. Some resources in the Kubernetes HTTP API are
1951
1965
not objects (they do not have a `.metadata` field), and Server-Side Apply
1952
1966
is only relevant for Kubernetes objects.
1953
1967
-->
1954
1968
然而:
1955
1969
1956
-
* 服务器端应用不适合依赖对象当前值的字段更改
1970
+
* 服务器端应用不适合依赖对象当前值的字段更改。
1957
1971
* 你只能更新对象。Kubernetes HTTP API 中的某些资源不是对象(它们没有 `.metadata` 字段),
1958
1972
并且服务器端应用只能用于 Kubernetes 对象。
1959
1973
@@ -1986,9 +2000,12 @@ API 客户端只能比较两个资源版本的相等性(这意味着你不能
1986
2000
Clients find resource versions in resources, including the resources from the response
1987
2001
stream for a **watch**, or when using **list** to enumerate resources.
1988
2002
1989
-
[v1.meta/ObjectMeta](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#objectmeta-v1-meta) - The `metadata.resourceVersion` of a resource instance identifies the resource version the instance was last modified at.
The `metadata.resourceVersion` of a resource instance identifies the resource version the instance was last modified at.
1990
2005
1991
-
[v1.meta/ListMeta](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#listmeta-v1-meta) - The `metadata.resourceVersion` of a resource collection (the response to a **list**) identifies the resource version at which the collection was constructed.
0 commit comments