Skip to content

Commit 65b7657

Browse files
authored
Merge pull request #45417 from my-git9/patch-12746
[zh-cn]sync nodes assign-pod-node source-ip kubeadm_config_print_reset-defaults
2 parents 57020ed + 58a60d7 commit 65b7657

File tree

4 files changed

+47
-54
lines changed

4 files changed

+47
-54
lines changed

content/zh-cn/docs/concepts/architecture/nodes.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ For nodes there are two forms of heartbeats:
342342

343343
Kubernetes 节点发送的心跳帮助你的集群确定每个节点的可用性,并在检测到故障时采取行动。
344344

345-
对于节点,有两种形式的心跳:
345+
对于节点,有两种形式的心跳
346346

347347
<!--
348348
* Updates to the [`.status`](/docs/reference/node/node-status/) of a Node.
@@ -442,7 +442,7 @@ the same time:
442442
- Otherwise, the eviction rate is reduced to `--secondary-node-eviction-rate`
443443
(default 0.01) per second.
444444
-->
445-
- 如果不健康节点的比例超过 `--unhealthy-zone-threshold` (默认为 0.55),
445+
- 如果不健康节点的比例超过 `--unhealthy-zone-threshold`(默认为 0.55),
446446
驱逐速率将会降低。
447447
- 如果集群较小(意即小于等于 `--large-cluster-size-threshold` 个节点 - 默认为 50),
448448
驱逐操作将会停止。
@@ -534,7 +534,7 @@ If you want to explicitly reserve resources for non-Pod processes, see
534534
-->
535535
## 节点拓扑 {#node-topology}
536536

537-
{{< feature-state state="stable" for_k8s_version="v1.27" >}}
537+
{{< feature-state feature_gate_name="TopologyManager" >}}
538538

539539
<!--
540540
If you have enabled the `TopologyManager`
@@ -552,7 +552,7 @@ for more information.
552552
-->
553553
## 节点体面关闭 {#graceful-node-shutdown}
554554

555-
{{< feature-state state="beta" for_k8s_version="v1.21" >}}
555+
{{< feature-state feature_gate_name="GracefulNodeShutdown" >}}
556556

557557
<!--
558558
The kubelet attempts to detect node system shutdown and terminates pods running on the node.
@@ -707,7 +707,7 @@ Message: Pod was terminated in response to imminent node shutdown.
707707
-->
708708
### 基于 Pod 优先级的节点体面关闭 {#pod-priority-graceful-node-shutdown}
709709

710-
{{< feature-state state="beta" for_k8s_version="v1.24" >}}
710+
{{< feature-state feature_gate_name="GracefulNodeShutdownBasedOnPodPriority" >}}
711711

712712
<!--
713713
To provide more flexibility during graceful node shutdown around the ordering
@@ -868,7 +868,7 @@ kubelet 子系统中会生成 `graceful_shutdown_start_time_seconds` 和
868868
-->
869869
## 处理节点非体面关闭 {#non-graceful-node-shutdown}
870870

871-
{{< feature-state state="stable" for_k8s_version="v1.28" >}}
871+
{{< feature-state feature_gate_name="NodeOutOfServiceVolumeDetach" >}}
872872

873873
<!--
874874
A node shutdown action may not be detected by kubelet's Node Shutdown Manager,
@@ -955,7 +955,7 @@ During a non-graceful shutdown, Pods are terminated in the two phases:
955955
-->
956956
## 交换内存管理 {#swap-memory}
957957

958-
{{< feature-state state="beta" for_k8s_version="v1.28" >}}
958+
{{< feature-state feature_gate_name="NodeSwap" >}}
959959

960960
<!--
961961
To enable swap on a node, the `NodeSwap` feature gate must be enabled on
@@ -979,7 +979,7 @@ of Secret objects that were written to tmpfs now could be swapped to disk.
979979
A user can also optionally configure `memorySwap.swapBehavior` in order to
980980
specify how a node will use swap memory. For example,
981981
-->
982-
用户还可以选择配置 `memorySwap.swapBehavior` 以指定节点使用交换内存的方式。例如:
982+
用户还可以选择配置 `memorySwap.swapBehavior` 以指定节点使用交换内存的方式。例如
983983

