From a5ceee0679c98adf8b776098380523d154b46d20 Mon Sep 17 00:00:00 2001 From: SataQiu <1527062125@qq.com> Date: Fri, 21 Dec 2018 22:33:23 +0800 Subject: [PATCH] zh-trans: update docs/tasks/configure-pod-container/configure-volume-storage.md (#11841) --- .../configure-volume-storage.md | 71 +++++++++---------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/content/zh/docs/tasks/configure-pod-container/configure-volume-storage.md b/content/zh/docs/tasks/configure-pod-container/configure-volume-storage.md index 5dd4828c10..8d5395f68c 100644 --- a/content/zh/docs/tasks/configure-pod-container/configure-volume-storage.md +++ b/content/zh/docs/tasks/configure-pod-container/configure-volume-storage.md @@ -55,20 +55,18 @@ restarts. Here is the configuration file for the Pod: {{< codenew file="pods/storage/redis.yaml" >}} 1. 创建 Pod: - - + ```shell kubectl create -f https://k8s.io/examples/pods/storage/redis.yaml ``` 1. 验证 Pod 中的容器是否正在运行,然后留意 Pod 的更改: - - + ```shell kubectl get pod redis --watch ``` @@ -81,29 +79,26 @@ the Pod: ``` 1. 在另一个终端,用 shell 连接正在运行的容器: - - + ```shell kubectl exec -it redis -- /bin/bash ``` 1. 在您的 shell 终端中,切换到 `/data/redis` 目录下,然后创建一个文件: - - + ```shell root@redis:/data# cd /data/redis/ root@redis:/data/redis# echo Hello > test-file ``` 1. 在您的 shell 终端中,列出正在运行的进程: - - + ```shell root@redis:/data/redis# apt-get update root@redis:/data/redis# apt-get install procps @@ -120,10 +115,9 @@ the Pod: ``` 1. 在您的 shell 终端中,结束 Redis 进程: - - + ```shell root@redis:/data/redis# kill ``` @@ -131,11 +125,10 @@ the Pod: 其中 `` 是 Redis 进程的 ID (PID)。 1. 在您原先终端中,留意 Redis Pod 的更改。最终您将会看到和下面类似的输出: - - + ```shell NAME READY STATUS RESTARTS AGE redis 1/1 Running 0 13s @@ -153,18 +146,18 @@ of `Always`. --> 1. 用 shell 终端进入重新启动的容器中: - + ```shell kubectl exec -it redis -- /bin/bash ``` 1. 在您的 shell 终端中,进入到 `/data/redis` 目录下,并确认 `test-file` 文件是否仍然存在。 - + ```shell root@redis:/data/redis# cd /data/redis/ root@redis:/data/redis# ls @@ -173,9 +166,9 @@ of `Always`. 1. 删除为此练习所创建的 Pod: - + ```shell kubectl delete pod redis ```