Skip to content

Commit 82dbefc

Browse files
committed
Make layout prettier in /configure-volume-storage.md
1 parent ef18ad6 commit 82dbefc

File tree

1 file changed

+63
-74
lines changed

1 file changed

+63
-74
lines changed

content/en/docs/tasks/configure-pod-container/configure-volume-storage.md

Lines changed: 63 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,12 @@ A Container's file system lives only as long as the Container does. So when a
1212
Container terminates and restarts, filesystem changes are lost. For more
1313
consistent storage that is independent of the Container, you can use a
1414
[Volume](/docs/concepts/storage/volumes/). This is especially important for stateful
15-
applications, such as key-value stores (such as Redis) and databases.
16-
17-
15+
applications, such as key-value stores (such as Redis) and databases.
1816

1917
## {{% heading "prerequisites" %}}
2018

21-
2219
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2320

24-
25-
2621
<!-- steps -->
2722

2823
## Configure a volume for a Pod
@@ -37,71 +32,71 @@ restarts. Here is the configuration file for the Pod:
3732

3833
1. Create the Pod:
3934

40-
```shell
41-
kubectl apply -f https://k8s.io/examples/pods/storage/redis.yaml
42-
```
35+
```shell
36+
kubectl apply -f https://k8s.io/examples/pods/storage/redis.yaml
37+
```
4338

4439
1. Verify that the Pod's Container is running, and then watch for changes to
45-
the Pod:
40+
the Pod:
41+
42+
```shell
43+
kubectl get pod redis --watch
44+
```
4645

47-
```shell
48-
kubectl get pod redis --watch
49-
```
50-
51-
The output looks like this:
46+
The output looks like this:
5247

53-
```shell
54-
NAME READY STATUS RESTARTS AGE
55-
redis 1/1 Running 0 13s
56-
```
48+
```shell
49+
NAME READY STATUS RESTARTS AGE
50+
redis 1/1 Running 0 13s
51+
```
5752

5853
1. In another terminal, get a shell to the running Container:
5954

60-
```shell
61-
kubectl exec -it redis -- /bin/bash
62-
```
55+
```shell
56+
kubectl exec -it redis -- /bin/bash
57+
```
6358

6459
1. In your shell, go to `/data/redis`, and then create a file:
6560

66-
```shell
67-
root@redis:/data# cd /data/redis/
68-
root@redis:/data/redis# echo Hello > test-file
69-
```
61+
```shell
62+
root@redis:/data# cd /data/redis/
63+
root@redis:/data/redis# echo Hello > test-file
64+
```
7065

7166
1. In your shell, list the running processes:
7267

73-
```shell
74-
root@redis:/data/redis# apt-get update
75-
root@redis:/data/redis# apt-get install procps
76-
root@redis:/data/redis# ps aux
77-
```
68+
```shell
69+
root@redis:/data/redis# apt-get update
70+
root@redis:/data/redis# apt-get install procps
71+
root@redis:/data/redis# ps aux
72+
```
7873

79-
The output is similar to this:
74+
The output is similar to this:
8075

81-
```shell
82-
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
83-
redis 1 0.1 0.1 33308 3828 ? Ssl 00:46 0:00 redis-server *:6379
84-
root 12 0.0 0.0 20228 3020 ? Ss 00:47 0:00 /bin/bash
85-
root 15 0.0 0.0 17500 2072 ? R+ 00:48 0:00 ps aux
86-
```
76+
```shell
77+
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
78+
redis 1 0.1 0.1 33308 3828 ? Ssl 00:46 0:00 redis-server *:6379
79+
root 12 0.0 0.0 20228 3020 ? Ss 00:47 0:00 /bin/bash
80+
root 15 0.0 0.0 17500 2072 ? R+ 00:48 0:00 ps aux
81+
```
8782

8883
1. In your shell, kill the Redis process:
8984

90-
```shell
91-
root@redis:/data/redis# kill <pid>
92-
```
85+
```shell
86+
root@redis:/data/redis# kill <pid>
87+
```
9388

94-
where `<pid>` is the Redis process ID (PID).
89+
where `<pid>` is the Redis process ID (PID).
9590

9691
1. In your original terminal, watch for changes to the Redis Pod. Eventually,
97-
you will see something like this:
92+
you will see something like this:
9893

99-
```shell
100-
NAME READY STATUS RESTARTS AGE
101-
redis 1/1 Running 0 13s
102-
redis 0/1 Completed 0 6m
103-
redis 1/1 Running 1 6m
104-
```
94+
```shell
95+
NAME READY STATUS RESTARTS AGE
96+
redis 1/1 Running 0 13s
97+
redis 0/1 Completed 0 6m
98+
redis 1/1 Running 1 6m
99+
```
105100

106101
At this point, the Container has terminated and restarted. This is because the
107102
Redis Pod has a
@@ -110,38 +105,32 @@ of `Always`.
110105

111106
1. Get a shell into the restarted Container:
112107

113-
```shell
114-
kubectl exec -it redis -- /bin/bash
115-
```
108+
```shell
109+
kubectl exec -it redis -- /bin/bash
110+
```
116111

117112
1. In your shell, go to `/data/redis`, and verify that `test-file` is still there.
118-
```shell
119-
root@redis:/data/redis# cd /data/redis/
120-
root@redis:/data/redis# ls
121-
test-file
122-
```
123-
124-
1. Delete the Pod that you created for this exercise:
125113

126-
```shell
127-
kubectl delete pod redis
128-
```
114+
```shell
115+
root@redis:/data/redis# cd /data/redis/
116+
root@redis:/data/redis# ls
117+
test-file
118+
```
129119

120+
1. Delete the Pod that you created for this exercise:
130121

122+
```shell
123+
kubectl delete pod redis
124+
```
131125

132126
## {{% heading "whatsnext" %}}
133127

128+
- See [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core).
134129

135-
* See [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core).
136-
137-
* See [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core).
138-
139-
* In addition to the local disk storage provided by `emptyDir`, Kubernetes
140-
supports many different network-attached storage solutions, including PD on
141-
GCE and EBS on EC2, which are preferred for critical data and will handle
142-
details such as mounting and unmounting the devices on the nodes. See
143-
[Volumes](/docs/concepts/storage/volumes/) for more details.
144-
145-
146-
130+
- See [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core).
147131

132+
- In addition to the local disk storage provided by `emptyDir`, Kubernetes
133+
supports many different network-attached storage solutions, including PD on
134+
GCE and EBS on EC2, which are preferred for critical data and will handle
135+
details such as mounting and unmounting the devices on the nodes. See
136+
[Volumes](/docs/concepts/storage/volumes/) for more details.

0 commit comments

Comments
 (0)