Skip to content

Commit 2cae689

Browse files
authored
Merge pull request #38229 from Ritikaa96/static-pod
Adding log info in static pod, adding references in whats next section
2 parents 8d326ad + f6741ce commit 2cae689

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Similar to how [filesystem-hosted manifests](#configuration-files) work, the kub
117117
refetches the manifest on a schedule. If there are changes to the list of static
118118
Pods, the kubelet applies them.
119119
120-
To use this approach:
120+
To use this approach:
121121
122122
1. Create a YAML file and store it on a web server so that you can pass the URL of that file to the kubelet.
123123
@@ -225,14 +225,26 @@ crictl ps
225225
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
226226
89db4553e1eeb docker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
227227
```
228+
Once you identify the right container, you can get the logs for that container with `crictl`:
229+
230+
```shell
231+
# Run these commands on the node where the container is running
232+
crictl logs <container_id>
233+
```
234+
```console
235+
10.240.0.48 - - [16/Nov/2022:12:45:49 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.47.0" "-"
236+
10.240.0.48 - - [16/Nov/2022:12:45:50 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.47.0" "-"
237+
10.240.0.48 - - [16/Nove/2022:12:45:51 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.47.0" "-"
238+
```
239+
To find more about how to debug using `crictl`, please visit [_Debugging Kubernetes nodes with crictl_](https://kubernetes.io/docs/tasks/debug/debug-cluster/crictl/)
228240
229241
## Dynamic addition and removal of static pods
230242
231243
The running kubelet periodically scans the configured directory (`/etc/kubernetes/manifests` in our example) for changes and adds/removes Pods as files appear/disappear in this directory.
232244
233245
```shell
234246
# This assumes you are using filesystem-hosted static Pod configuration
235-
# Run these commands on the node where the kubelet is running
247+
# Run these commands on the node where the container is running
236248
#
237249
mv /etc/kubernetes/manifests/static-web.yaml /tmp
238250
sleep 20
@@ -246,3 +258,12 @@ crictl ps
246258
CONTAINER IMAGE CREATED STATE NAME ATTEMPT POD ID
247259
f427638871c35 docker.io/library/nginx@sha256:... 19 seconds ago Running web 1 34533c6729106
248260
```
261+
## {{% heading "whatsnext" %}}
262+
263+
* [Generate static Pod manifests for control plane components](/docs/reference/setup-tools/kubeadm/implementation-details/#generate-static-pod-manifests-for-control-plane-components)
264+
* [Generate static Pod manifest for local etcd](/docs/reference/setup-tools/kubeadm/implementation-details/#generate-static-pod-manifest-for-local-etcd)
265+
* [Debugging Kubernetes nodes with `crictl`](/docs/tasks/debug/debug-cluster/crictl/)
266+
* [Learn more about `crictl`](https://github.com/kubernetes-sigs/cri-tools).
267+
* [Map `docker` CLI commands to `crictl`](/docs/reference/tools/map-crictl-dockercli/).
268+
* [Set up etcd instances as static pods managed by a kubelet](/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/)
269+

0 commit comments

Comments
 (0)