Skip to content

Commit 9306717

Browse files
authored
Merge pull request #38398 from windsonsea/kubecy
[zh] sync /reference/kubectl/_index.md
2 parents 694c4f7 + bc57b87 commit 9306717

File tree

1 file changed

+8
-12
lines changed
  • content/zh-cn/docs/reference/kubectl

1 file changed

+8
-12
lines changed

content/zh-cn/docs/reference/kubectl/_index.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: 命令行工具 (kubectl)
33
content_type: reference
4-
weight: 60
4+
weight: 110
55
no_list: true
66
card:
77
name: reference
@@ -10,16 +10,14 @@ card:
1010
<!--
1111
title: Command line tool (kubectl)
1212
content_type: reference
13-
weight: 60
13+
weight: 110
1414
no_list: true
1515
card:
1616
name: reference
1717
weight: 20
1818
-->
1919
<!-- overview -->
20-
<!--
21-
{{< glossary_definition prepend="Kubernetes provides a" term_id="kubectl" length="short" >}}
22-
-->
20+
2321
{{< glossary_definition prepend="Kubernetes 提供" term_id="kubectl" length="short" >}}
2422

2523
<!--
@@ -143,10 +141,10 @@ for example `create`, `get`, `describe`, `delete`.
143141
* `flags`: 指定可选的参数。例如,可以使用 `-s``--server` 参数指定
144142
Kubernetes API 服务器的地址和端口。
145143

144+
{{< caution >}}
146145
<!--
147146
Flags that you specify from the command line override default values and any corresponding environment variables.
148147
-->
149-
{{< caution >}}
150148
从命令行指定的参数会覆盖默认值和任何相应的环境变量。
151149
{{< /caution >}}
152150

@@ -267,6 +265,7 @@ Operation | Syntax | Description
267265
`diff` | `kubectl diff -f FILENAME [flags]`| Diff file or stdin against live configuration.
268266
`drain` | `kubectl drain NODE [options]` | Drain node in preparation for maintenance.
269267
`edit` | <code>kubectl edit (-f FILENAME &#124; TYPE NAME &#124; TYPE/NAME) [flags]</code> | Edit and update the definition of one or more resources on the server by using the default editor.
268+
`events` | `kubectl events` | List events
270269
`exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | Execute a command against a container in a pod.
271270
`explain` | `kubectl explain [--recursive=false] [flags]` | Get documentation of various resources. For instance pods, nodes, services, etc.
272271
`expose` | <code>kubectl expose (-f FILENAME &#124; TYPE NAME &#124; TYPE/NAME) [--port=port] [--protocol=TCP&#124;UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [flags]</code> | Expose a replication controller, service, or pod as a new Kubernetes service.
@@ -313,6 +312,7 @@ Operation | Syntax | Description
313312
`diff` | `kubectl diff -f FILENAME [flags]`| 在当前起作用的配置和文件或标准输之间作对比 (**BETA**)
314313
`drain` | `kubectl drain NODE [options]` | 腾空节点以准备维护。
315314
`edit` | <code>kubectl edit (-f FILENAME &#124; TYPE NAME &#124; TYPE/NAME) [flags]</code> | 使用默认编辑器编辑和更新服务器上一个或多个资源的定义。
315+
`events` | `kubectl events` | 列举事件。
316316
`exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | 对 Pod 中的容器执行命令。
317317
`explain` | `kubectl explain [--recursive=false] [flags]` | 获取多种资源的文档。例如 Pod、Node、Service 等。
318318
`expose` | <code>kubectl expose (-f FILENAME &#124; TYPE NAME &#124; TYPE/NAME) [--port=port] [--protocol=TCP&#124;UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [flags]</code> | 将副本控制器、服务或 Pod 作为新的 Kubernetes 服务暴露。
@@ -549,7 +549,7 @@ The result of running either command is similar to:
549549
-->
550550
运行这两个命令之一的结果类似于:
551551

552-
```shell
552+
```
553553
NAME RSRC
554554
submit-queue 610995
555555
```
@@ -593,7 +593,7 @@ The output is similar to:
593593
-->
594594
输出类似于:
595595

596-
```shell
596+
```
597597
NAME AGE
598598
pod-name 1m
599599
```
@@ -788,7 +788,6 @@ kubectl delete pods,services -l <label-key>=<label-value>
788788
# Delete all pods, including uninitialized ones.
789789
kubectl delete pods --all
790790
```
791-
792791
-->
793792

794793
```shell
@@ -874,7 +873,6 @@ cat service.yaml | kubectl diff -f -
874873
<!--
875874
## Examples: Creating and using plugins
876875
-->
877-
878876
## 示例:创建和使用插件
879877

880878
<!--
@@ -925,10 +923,8 @@ sudo chown root:root /usr/local/bin
925923
kubectl hello
926924
```
927925
-->
928-
929926
这个插件写好了,把它变成可执行的:
930927
```bash
931-
932928
sudo chmod a+x ./kubectl-hello
933929

934930
# 并将其移动到路径中的某个位置

0 commit comments

Comments
 (0)