Playing Around with the Running Pod
Explore how to manage running Pods in Kubernetes by describing resources, executing new processes inside containers, viewing real-time logs, and handling container failures and termination. This lesson equips you with practical skills to interact and troubleshoot Pods in a Kubernetes cluster efficiently.
Describing resources
In many cases, it is more useful to describe resources by referencing the file that defines them. That way, there is no confusion or need to remember the names of resources.
Instead of using kubectl describe pod db, we could have executed the command as follows:
The output should be the same as the previous lesson because, in both cases, kubectl sent a request to the Kubernetes API requesting information about the Pod named “db”.
Executing a new process
Just as with Docker, we can execute a new process inside a running container inside a Pod.
The output will be as follows:
We told Kubernetes that we’d like to execute a process inside the first container of the Pod db. Since our Pod defines only one container, this container and the first container are one and the same. The --container (or -c) argument can be set to specify which container should be used. This is particularly useful when we’re running multiple containers in a Pod. ...