@@ -42,7 +42,7 @@ This page contains a list of commonly used `kubectl` commands and flags.
42
42
43
43
<!--
44
44
```bash
45
- source <(kubectl completion bash) # setup autocomplete in bash into the current shell, bash-completion package should be installed first.
45
+ source <(kubectl completion bash) # set up autocomplete in bash into the current shell, bash-completion package should be installed first.
46
46
echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
47
47
```
48
48
@@ -64,7 +64,7 @@ complete -o default -F __start_kubectl k
64
64
65
65
<!--
66
66
```bash
67
- source <(kubectl completion zsh) # setup autocomplete in zsh into the current shell
67
+ source <(kubectl completion zsh) # set up autocomplete in zsh into the current shell
68
68
echo '[[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~/.zshrc # add autocomplete permanently to your zsh shell
69
69
```
70
70
-->
@@ -74,9 +74,9 @@ echo '[[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~/.zshrc
74
74
```
75
75
76
76
<!--
77
- ### A Note on --all-namespaces
77
+ ### A Note on ` --all-namespaces`
78
78
-->
79
- ### 关于 --all-namespaces 的一点说明 {#a-note-on-all-namespaces}
79
+ ### 关于 ` --all-namespaces ` 的一点说明 {#a-note-on-all-namespaces}
80
80
81
81
<!--
82
82
Appending `--all-namespaces` happens frequently enough where you should be aware of the shorthand for `--all-namespaces`:
312
312
```
313
313
314
314
<!--
315
- ## Viewing, finding resources
315
+ ## Viewing and finding resources
316
316
-->
317
317
## 查看和查找资源 {#viewing-finding-resources}
318
318
@@ -514,6 +514,7 @@ kubectl expose rc nginx --port=80 --target-port=8000
514
514
kubectl get pod mypod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
515
515
516
516
kubectl label pods my-pod new-label=awesome # Add a Label
517
+ kubectl label pods my-pod new-label- # Remove a label
517
518
kubectl annotate pods my-pod icon-url=http://goo.gl/XXBTWq # Add an annotation
518
519
kubectl autoscale deployment foo --min=2 --max=10 # Auto scale a deployment "foo"
519
520
```
@@ -538,6 +539,7 @@ kubectl expose rc nginx --port=80 --target-port=8000
538
539
kubectl get pod mypod -o yaml | sed ' s/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
539
540
540
541
kubectl label pods my-pod new-label=awesome # 添加标签
542
+ kubectl label pods my-pod new-label- # 移除标签
541
543
kubectl annotate pods my-pod icon-url=http://goo.gl/XXBTWq # 添加注解
542
544
kubectl autoscale deployment foo --min=2 --max=10 # 对 "foo" Deployment 自动伸缩容
543
545
```
@@ -706,7 +708,7 @@ kubectl top pod POD_NAME --sort-by=cpu # 显示给定 Pod 的指标
706
708
```
707
709
708
710
<!--
709
- ## Copy files and directories to and from containers
711
+ ## Copying files and directories to and from containers
710
712
-->
711
713
## 从容器中复制文件和目录 {#copy-files-and-directories-to-and-from-containers}
712
714
@@ -727,7 +729,7 @@ kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # 将 /tmp/foo 从远程
727
729
728
730
{{< note >}}
729
731
<!--
730
- `kubectl cp` requires that the 'tar' binary is present in your container image. If 'tar' is not present,`kubectl cp` will fail.
732
+ `kubectl cp` requires that the 'tar' binary is present in your container image. If 'tar' is not present, `kubectl cp` will fail.
731
733
For advanced use cases, such as symlinks, wildcard expansion or file mode preservation consider using `kubectl exec`.
732
734
-->
733
735
` kubectl cp ` 要求容器镜像中存在 “tar” 二进制文件。如果 “tar” 不存在,` kubectl cp ` 将失败。
0 commit comments