@@ -42,7 +42,7 @@ This page contains a list of commonly used `kubectl` commands and flags.
4242
4343<!--
4444```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.
4646echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell.
4747```
4848
@@ -64,7 +64,7 @@ complete -o default -F __start_kubectl k
6464
6565<!--
6666```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
6868echo '[[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~/.zshrc # add autocomplete permanently to your zsh shell
6969```
7070-->
@@ -74,9 +74,9 @@ echo '[[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~/.zshrc
7474```
7575
7676<!--
77- ### A Note on --all-namespaces
77+ ### A Note on ` --all-namespaces`
7878-->
79- ### 关于 --all-namespaces 的一点说明 {#a-note-on-all-namespaces}
79+ ### 关于 ` --all-namespaces ` 的一点说明 {#a-note-on-all-namespaces}
8080
8181<!--
8282Appending `--all-namespaces` happens frequently enough where you should be aware of the shorthand for `--all-namespaces`:
312312```
313313
314314<!--
315- ## Viewing, finding resources
315+ ## Viewing and finding resources
316316-->
317317## 查看和查找资源 {#viewing-finding-resources}
318318
@@ -514,6 +514,7 @@ kubectl expose rc nginx --port=80 --target-port=8000
514514kubectl get pod mypod -o yaml | sed 's/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
515515
516516kubectl label pods my-pod new-label=awesome # Add a Label
517+ kubectl label pods my-pod new-label- # Remove a label
517518kubectl annotate pods my-pod icon-url=http://goo.gl/XXBTWq # Add an annotation
518519kubectl autoscale deployment foo --min=2 --max=10 # Auto scale a deployment "foo"
519520```
@@ -538,6 +539,7 @@ kubectl expose rc nginx --port=80 --target-port=8000
538539kubectl get pod mypod -o yaml | sed ' s/\(image: myimage\):.*$/\1:v4/' | kubectl replace -f -
539540
540541kubectl label pods my-pod new-label=awesome # 添加标签
542+ kubectl label pods my-pod new-label- # 移除标签
541543kubectl annotate pods my-pod icon-url=http://goo.gl/XXBTWq # 添加注解
542544kubectl autoscale deployment foo --min=2 --max=10 # 对 "foo" Deployment 自动伸缩容
543545```
@@ -706,7 +708,7 @@ kubectl top pod POD_NAME --sort-by=cpu # 显示给定 Pod 的指标
706708```
707709
708710<!--
709- ## Copy files and directories to and from containers
711+ ## Copying files and directories to and from containers
710712-->
711713## 从容器中复制文件和目录 {#copy-files-and-directories-to-and-from-containers}
712714
@@ -727,7 +729,7 @@ kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # 将 /tmp/foo 从远程
727729
728730{{< note >}}
729731<!--
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.
731733For advanced use cases, such as symlinks, wildcard expansion or file mode preservation consider using `kubectl exec`.
732734-->
733735` kubectl cp ` 要求容器镜像中存在 “tar” 二进制文件。如果 “tar” 不存在,` kubectl cp ` 将失败。
0 commit comments