@@ -31,7 +31,6 @@ applications, such as key-value stores (such as Redis) and databases.
31
31
32
32
<!-- steps -->
33
33
34
-
35
34
<!--
36
35
## Configure a volume for a Pod
37
36
@@ -59,25 +58,30 @@ restarts. Here is the configuration file for the Pod:
59
58
```
60
59
61
60
<!--
62
- 1.Verify that the Pod's Container is running, and then watch for changes to the Pod:
61
+ 1. Verify that the Pod's Container is running, and then watch for changes to
62
+ the Pod:
63
63
-->
64
64
2 . 验证 Pod 中的容器是否正在运行,然后留意 Pod 的更改:
65
65
66
66
``` shell
67
67
kubectl get pod redis --watch
68
68
```
69
69
70
+ <!--
71
+ The output looks like this:
72
+ -->
73
+
70
74
输出如下:
71
75
72
- ``` shell
76
+ ``` console
73
77
NAME READY STATUS RESTARTS AGE
74
78
redis 1/1 Running 0 13s
75
79
```
76
80
77
81
<!--
78
- 1.In another terminal, get a shell to the running Container:
82
+ 1. In another terminal, get a shell to the running Container:
79
83
-->
80
- 3 . 在另一个终端,用 shell 连接正在运行的容器:
84
+ 3 . 在另一个终端,用 Shell 连接正在运行的容器:
81
85
82
86
``` shell
83
87
kubectl exec -it redis -- /bin/bash
@@ -86,15 +90,15 @@ restarts. Here is the configuration file for the Pod:
86
90
<!--
87
91
1.In your shell, go to `/data/redis`, and then create a file:
88
92
-->
89
- 4 . 在你的 Shell中 ,切换到 ` /data/redis ` 目录下,然后创建一个文件:
93
+ 4 . 在你的 Shell 中 ,切换到 ` /data/redis ` 目录下,然后创建一个文件:
90
94
91
95
``` shell
92
96
root@redis:/data# cd /data/redis/
93
97
root@redis:/data/redis# echo Hello > test-file
94
98
```
95
99
96
100
<!--
97
- 1.In your shell, list the running processes:
101
+ 1. In your shell, list the running processes:
98
102
-->
99
103
5 . 在你的 Shell 中,列出正在运行的进程:
100
104
@@ -104,33 +108,41 @@ restarts. Here is the configuration file for the Pod:
104
108
root@redis:/data/redis# ps aux
105
109
```
106
110
111
+ <!--
112
+ The output is similar to this:
113
+ -->
114
+
107
115
输出类似于:
108
116
109
- ``` shell
117
+ ``` console
110
118
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
111
119
redis 1 0.1 0.1 33308 3828 ? Ssl 00:46 0:00 redis-server *:6379
112
120
root 12 0.0 0.0 20228 3020 ? Ss 00:47 0:00 /bin/bash
113
121
root 15 0.0 0.0 17500 2072 ? R+ 00:48 0:00 ps aux
114
122
```
115
123
116
124
<!--
117
- 1.In your shell, kill the Redis process:
125
+ 1. In your shell, kill the Redis process:
118
126
-->
119
127
6 . 在你的 Shell 中,结束 Redis 进程:
120
128
121
129
``` shell
122
130
root@redis:/data/redis# kill < pid>
123
131
```
124
132
133
+ <!--
134
+ where `<pid>` is the Redis process ID (PID).
135
+ -->
136
+
125
137
其中 ` <pid> ` 是 Redis 进程的 ID (PID)。
126
138
127
139
<!--
128
140
1. In your original terminal, watch for changes to the Redis Pod. Eventually,
129
- you will see something like this:
141
+ you will see something like this:
130
142
-->
131
143
7 . 在你原先终端中,留意 Redis Pod 的更改。最终你将会看到和下面类似的输出:
132
144
133
- ``` shell
145
+ ``` console
134
146
NAME READY STATUS RESTARTS AGE
135
147
redis 1/1 Running 0 13s
136
148
redis 0/1 Completed 0 6m
@@ -148,7 +160,7 @@ of `Always`.
148
160
为 ` Always ` 。
149
161
150
162
<!--
151
- 1.Get a shell into the restarted Container:
163
+ 1. Get a shell into the restarted Container:
152
164
-->
153
165
1 . 用 Shell 进入重新启动的容器中:
154
166
@@ -157,7 +169,7 @@ of `Always`.
157
169
```
158
170
159
171
<!--
160
- 1.In your shell, goto `/data/redis`, and verify that `test-file` is still there.
172
+ 1. In your shell, go to `/data/redis`, and verify that `test-file` is still there.
161
173
-->
162
174
2 . 在你的 Shell 中,进入到 ` /data/redis ` 目录下,并确认 ` test-file ` 文件是否仍然存在。
163
175
@@ -168,7 +180,7 @@ of `Always`.
168
180
```
169
181
170
182
<!--
171
- 1.Delete the Pod that you created for this exercise:
183
+ 1. Delete the Pod that you created for this exercise:
172
184
-->
173
185
3 . 删除为此练习所创建的 Pod:
174
186
@@ -179,19 +191,19 @@ of `Always`.
179
191
## {{% heading "whatsnext" %}}
180
192
181
193
<!--
182
- * See [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core).
194
+ - See [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core).
183
195
184
- * See [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core).
196
+ - See [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core).
185
197
186
- * In addition to the local disk storage provided by `emptyDir`, Kubernetes
187
- supports many different network-attached storage solutions, including PD on
188
- GCE and EBS on EC2, which are preferred for critical data and will handle
189
- details such as mounting and unmounting the devices on the nodes. See
190
- [Volumes](/docs/concepts/storage/volumes/) for more details.
198
+ - In addition to the local disk storage provided by `emptyDir`, Kubernetes
199
+ supports many different network-attached storage solutions, including PD on
200
+ GCE and EBS on EC2, which are preferred for critical data and will handle
201
+ details such as mounting and unmounting the devices on the nodes. See
202
+ [Volumes](/docs/concepts/storage/volumes/) for more details.
191
203
-->
192
- * 参阅 [ Volume] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)。
193
- * 参阅 [ Pod] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)。
194
- * 除了 ` emptyDir ` 提供的本地磁盘存储外,Kubernetes 还支持许多不同的网络附加存储解决方案,
204
+ - 参阅 [ Volume] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)。
205
+ - 参阅 [ Pod] (/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)。
206
+ - 除了 ` emptyDir ` 提供的本地磁盘存储外,Kubernetes 还支持许多不同的网络附加存储解决方案,
195
207
包括 GCE 上的 PD 和 EC2 上的 EBS,它们是关键数据的首选,并将处理节点上的一些细节,
196
208
例如安装和卸载设备。了解更多详情请参阅[ 卷] ( /zh-cn/docs/concepts/storage/volumes/ ) 。
197
209
0 commit comments