Skip to content

Commit a02f578

Browse files
committed
Fix issues in configure-volume-storage
* ps command not found * wrong code format
1 parent e8d351b commit a02f578

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

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

+20-18
Original file line numberDiff line numberDiff line change
@@ -37,51 +37,53 @@ restarts. Here is the configuration file for the Pod:
3737

3838
1. Create the Pod:
3939

40-
kubectl create -f https://k8s.io/examples/pods/storage/redis.yaml
40+
kubectl create -f https://k8s.io/examples/pods/storage/redis.yaml
4141

4242
1. Verify that the Pod's Container is running, and then watch for changes to
4343
the Pod:
4444

45-
kubectl get pod redis --watch
45+
kubectl get pod redis --watch
4646

4747
The output looks like this:
4848

49-
NAME READY STATUS RESTARTS AGE
50-
redis 1/1 Running 0 13s
49+
NAME READY STATUS RESTARTS AGE
50+
redis 1/1 Running 0 13s
5151

5252
1. In another terminal, get a shell to the running Container:
5353

54-
kubectl exec -it redis -- /bin/bash
54+
kubectl exec -it redis -- /bin/bash
5555

5656
1. In your shell, go to `/data/redis`, and create a file:
5757

58-
root@redis:/data# cd /data/redis/
59-
root@redis:/data/redis# echo Hello > test-file
58+
root@redis:/data# cd /data/redis/
59+
root@redis:/data/redis# echo Hello > test-file
6060

6161
1. In your shell, list the running processes:
6262

63-
root@redis:/data/redis# ps aux
63+
root@redis:/data/redis# apt-get update
64+
root@redis:/data/redis# apt-get install procps
65+
root@redis:/data/redis# ps aux
6466

6567
The output is similar to this:
6668

67-
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
68-
redis 1 0.1 0.1 33308 3828 ? Ssl 00:46 0:00 redis-server *:6379
69-
root 12 0.0 0.0 20228 3020 ? Ss 00:47 0:00 /bin/bash
70-
root 15 0.0 0.0 17500 2072 ? R+ 00:48 0:00 ps aux
69+
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
70+
redis 1 0.1 0.1 33308 3828 ? Ssl 00:46 0:00 redis-server *:6379
71+
root 12 0.0 0.0 20228 3020 ? Ss 00:47 0:00 /bin/bash
72+
root 15 0.0 0.0 17500 2072 ? R+ 00:48 0:00 ps aux
7173

7274
1. In your shell, kill the redis process:
7375

74-
root@redis:/data/redis# kill <pid>
76+
root@redis:/data/redis# kill <pid>
7577

7678
where `<pid>` is the redis process ID (PID).
7779

7880
1. In your original terminal, watch for changes to the redis Pod. Eventually,
7981
you will see something like this:
8082

81-
NAME READY STATUS RESTARTS AGE
82-
redis 1/1 Running 0 13s
83-
redis 0/1 Completed 0 6m
84-
redis 1/1 Running 1 6m
83+
NAME READY STATUS RESTARTS AGE
84+
redis 1/1 Running 0 13s
85+
redis 0/1 Completed 0 6m
86+
redis 1/1 Running 1 6m
8587

8688
At this point, the Container has terminated and restarted. This is because the
8789
redis Pod has a
@@ -90,7 +92,7 @@ of `Always`.
9092

9193
1. Get a shell into the restarted Container:
9294

93-
kubectl exec -it redis -- /bin/bash
95+
kubectl exec -it redis -- /bin/bash
9496

9597
1. In your shell, goto `/data/redis`, and verify that `test-file` is still there.
9698

0 commit comments

Comments
 (0)