You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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
Copy file name to clipboardExpand all lines: content/en/docs/tasks/configure-pod-container/static-pod.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ The `spec` of a static Pod cannot refer to other API objects
42
42
43
43
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
44
44
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,
46
46
and that your nodes are running the Fedora operating system.
47
47
Instructions for other distributions or Kubernetes installations may vary.
48
48
@@ -162,18 +162,20 @@ crictl ps
162
162
The output might be something like:
163
163
164
164
```
165
-
CONTAINER ID IMAGE COMMAND CREATED STATUSPORTSNAMES
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 Runningweb 0 34533c6729106
167
167
```
168
168
169
+
Note: `crictl` outputs the image URI and SHA-256 checksum. `NAME` will look more like: `docker.io/library/nginx@sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31`.
170
+
169
171
You can see the mirror Pod on the API server:
170
172
171
173
```shell
172
174
kubectl get pods
173
175
```
174
176
```
175
-
NAME READY STATUS RESTARTS AGE
176
-
static-web-my-node11/1 Running 0 2m
177
+
NAME READYSTATUSRESTARTS AGE
178
+
static-web 1/1 Running 0 2m
177
179
```
178
180
179
181
{{< note >}}
@@ -190,18 +192,18 @@ If you try to use `kubectl` to delete the mirror Pod from the API server,
190
192
the kubelet _doesn't_ remove the static Pod:
191
193
192
194
```shell
193
-
kubectl delete pod static-web-my-node1
195
+
kubectl delete pod static-web
194
196
```
195
197
```
196
-
pod "static-web-my-node1" deleted
198
+
pod "static-web" deleted
197
199
```
198
200
You can see that the Pod is still running:
199
201
```shell
200
202
kubectl get pods
201
203
```
202
204
```
203
-
NAME READY STATUS RESTARTS AGE
204
-
static-web-my-node11/1 Running 0 12s
205
+
NAME READY STATUS RESTARTS AGE
206
+
static-web 1/1 Running 0 4s
205
207
```
206
208
207
209
Back on your node where the kubelet is running, you can try to stop the container manually.
@@ -210,13 +212,13 @@ automatically:
210
212
211
213
```shell
212
214
# 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
214
216
sleep 20
215
217
crictl ps
216
218
```
217
219
```
218
-
CONTAINER ID IMAGE COMMAND CREATED ...
219
-
5b920cbaf8b1nginx:latest "nginx -g 'daemon of2 seconds ago ...
220
+
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
221
+
89db4553e1eebdocker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
220
222
```
221
223
222
224
## Dynamic addition and removal of static pods
@@ -236,7 +238,6 @@ sleep 20
236
238
crictl ps
237
239
```
238
240
```
239
-
CONTAINER ID IMAGE COMMAND CREATED ...
240
-
e7a62e3427f1nginx:latest "nginx -g 'daemon of27 seconds ago
241
+
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
242
+
f427638871c35docker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
0 commit comments