Skip to content

Commit c825a6a

Browse files
committed
[zh-cn]sync network-plugins field-selectors replicaset statefulset
Signed-off-by: xin.li <[email protected]>
1 parent 1111058 commit c825a6a

File tree

4 files changed

+62
-55
lines changed

4 files changed

+62
-55
lines changed

content/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Kubernetes {{< skew currentVersion >}} supports [Container Network Interface](ht
2121
cluster and that suits your needs. Different plugins are available (both open- and closed- source)
2222
in the wider Kubernetes ecosystem.
2323
-->
24-
Kubernetes {{< skew currentVersion >}} 支持用于集群联网的[容器网络接口](https://github.com/containernetworking/cni) (CNI) 插件。
24+
Kubernetes {{< skew currentVersion >}} 支持用于集群联网的[容器网络接口](https://github.com/containernetworking/cni)CNI插件。
2525
你必须使用和你的集群相兼容并且满足你的需求的 CNI 插件。
2626
在更广泛的 Kubernetes 生态系统中你可以使用不同的插件(开源和闭源)。
2727

@@ -97,35 +97,6 @@ that plugin or [networking provider](/docs/concepts/cluster-administration/netwo
9797
<!--
9898
## Network Plugin Requirements
9999
100-
For plugin developers and users who regularly build or deploy Kubernetes, the plugin may also need
101-
specific configuration to support kube-proxy. The iptables proxy depends on iptables, and the
102-
plugin may need to ensure that container traffic is made available to iptables. For example, if
103-
the plugin connects containers to a Linux bridge, the plugin must set the
104-
`net/bridge/bridge-nf-call-iptables` sysctl to `1` to ensure that the iptables proxy functions
105-
correctly. If the plugin does not use a Linux bridge, but uses something like Open vSwitch or
106-
some other mechanism instead, it should ensure container traffic is appropriately routed for the
107-
proxy.
108-
-->
109-
## 网络插件要求 {#network-plugin-requirements}
110-
111-
对于插件开发人员以及时常会构建并部署 Kubernetes 的用户而言,
112-
插件可能也需要特定的配置来支持 kube-proxy。
113-
iptables 代理依赖于 iptables,插件可能需要确保 iptables 能够监控容器的网络通信。
114-
例如,如果插件将容器连接到 Linux 网桥,插件必须将 `net/bridge/bridge-nf-call-iptables`
115-
sysctl 参数设置为 `1`,以确保 iptables 代理正常工作。
116-
如果插件不使用 Linux 网桥,而是使用类似于 Open vSwitch 或者其它一些机制,
117-
它应该确保为代理对容器通信执行正确的路由。
118-
119-
<!--
120-
By default, if no kubelet network plugin is specified, the `noop` plugin is used, which sets
121-
`net/bridge/bridge-nf-call-iptables=1` to ensure simple configurations (like Docker with a bridge)
122-
work correctly with the iptables proxy.
123-
-->
124-
默认情况下,如果未指定 kubelet 网络插件,则使用 `noop` 插件,
125-
该插件设置 `net/bridge/bridge-nf-call-iptables=1`,以确保简单的配置
126-
(如带网桥的 Docker)与 iptables 代理正常工作。
127-
128-
<!--
129100
### Loopback CNI
130101
131102
In addition to the CNI plugin installed on the nodes for implementing the Kubernetes network
@@ -136,6 +107,8 @@ Implementing the loopback interface can be accomplished by re-using the
136107
or by developing your own code to achieve this (see
137108
[this example from CRI-O](https://github.com/cri-o/ocicni/blob/release-1.24/pkg/ocicni/util_linux.go#L91)).
138109
-->
110+
## 网络插件要求 {#network-plugin-requirements}
111+
139112
### 本地回路 CNI {#loopback-cni}
140113

141114
除了安装到节点上用于实现 Kubernetes 网络模型的 CNI 插件外,Kubernetes
@@ -218,7 +191,7 @@ CNI 网络插件还支持 Pod 入站和出站流量整形。
218191

219192
如果你想要启用流量整形支持,你必须将 `bandwidth` 插件添加到 CNI 配置文件
220193
(默认是 `/etc/cni/net.d`)并保证该可执行文件包含在你的 CNI 的 bin
221-
文件夹内 (默认为 `/opt/cni/bin`)
194+
文件夹内默认为 `/opt/cni/bin`
222195

223196
```json
224197
{

content/zh-cn/docs/concepts/overview/working-with-objects/field-selectors.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,33 @@ kubectl get ingress --field-selector foo.bar=baz
6464
Error from server (BadRequest): Unable to find "ingresses" that match label selector "", field selector "foo.bar=baz": "foo.bar" is not a known field selector: only "metadata.name", "metadata.namespace"
6565
```
6666

67+
<!--
68+
### List of supported fields
69+
70+
| Kind | Fields |
71+
-->
72+
### 支持字段列表
73+
74+
| 类别 | 字段 |
75+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76+
| Pod | `spec.nodeName`<br>`spec.restartPolicy`<br>`spec.schedulerName`<br>`spec.serviceAccountName`<br>`spec.hostNetwork`<br>`status.phase`<br>`status.podIP`<br>`status.nominatedNodeName` |
77+
| Event | `involvedObject.kind`<br>`involvedObject.namespace`<br>`involvedObject.name`<br>`involvedObject.uid`<br>`involvedObject.apiVersion`<br>`involvedObject.resourceVersion`<br>`involvedObject.fieldPath`<br>`reason`<br>`reportingComponent`<br>`source`<br>`type` |
78+
| Secret | `type` |
79+
| Namespace | `status.phase` |
80+
| ReplicaSet | `status.replicas` |
81+
| ReplicationController | `status.replicas` |
82+
| Job | `status.successful` |
83+
| Node | `spec.unschedulable` |
84+
| CertificateSigningRequest | `spec.signerName` |
85+
6786
<!--
6887
## Supported operators
6988
7089
You can use the `=`, `==`, and `!=` operators with field selectors (`=` and `==` mean the same thing). This `kubectl` command, for example, selects all Kubernetes Services that aren't in the `default` namespace:
7190
-->
7291
## 支持的操作符 {#supported-operators}
7392

74-
你可在字段选择器中使用 `=``==``!=` `=``==` 的意义是相同的)操作符。
93+
你可在字段选择器中使用 `=``==``!=``=``==` 的意义是相同的)操作符。
7594
例如,下面这个 `kubectl` 命令将筛选所有不属于 `default` 命名空间的 Kubernetes 服务:
7695

7796
```shell

content/zh-cn/docs/concepts/workloads/controllers/replicaset.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: ReplicaSet
3+
api_metadata:
4+
- apiVersion: "apps/v1"
5+
kind: "ReplicaSet"
36
feature:
47
title: 自我修复
58
anchor: ReplicationController 如何工作
@@ -20,6 +23,9 @@ reviewers:
2023
- bprashanth
2124
- madhusudancs
2225
title: ReplicaSet
26+
api_metadata:
27+
- apiVersion: "apps/v1"
28+
kind: "ReplicaSet"
2329
feature:
2430
title: Self-healing
2531
anchor: How a ReplicaSet works
@@ -165,15 +171,14 @@ Namespace: default
165171
Selector: tier=frontend
166172
Labels: app=guestbook
167173
tier=frontend
168-
Annotations: kubectl.kubernetes.io/last-applied-configuration:
169-
{"apiVersion":"apps/v1","kind":"ReplicaSet","metadata":{"annotations":{},"labels":{"app":"guestbook","tier":"frontend"},"name":"frontend",...
174+
Annotations: <none>
170175
Replicas: 3 current / 3 desired
171176
Pods Status: 3 Running / 0 Waiting / 0 Succeeded / 0 Failed
172177
Pod Template:
173178
Labels: tier=frontend
174179
Containers:
175180
php-redis:
176-
Image: gcr.io/google_samples/gb-frontend:v3
181+
Image: us-docker.pkg.dev/google-samples/containers/gke/gb-frontend:v5
177182
Port: <none>
178183
Host Port: <none>
179184
Environment: <none>
@@ -182,9 +187,9 @@ Pod Template:
182187
Events:
183188
Type Reason Age From Message
184189
---- ------ ---- ---- -------
185-
Normal SuccessfulCreate 117s replicaset-controller Created pod: frontend-wtsmm
186-
Normal SuccessfulCreate 116s replicaset-controller Created pod: frontend-b2zdv
187-
Normal SuccessfulCreate 116s replicaset-controller Created pod: frontend-vcmts
190+
Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-gbgfx
191+
Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-rwz57
192+
Normal SuccessfulCreate 13s replicaset-controller Created pod: frontend-wkl7w
188193
```
189194

190195
<!--
@@ -203,9 +208,9 @@ You should see Pod information similar to:
203208

204209
```
205210
NAME READY STATUS RESTARTS AGE
206-
frontend-b2zdv 1/1 Running 0 6m36s
207-
frontend-vcmts 1/1 Running 0 6m36s
208-
frontend-wtsmm 1/1 Running 0 6m36s
211+
frontend-gbgfx 1/1 Running 0 10m
212+
frontend-rwz57 1/1 Running 0 10m
213+
frontend-wkl7w 1/1 Running 0 10m
209214
```
210215

211216
<!--
@@ -216,7 +221,7 @@ To do this, get the yaml of one of the Pods running:
216221
要实现这点,可取回运行中的某个 Pod 的 YAML:
217222

218223
```shell
219-
kubectl get pods frontend-b2zdv -o yaml
224+
kubectl get pods frontend-gbgfx -o yaml
220225
```
221226

222227
<!--
@@ -229,19 +234,19 @@ The output will look similar to this, with the frontend ReplicaSet's info set in
229234
apiVersion: v1
230235
kind: Pod
231236
metadata:
232-
creationTimestamp: "2020-02-12T07:06:16Z"
237+
creationTimestamp: "2024-02-28T22:30:44Z"
233238
generateName: frontend-
234239
labels:
235240
tier: frontend
236-
name: frontend-b2zdv
241+
name: frontend-gbgfx
237242
namespace: default
238243
ownerReferences:
239244
- apiVersion: apps/v1
240245
blockOwnerDeletion: true
241246
controller: true
242247
kind: ReplicaSet
243248
name: frontend
244-
uid: f391f6db-bb9b-4c09-ae74-6a1f77f3d5cf
249+
uid: e129deca-f864-481b-bb16-b27abfd92292
245250
...
246251
```
247252

content/zh-cn/docs/concepts/workloads/controllers/statefulset.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ that provides a set of stateless replicas.
8484

8585
<!--
8686
* The storage for a given Pod must either be provisioned by a
87-
[PersistentVolume Provisioner](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md)
88-
based on the requested `storage class`, or pre-provisioned by an admin.
87+
[PersistentVolume Provisioner](/docs/concepts/storage/dynamic-provisioning/) ([examples here](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md))
88+
based on the requested _storage class_, or pre-provisioned by an admin.
8989
* Deleting and/or scaling a StatefulSet down will *not* delete the volumes associated with the
9090
StatefulSet. This is done to ensure data safety, which is generally more valuable than an
9191
automatic purge of all related StatefulSet resources.
@@ -101,8 +101,9 @@ that provides a set of stateless replicas.
101101
[manual intervention to repair](#forced-rollback).
102102
-->
103103
* 给定 Pod 的存储必须由
104-
[PersistentVolume Provisioner](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md)
105-
基于所请求的 `storage class` 来制备,或者由管理员预先制备。
104+
[PersistentVolume Provisioner](/zh-cn/docs/concepts/storage/dynamic-provisioning/)
105+
[例子在这里](https://github.com/kubernetes/examples/tree/master/staging/persistent-volume-provisioning/README.md)
106+
基于所请求的 **storage class** 来制备,或者由管理员预先制备。
106107
* 删除或者扩缩 StatefulSet 并**不会**删除它关联的存储卷。
107108
这样做是为了保证数据安全,它通常比自动清除 StatefulSet 所有相关的资源更有价值。
108109
* StatefulSet 当前需要[无头服务](/zh-cn/docs/concepts/services-networking/service/#headless-services)来负责 Pod
@@ -222,15 +223,24 @@ validation error during StatefulSet creation.
222223
<!--
223224
### Volume Claim Templates
224225

225-
You can set the `.spec.volumeClaimTemplates` which can provide stable storage using
226-
[PersistentVolumes](/docs/concepts/storage/persistent-volumes/) provisioned by a PersistentVolume
227-
Provisioner.
226+
You can set the `.spec.volumeClaimTemplates` field to create a
227+
[PersistentVolumeClaim](/docs/concepts/storage/persistent-volumes/).
228+
This will provide stable storage to the StatefulSet if either
228229
-->
229230
### 卷申领模板 {#volume-claim-templates}
230231

231-
你可以设置 `.spec.volumeClaimTemplates`,
232-
它可以使用 PersistentVolume 制备程序所准备的
233-
[PersistentVolumes](/zh-cn/docs/concepts/storage/persistent-volumes/) 来提供稳定的存储。
232+
你可以设置 `.spec.volumeClaimTemplates` 字段来创建
233+
[PersistentVolumeClaim](/zh-cn/docs/concepts/storage/persistent-volumes/)。
234+
这将为 StatefulSet 提供稳定的存储,如果:
235+
236+
<!--
237+
* The StorageClass specified for the volume claim is set up to use [dynamic
238+
provisioning](/docs/concepts/storage/dynamic-provisioning/), or
239+
* The cluster already contains a PersistentVolume with the correct StorageClass
240+
and sufficient available storage space.
241+
-->
242+
* 为卷申领指定的 StorageClass 配置使用[动态制备](/zh-cn/docs/concepts/storage/dynamic-provisioning/),或
243+
* 集群已包含具有正确 StorageClass 和足够可用存储空间的 PersistentVolume。
234244

235245
<!--
236246
### Minimum ready seconds

0 commit comments

Comments
 (0)