Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 68 additions & 32 deletions content/zh-cn/docs/reference/kubectl/generated/kubectl_diff/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Diff configurations specified by file name or stdin between the current online c

输出始终是 YAML。

KUBECTL_EXTERNAL_DIFF 环境变量可用于选择你自己的 diff 命令。
`KUBECTL_EXTERNAL_DIFF` 环境变量可用于选择你自己的 diff 命令。
用户也可以使用带参数的外部命令,例如:

```env
Expand All @@ -43,7 +43,7 @@ By default, the "diff" command available in your path will be run with the "-u"

退出状态:0 表示未发现差异。1 表示发现差异。>1 表示 kubectl 或 diff 发生错误。

注意:如果使用 KUBECTL_EXTERNAL_DIFF,则需要遵循该约定。
注意:如果使用 `KUBECTL_EXTERNAL_DIFF`,则需要遵循该约定。

```shell
kubectl diff -f FILENAME
Expand All @@ -53,17 +53,17 @@ kubectl diff -f FILENAME

<!--
```
# Diff resources included in pod.json
kubectl diff -f pod.json
# Diff file read from stdin
cat service.yaml | kubectl diff -f -
# Diff resources included in pod.json
kubectl diff -f pod.json

# Diff file read from stdin
cat service.yaml | kubectl diff -f -
```
-->
```shell
# 对比 pod.json 中包含的资源
kubectl diff -f pod.json

# 对比从标准输入读取到的文件
cat service.yaml | kubectl diff -f -
```
Expand All @@ -81,7 +81,8 @@ cat service.yaml | kubectl diff -f -
<td colspan="2">--concurrency int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:1</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Number of objects to process in parallel when diffing against the live version. Larger number = faster, but more memory, I/O and CPU over that shorter period of time.
-->
Expand All @@ -94,7 +95,8 @@ Number of objects to process in parallel when diffing against the live version.
<td colspan="2">--field-manager string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"kubectl-client-side-apply"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Name of the manager used to track field ownership.
-->
Expand All @@ -106,7 +108,8 @@ Name of the manager used to track field ownership.
<td colspan="2">-f, --filename strings</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Filename, directory, or URL to files contains the configuration to diff
-->
Expand Down Expand Up @@ -284,6 +287,20 @@ UID to impersonate for the operation.
</p></td>
</tr>

<tr>
<td colspan="2">--as-user-extra strings</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key.
-->
用户额外信息,用于伪装操作,此标志可以重复使用,为同一个键指定多个值。
</p>
</td>
</tr>

<tr>
<td colspan="2">--cache-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"$HOME/.kube/cache"</td>
</tr>
Expand Down Expand Up @@ -433,7 +450,8 @@ Require server version to match client version
<td colspan="2">-n, --namespace string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
If present, the namespace scope for this CLI request
-->
Expand All @@ -445,7 +463,8 @@ If present, the namespace scope for this CLI request
<td colspan="2">--password string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Password for basic authentication to the API server
-->
Expand All @@ -457,19 +476,21 @@ Password for basic authentication to the API server
<td colspan="2">--profile string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"none"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)
Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace)
-->
要记录的性能分析信息。可选值为(none|cpu|heap|goroutine|threadcreate|block|mutex)。
要记录的性能分析信息。可选值为(none|cpu|heap|goroutine|threadcreate|block|mutex|trace)。
</p></td>
</tr>

<tr>
<td colspan="2">--profile-output string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"profile.pprof"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Name of the file to write the profile to
-->
Expand All @@ -481,7 +502,8 @@ Name of the file to write the profile to
<td colspan="2">--request-timeout string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"0"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
-->
Expand All @@ -494,7 +516,8 @@ The length of time to wait before giving up on a single server request. Non-zero
<td colspan="2">-s, --server string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The address and port of the Kubernetes API server
-->
Expand All @@ -506,7 +529,8 @@ Kubernetes API 服务器的地址和端口。
<td colspan="2">--storage-driver-buffer-duration duration&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:1m0s</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction
-->
Expand All @@ -518,7 +542,8 @@ Writes in the storage driver will be buffered for this duration, and committed t
<td colspan="2">--storage-driver-db string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"cadvisor"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
database name
-->
Expand All @@ -530,7 +555,8 @@ database name
<td colspan="2">--storage-driver-host string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"localhost:8086"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
database host:port
-->
Expand All @@ -542,7 +568,8 @@ database host:port
<td colspan="2">--storage-driver-password string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"root"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
database password
-->
Expand All @@ -554,7 +581,8 @@ database password
<td colspan="2">--storage-driver-secure</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
use secure connection with database
-->
Expand All @@ -566,7 +594,8 @@ use secure connection with database
<td colspan="2">--storage-driver-table string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"stats"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
table name
-->
Expand All @@ -578,7 +607,8 @@ table name
<td colspan="2">--storage-driver-user string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default:-->默认值:"root"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
database username
-->
Expand All @@ -590,7 +620,8 @@ database username
<td colspan="2">--tls-server-name string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
-->
Expand All @@ -602,7 +633,8 @@ Server name to use for server certificate validation. If it is not provided, the
<td colspan="2">--token string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Bearer token for authentication to the API server
-->
Expand All @@ -614,7 +646,8 @@ Bearer token for authentication to the API server
<td colspan="2">--user string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The name of the kubeconfig user to use
-->
Expand All @@ -626,7 +659,8 @@ The name of the kubeconfig user to use
<td colspan="2">--username string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Username for basic authentication to the API server
-->
Expand All @@ -638,7 +672,8 @@ Username for basic authentication to the API server
<td colspan="2">--version version[=true]</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
--version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version
-->
Expand All @@ -650,7 +685,8 @@ Username for basic authentication to the API server
<td colspan="2">--warnings-as-errors</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Treat warnings received from the server as errors and exit with a non-zero exit code
-->
Expand Down