Skip to content

Commit e5462c5

Browse files
authored
Merge pull request #39150 from windsonsea/serapp
[zh] sync /using-api/server-side-apply.md
2 parents 5e48ea7 + 54896f9 commit e5462c5

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

content/zh-cn/docs/reference/using-api/server-side-apply.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,15 +645,33 @@ First, the user defines a new configuration containing only the `replicas` field
645645

646646
首先,用户新定义一个只包含 `replicas` 字段的配置文件:
647647

648-
{{< codenew file="application/ssa/nginx-deployment-replicas-only.yaml" >}}
648+
```yaml
649+
# 将此文件另存为 'nginx-deployment-replicas-only.yaml'
650+
apiVersion: apps/v1
651+
kind: Deployment
652+
metadata:
653+
name: nginx-deployment
654+
spec:
655+
replicas: 3
656+
```
657+
658+
{{< note >}}
659+
<!--
660+
The YAML file for SSA in this case only contains the fields you want to change.
661+
You are not supposed to provide a fully compliant Deployment manifest if you only
662+
want to modify the `spec.replicas` field using SSA.
663+
-->
664+
此场景中针对 SSA 的 YAML 文件仅包含你要更改的字段。
665+
如果只想使用 SSA 来修改 `spec.replicas` 字段,你无需提供完全兼容的 Deployment 清单。
666+
{{< /note >}}
649667

650668
<!--
651669
The user applies that configuration using the field manager name `handover-to-hpa`:
652670
-->
653671
用户使用名为 `handover-to-hpa` 的字段管理器,应用此配置文件。
654672

655673
```shell
656-
kubectl apply -f https://k8s.io/examples/application/ssa/nginx-deployment-replicas-only.yaml \
674+
kubectl apply -f nginx-deployment-replicas-only.yaml \
657675
--server-side --field-manager=handover-to-hpa \
658676
--validate=false
659677
```

0 commit comments

Comments
 (0)