ZH-trans: update docker-cli-to-kubectl.md (#13197)
* Update docker-cli-to-kubectl.md * Update docker-cli-to-kubectl.md * Update docker-cli-to-kubectl.md * Update docker-cli-to-kubectl.md * Update docker-cli-to-kubectl.md
This commit is contained in:
parent
2354526fe4
commit
ed359861fa
|
@ -26,8 +26,12 @@ a9ec34d98787 nginx "nginx -g 'daemon of 2 seconds ago
|
|||
|
||||
使用 kubectl 命令:
|
||||
|
||||
```shell
|
||||
<!--
|
||||
# start the pod running nginx
|
||||
-->
|
||||
|
||||
```shell
|
||||
# 启动运行 nginx 的 pod
|
||||
$ kubectl run --image=nginx nginx-app --port=80 --env="DOMAIN=cluster"
|
||||
deployment "nginx-app" created
|
||||
```
|
||||
|
@ -35,8 +39,12 @@ deployment "nginx-app" created
|
|||
在 1.2 及以上版本的 Kubernetes 集群中,使用`kubectl run` 命令将创建一个名为 "nginx-app" 的 Deployment。如果您运行的是老版本,将会创建一个 replication controller。
|
||||
如果您想沿用旧的行为,使用 `--generation=run/v1` 参数,这样就会创建 replication controller。查看 [`kubectl run`](/docs/reference/generated/kubectl/kubectl-commands/#run) 获取更多详细信息。
|
||||
|
||||
```shell
|
||||
<!--
|
||||
# expose a port through with a service
|
||||
-->
|
||||
|
||||
```shell
|
||||
# 通过服务暴露端口
|
||||
$ kubectl expose deployment nginx-app --port=80 --name=nginx-http
|
||||
service "nginx-http" exposed
|
||||
```
|
||||
|
@ -172,6 +180,7 @@ $ kubectl logs --previous nginx-app-zibvs
|
|||
|
||||
#### docker stop 和 docker rm
|
||||
|
||||
|
||||
如何停止和删除运行中的进程?查看 [kubectl delete](/docs/reference/generated/kubectl/kubectl-commands/#delete)。
|
||||
|
||||
使用 docker 命令:
|
||||
|
|
Loading…
Reference in New Issue