984984
```yaml
985985
memorySwap:
@@ -1051,7 +1051,7 @@ see the blog-post about [Kubernetes 1.28: NodeSwap graduates to Beta1](/blog/202
10511051
[KEP-2400](https://github.com/kubernetes/enhancements/issues/4128) and its
10521052
[design proposal](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2400-node-swap/README.md).
10531053
-->
1054-
只有 **cgroup v2** 支持交换空间,cgroup v1 不支持。
1054+
只有 **Cgroup v2** 支持交换空间,Cgroup v1 不支持。
10551055

10561056
如需了解更多信息、协助测试和提交反馈,请参阅关于
10571057
[Kubernetes 1.28:NodeSwap 进阶至 Beta1](/zh-cn/blog/2023/08/24/swap-linux-beta/) 的博客文章、

content/zh-cn/docs/concepts/scheduling-eviction/assign-pod-node.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ the Pod deploys to, for example, to ensure that a Pod ends up on a node with an
2929
or to co-locate Pods from two different services that communicate a lot into the same availability zone.
3030
-->
3131
你可以约束一个 {{< glossary_tooltip text="Pod" term_id="pod" >}}
32-
以便 **限制** 其只能在特定的{{< glossary_tooltip text="节点" term_id="node" >}}上运行,
32+
以便**限制**其只能在特定的{{< glossary_tooltip text="节点" term_id="node" >}}上运行,
3333
或优先在特定的节点上运行。有几种方法可以实现这点,推荐的方法都是用
3434
[标签选择算符](/zh-cn/docs/concepts/overview/working-with-objects/labels/)来进行选择。
3535
通常这样的约束不是必须的,因为调度器将自动进行合理的放置(比如,将 Pod 分散到节点上,
@@ -278,7 +278,7 @@ to repel Pods from specific nodes.
278278
If you specify both `nodeSelector` and `nodeAffinity`, *both* must be satisfied
279279
for the Pod to be scheduled onto a node.
280280
-->
281-
如果你同时指定了 `nodeSelector``nodeAffinity`**两者** 必须都要满足,
281+
如果你同时指定了 `nodeSelector``nodeAffinity`**两者**必须都要满足,
282282
才能将 Pod 调度到候选节点上。
283283

284284
<!--
@@ -676,7 +676,7 @@ null `namespaceSelector` matches the namespace of the Pod where the rule is defi
676676

677677
#### matchLabelKeys
678678

679-
{{< feature-state for_k8s_version="v1.29" state="alpha" >}}
679+
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
680680

681681
{{< note >}}
682682
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
@@ -730,26 +730,27 @@ metadata:
730730
...
731731
spec:
732732
template:
733-
affinity:
734-
podAffinity:
735-
requiredDuringSchedulingIgnoredDuringExecution:
736-
- labelSelector:
737-
matchExpressions:
738-
- key: app
739-
operator: In
740-
values:
741-
- database
742-
topologyKey: topology.kubernetes.io/zone
743-
# 只有在计算 Pod 亲和性时,才考虑指定上线的 Pod。
744-
# 如果你更新 Deployment,替代的 Pod 将遵循它们自己的亲和性规则
745-
# (如果在新的 Pod 模板中定义了任何规则)。
746-
matchLabelKeys:
747-
- pod-template-hash
733+
spec:
734+
affinity:
735+
podAffinity:
736+
requiredDuringSchedulingIgnoredDuringExecution:
737+
- labelSelector:
738+
matchExpressions:
739+
- key: app
740+
operator: In
741+
values:
742+
- database
743+
topologyKey: topology.kubernetes.io/zone
744+
# 只有在计算 Pod 亲和性时,才考虑指定上线的 Pod。
745+
# 如果你更新 Deployment,替代的 Pod 将遵循它们自己的亲和性规则
746+
# (如果在新的 Pod 模板中定义了任何规则)。
747+
matchLabelKeys:
748+
- pod-template-hash
748749
```
749750

750751
#### mismatchLabelKeys
751752

752-
{{< feature-state for_k8s_version="v1.29" state="alpha" >}}
753+
{{< feature-state feature_gate_name="MatchLabelKeysInPodAffinity" >}}
753754

