diff --git a/content/zh/docs/tasks/debug/debug-application/get-shell-running-container.md b/content/zh/docs/tasks/debug/debug-application/get-shell-running-container.md index e67d6b1859..c65d3951b9 100644 --- a/content/zh/docs/tasks/debug/debug-application/get-shell-running-container.md +++ b/content/zh/docs/tasks/debug/debug-application/get-shell-running-container.md @@ -20,14 +20,12 @@ running Container. - ## 获取容器的 Shell - 在本练习中,你将创建包含一个容器的 Pod。容器运行 nginx 镜像。下面是 Pod 的配置文件: {{< codenew file="application/shell-demo.yaml" >}} @@ -35,7 +33,6 @@ runs the nginx image. Here is the configuration file for the Pod: - 创建 Pod: ```shell @@ -45,7 +42,6 @@ kubectl create -f https://k8s.io/examples/application/shell-demo.yaml - 检查容器是否运行正常: ```shell @@ -55,7 +51,6 @@ kubectl get pod shell-demo - 获取正在运行容器的 Shell: ```shell @@ -72,7 +67,6 @@ The double dash symbol "--" is used to separate the arguments you want to pass t - 在 shell 中,打印根目录: ```shell @@ -83,7 +77,6 @@ root@shell-demo:/# ls / In your shell, experiment with other commands. Here are some examples: --> - 在 shell 中,实验其他命令。下面是一些示例: ```shell @@ -103,7 +96,6 @@ root@shell-demo:/# ps aux | grep nginx - ## 编写 nginx 的根页面 - -在看一下 Pod 的配置文件。该 Pod 有个 `emptyDir` 卷,容器将该卷挂载到了 `/usr/share/nginx/html`。 +再看一下 Pod 的配置文件。该 Pod 有个 `emptyDir` 卷,容器将该卷挂载到了 `/usr/share/nginx/html`。 - 在 shell 中,在 `/usr/share/nginx/html` 目录创建一个 `index.html` 文件: ```shell @@ -128,7 +118,6 @@ root@shell-demo:/# echo Hello shell demo > /usr/share/nginx/html/index.html - 在 shell 中,向 nginx 服务器发送 GET 请求: ```shell @@ -140,7 +129,6 @@ root@shell-demo:/# curl localhost - 输出结果显示了你在 `index.html` 中写入的文本。 ```shell @@ -150,20 +138,17 @@ Hello shell demo - 当用完 shell 后,输入 `exit` 退出。 - ## 在容器中运行单个命令 - 在普通的命令窗口(而不是 shell)中,打印环境运行容器中的变量: ```shell @@ -173,7 +158,6 @@ kubectl exec shell-demo env - 实验运行其他命令。下面是一些示例: ```shell @@ -187,7 +171,6 @@ kubectl exec shell-demo cat /proc/1/mounts - ## 当 Pod 包含多个容器时打开 shell - 如果 Pod 有多个容器,`--container` 或者 `-c` 可以在 `kubectl exec` 命令中指定容器。 -例如,您有个名为 my-pod 的容器,该 Pod 有两个容器分别为 main-app 和 healper-app。 +例如,你有个名为 my-pod 的 Pod,该 Pod 有两个容器分别为 main-app 和 healper-app。 下面的命令将会打开一个 shell 访问 main-app 容器。 ```shell