Skip to content

Commit a819c51

Browse files
author
Chris Short
committed
Update static-pod.md
- Fixed brain flatuence around which runtime I was testing - Outputs changed - Noted added about crictl ps's default behavior of outputting sha256sum in image name - Image name in outputs have been shortened per Slack convo https://kubernetes.slack.com/archives/C02PZMA3R6E/p1643026840047600
1 parent d158cdf commit a819c51

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

content/en/docs/tasks/configure-pod-container/static-pod.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The `spec` of a static Pod cannot refer to other API objects
4242

4343
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
4444

45-
This page assumes you're using {{< glossary_tooltip term_id="containerd" >}} to run Pods,
45+
This page assumes you're using {{< glossary_tooltip term_id="cri-o" >}} to run Pods,
4646
and that your nodes are running the Fedora operating system.
4747
Instructions for other distributions or Kubernetes installations may vary.
4848

@@ -162,18 +162,20 @@ crictl ps
162162
The output might be something like:
163163
164164
```
165-
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
166-
f6d05272b57e nginx:latest "nginx" 8 minutes ago Up 8 minutes k8s_web.6f802af4_static-web-fk-node1_default_67e24ed9466ba55986d120c867395f3c_378e5f3c
165+
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
166+
129fd7d382018 docker.io/library/nginx@sha256:... 11 minutes ago Running web 0 34533c6729106
167167
```
168168
169+
Note: `crictl` outputs the image URI and SHA-256 checksum. `NAME` will look more like: `docker.io/library/nginx@sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31`.
170+
169171
You can see the mirror Pod on the API server:
170172
171173
```shell
172174
kubectl get pods
173175
```
174176
```
175-
NAME READY STATUS RESTARTS AGE
176-
static-web-my-node1 1/1 Running 0 2m
177+
NAME READY STATUS RESTARTS AGE
178+
static-web 1/1 Running 0 2m
177179
```
178180
179181
{{< note >}}
@@ -190,18 +192,18 @@ If you try to use `kubectl` to delete the mirror Pod from the API server,
190192
the kubelet _doesn't_ remove the static Pod:
191193
192194
```shell
193-
kubectl delete pod static-web-my-node1
195+
kubectl delete pod static-web
194196
```
195197
```
196-
pod "static-web-my-node1" deleted
198+
pod "static-web" deleted
197199
```
198200
You can see that the Pod is still running:
199201
```shell
200202
kubectl get pods
201203
```
202204
```
203-
NAME READY STATUS RESTARTS AGE
204-
static-web-my-node1 1/1 Running 0 12s
205+
NAME READY STATUS RESTARTS AGE
206+
static-web 1/1 Running 0 4s
205207
```
206208
207209
Back on your node where the kubelet is running, you can try to stop the container manually.
@@ -210,13 +212,13 @@ automatically:
210212
211213
```shell
212214
# Run these commands on the node where the kubelet is running
213-
crictl stop f6d05272b57e # replace with the ID of your container
215+
crictl stop 129fd7d382018 # replace with the ID of your container
214216
sleep 20
215217
crictl ps
216218
```
217219
```
218-
CONTAINER ID IMAGE COMMAND CREATED ...
219-
5b920cbaf8b1 nginx:latest "nginx -g 'daemon of 2 seconds ago ...
220+
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
221+
89db4553e1eeb docker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
220222
```
221223
222224
## Dynamic addition and removal of static pods
@@ -236,7 +238,6 @@ sleep 20
236238
crictl ps
237239
```
238240
```
239-
CONTAINER ID IMAGE COMMAND CREATED ...
240-
e7a62e3427f1 nginx:latest "nginx -g 'daemon of 27 seconds ago
241+
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
242+
f427638871c35 docker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
241243
```
242-

0 commit comments

Comments
 (0)