754755
{{< note >}}
755756
<!-- UPDATE THIS WHEN PROMOTING TO BETA -->
@@ -773,7 +774,7 @@ One example use case is to ensure Pods go to the topology domain (node, zone, et
773774
In other words, you want to avoid running Pods from two different tenants on the same topology domain at the same time.
774775
-->
775776
Kubernetes 为 Pod 亲和性或反亲和性提供了一个可选的 `mismatchLabelKeys` 字段。
776-
此字段指定了在满足 Pod(反)亲和性时,**不** 应与传入 Pod 的标签匹配的键。
777+
此字段指定了在满足 Pod(反)亲和性时,**不**应与传入 Pod 的标签匹配的键。
777778

778779
一个示例用例是确保 Pod 进入指定的拓扑域(节点、区域等),在此拓扑域中只调度来自同一租户或团队的 Pod。
779780
换句话说,你想要避免在同一拓扑域中同时运行来自两个不同租户的 Pod。
@@ -976,7 +977,7 @@ where each web server is co-located with a cache, on three separate nodes.
976977
The overall effect is that each cache instance is likely to be accessed by a single client, that
977978
is running on the same node. This approach aims to minimize both skew (imbalanced load) and latency.
978979
-->
979-
总体效果是每个缓存实例都非常可能被在同一个节点上运行的某个客户端访问
980+
总体效果是每个缓存实例都非常可能被在同一个节点上运行的某个客户端访问
980981
这种方法旨在最大限度地减少偏差(负载不平衡)和延迟。
981982

982983
<!--
@@ -1027,7 +1028,8 @@ Some of the limitations of using `nodeName` to select nodes are:
10271028
<!--
10281029
`nodeName` is intended for use by custom schedulers or advanced use cases where
10291030
you need to bypass any configured schedulers. Bypassing the schedulers might lead to
1030-
failed Pods if the assigned Nodes get oversubscribed. You can use [node affinity](#node-affinity) or a the [`nodeselector` field](#nodeselector) to assign a Pod to a specific Node without bypassing the schedulers.
1031+
failed Pods if the assigned Nodes get oversubscribed. You can use [node affinity](#node-affinity) or a the
1032+
[`nodeselector` field](#nodeselector) to assign a Pod to a specific Node without bypassing the schedulers.
10311033
-->
10321034
`nodeName` 旨在供自定义调度器或需要绕过任何已配置调度器的高级场景使用。
10331035
如果已分配的 Node 负载过重,绕过调度器可能会导致 Pod 失败。

content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_reset-defaults.md

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,13 @@ kubeadm config print reset-defaults [flags]
2929
-->
3030
### 选项
3131

32-
<table style="width: 100%; table-layout: fixed;">
32+
<table style="width: 100%; table-layout: fixed;">
3333
<colgroup>
3434
<col span="1" style="width: 10px;" />
3535
<col span="1" />
3636
</colgroup>
3737
<tbody>
3838

39-
<tr>
40-
<td colspan="2">--component-configs strings</td>
41-
</tr>
42-
<tr>
43-
<td></td><td style="line-height: 130%; word-wrap: break-word;">
44-
<p>
45-
<!--
46-
A comma-separated list for component config API objects to print the default values for. Available values: [KubeProxyConfiguration KubeletConfiguration]. If this flag is not set, no component configs will be printed.
47-
-->
48-
组件配置 API 对象的逗号分隔列表,打印其默认值。
49-
可用值:[KubeProxyConfiguration KubeletConfiguration]
50-
如果此参数未被设置,则不会打印任何组件配置。
51-
</p>
52-
</td>
53-
</tr>
54-
5539
<tr>
5640
<td colspan="2">-h, --help</td>
5741
</tr>
@@ -74,7 +58,7 @@ reset-defaults 操作的帮助命令。
7458
-->
7559
### 从父命令继承的选项
7660

77-
<table style="width: 100%; table-layout: fixed;">
61+
<table style="width: 100%; table-layout: fixed;">
7862
<colgroup>
7963
<col span="1" style="width: 10px;" />
8064
<col span="1" />

content/zh-cn/docs/tutorials/services/source-ip.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ the target localization.
4343

4444
<!--
4545
[NAT](https://en.wikipedia.org/wiki/Network_address_translation)
46-
: network address translation
46+
: Network address translation
4747
4848
[Source NAT](https://en.wikipedia.org/wiki/Network_address_translation#SNAT)
49-
: replacing the source IP on a packet; in this page, that usually means replacing with the IP address of a node.
49+
: Replacing the source IP on a packet; in this page, that usually means replacing with the IP address of a node.
5050
5151
[Destination NAT](https://en.wikipedia.org/wiki/Network_address_translation#DNAT)
52-
: replacing the destination IP on a packet; in this page, that usually means replacing with the IP address of a {{< glossary_tooltip term_id="pod" >}}
52+
: Replacing the destination IP on a packet; in this page, that usually means replacing with the IP address of a {{< glossary_tooltip term_id="pod" >}}
5353
5454
[VIP](/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies)
55-
: a virtual IP address, such as the one assigned to every {{< glossary_tooltip text="Service" term_id="service" >}} in Kubernetes
55+
: A virtual IP address, such as the one assigned to every {{< glossary_tooltip text="Service" term_id="service" >}} in Kubernetes
5656
5757
[kube-proxy](/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies)
58-
: a network daemon that orchestrates Service VIP management on every node
58+
: A network daemon that orchestrates Service VIP management on every node
5959
-->
6060
[NAT](https://zh.wikipedia.org/wiki/%E7%BD%91%E7%BB%9C%E5%9C%B0%E5%9D%80%E8%BD%AC%E6%8D%A2)
6161
: 网络地址转换
@@ -89,6 +89,7 @@ IP of requests it receives through an HTTP header. You can create it as follows:
8989
```shell
9090
kubectl create deployment source-ip-app --image=registry.k8s.io/echoserver:1.4
9191
```
92+
9293
<!--
9394
The output is:
9495
-->
@@ -130,6 +131,7 @@ kube-proxy,则从集群内发送到 ClusterIP 的数据包永远不会进行
130131
```console
131132
kubectl get nodes
132133
```
134+
133135
<!--
134136
The output is similar to this:
135137
-->
@@ -341,6 +343,7 @@ Visually:
341343
* Pod 的回复被发送回给客户端
342344

343345
用图表示:
346+
344347
{{< figure src="/zh-cn/docs/images/tutor-service-nodePort-fig01.svg" alt="图 1:源 IP NodePort" class="diagram-large" caption="如图。使用 SNAT 的源 IP(Type=NodePort)" link="https://mermaid.live/edit#pako:eNqNkV9rwyAUxb-K3LysYEqS_WFYKAzat9GHdW9zDxKvi9RoMIZtlH732ZjSbE970cu5v3s86hFqJxEYfHjRNeT5ZcUtIbXRaMNN2hZ5vrYRqt52cSXV-4iMSuwkZiYtyX739EqWaahMQ-V1qPxDVLNOvkYrO6fj2dupWMR2iiT6foOKdEZoS5Q2hmVSStoH7w7IMqXUVOefWoaG3XVftHbGeZYVRbH6ZXJ47CeL2-qhxvt_ucTe1SUlpuMN6CX12XeGpLdJiaMMFFr0rdAyvvfxjHEIDbbIgcVSohKDCRy4PUV06KQIuJU6OA9MCdMjBTEEt_-2NbDgB7xAGy3i97VJPP0ABRmcqg" >}}
345348

346349
<!--
@@ -368,6 +371,7 @@ Set the `service.spec.externalTrafficPolicy` field as follows:
368371
```shell
369372
kubectl patch svc nodeport -p '{"spec":{"externalTrafficPolicy":"Local"}}'
370373
```
374+
371375
<!--
372376
The output is:
373377
-->
@@ -385,6 +389,7 @@ Now, re-run the test:
385389
```shell
386390
for node in $NODES; do curl --connect-timeout 1 -s $node:$NODEPORT | grep -i client_address; done
387391
```
392+
388393
<!--
389394
The output is similar to:
390395
-->
@@ -447,6 +452,7 @@ You can test this by exposing the source-ip-app through a load balancer:
447452
```shell
448453
kubectl expose deployment source-ip-app --name=loadbalancer --port=80 --target-port=8080 --type=LoadBalancer
449454
```
455+
450456
<!--
451457
The output is:
452458
-->
@@ -550,6 +556,7 @@ serving the health check at `/healthz`. You can test this:
550556
```shell
551557
kubectl get pod -o wide -l app=source-ip-app
552558
```
559+
553560
<!--
554561
The output is similar to this:
555562
-->

0 commit comments

Comments
 (0)