Skip to content

Commit ba2e5c8

Browse files
authored
Merge pull request #20342 from senique/patch-1
Update object-management.md
2 parents e393e12 + f989fe3 commit ba2e5c8

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

content/zh/docs/concepts/overview/working-with-objects/object-management.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ types whose specs are updated independently of the configuration file.
138138
Services of type `LoadBalancer`, for example, have their `externalIPs` field updated
139139
independently from the configuration by the cluster.
140140
-->
141-
`replace` 命令式命令将现有规范替换为新提供的规范,并删除对配置文件中缺少的对象的所有更改。此方法不应与规范独立于配置文件进行更新的资源类型一起使用。比如类型为 `LoadBalancer` 的服务,它的 `externalIPs` 字段就是独立于集群的配置进行更新
141+
`replace` 命令式命令将现有规范替换为新提供的规范,并删除对配置文件中缺少的对象的所有更改。此方法不应与规范独立于配置文件进行更新的资源类型一起使用。比如类型为 `LoadBalancer` 的服务,它的 `externalIPs` 字段就是独立于集群配置进行更新
142142
{{< /warning >}}
143143

144144
<!--
@@ -149,7 +149,7 @@ independently from the configuration by the cluster.
149149
<!--
150150
Create the objects defined in a configuration file:
151151
-->
152-
创建在配置文件中定义的对象
152+
创建配置文件中定义的对象
153153

154154
```sh
155155
kubectl create -f nginx.yaml
@@ -158,7 +158,7 @@ kubectl create -f nginx.yaml
158158
<!--
159159
Delete the objects defined in two configuration files:
160160
-->
161-
删除在两个配置文件中定义的对象
161+
删除两个配置文件中定义的对象
162162

163163
```sh
164164
kubectl delete -f nginx.yaml -f redis.yaml
@@ -168,7 +168,7 @@ kubectl delete -f nginx.yaml -f redis.yaml
168168
Update the objects defined in a configuration file by overwriting
169169
the live configuration:
170170
-->
171-
通过覆盖实时配置来更新配置文件中定义的对象
171+
通过覆盖活动配置来更新配置文件中定义的对象
172172

173173
```sh
174174
kubectl replace -f nginx.yaml
@@ -203,7 +203,7 @@ Disadvantages compared to imperative commands:
203203
- Object configuration requires the additional step of writing a YAML file.
204204
-->
205205
- 对象配置需要对对象架构有基本的了解。
206-
- 对象配置需要额外的写 YAML 文件的步骤
206+
- 对象配置需要额外的步骤来编写 YAML 文件
207207

208208
<!--
209209
Advantages compared to declarative object configuration:
@@ -226,8 +226,8 @@ Disadvantages compared to declarative object configuration:
226226
- Imperative object configuration works best on files, not directories.
227227
- Updates to live objects must be reflected in configuration files, or they will be lost during the next replacement.
228228
-->
229-
- 命令式对象配置针对文件而不是目录上效果最佳
230-
- 对活动对象的更新必须反映在配置文件中,否则将在下一次替换是丢失
229+
- 命令式对象配置更适合文件,而非目录
230+
- 对活动对象的更新必须反映在配置文件中,否则会在下一次替换时丢失
231231

232232
<!--
233233
## Declarative object configuration
@@ -241,7 +241,7 @@ operations to be taken on the files. Create, update, and delete operations
241241
are automatically detected per-object by `kubectl`. This enables working on
242242
directories, where different operations might be needed for different objects.
243243
-->
244-
使用声明式对象配置时,用户对本地存储的对象配置文件进行操作,但是用户未定义要对该文件执行的操作。会自动通过 `kubectl` 按对象检测来创建、更新和删除对象。这使得可以在目录上工作,其中可能需要对不同的对象执行不同的操作
244+
使用声明式对象配置时,用户对本地存储的对象配置文件进行操作,但是用户未定义要对该文件执行的操作。`kubectl` 会自动检测每个文件的创建、更新和删除操作。这使得配置可以在目录上工作,根据目录中配置文件对不同的对象执行不同的操作
245245

246246
{{< note >}}
247247
<!--
@@ -295,8 +295,8 @@ Advantages compared to imperative object configuration:
295295
- Changes made directly to live objects are retained, even if they are not merged back into the configuration files.
296296
- Declarative object configuration has better support for operating on directories and automatically detecting operation types (create, patch, delete) per-object.
297297
-->
298-
- 即使未将对活动对象所做的更改未合并回到配置文件中,也将保留这些更改
299-
- 声明性对象配置更好地支持对目录进行操作并自动检测每个对象的操作类型(创建,修补,删除)。
298+
- 对活动对象所做的更改即使未合并到配置文件中,也会被保留下来
299+
- 声明性对象配置更好地支持对目录进行操作并自动检测每个文件的操作类型(创建,修补,删除)。
300300

301301
<!--
302302
Disadvantages compared to imperative object configuration:
@@ -307,8 +307,8 @@ Disadvantages compared to imperative object configuration:
307307
- Declarative object configuration is harder to debug and understand results when they are unexpected.
308308
- Partial updates using diffs create complex merge and patch operations.
309309
-->
310-
- 声明式对象配置难于调试并且出现异常时难以理解
311-
- 使用差异的部分更新会创建复杂的合并和补丁操作
310+
- 声明式对象配置难于调试并且出现异常时结果难以理解
311+
- 使用 diff 产生的部分更新会创建复杂的合并和补丁操作
312312

313313
{{% /capture %}}
314314

0 commit comments

Comments
 (0)