- So this video is about Operational Container Management.
But hey, why do we want to know about it?
Well, Kubernetes is about container orchestration
and Kubernetes uses container runtime.
And in order to manage the containers
on the individual Kubernetes nodes,
so for troubleshooting the individual Kubernetes nodes,
you might need this.
So let's talk about operational container management
with Kubernetes in mind.
So while working with Kubernetes,
Kubernetes tools are used
for most container management tasks.
So on Kubernetes,
you are not going to use any podman or docker command.
You are going to use kubectl.
And I will tell you all about that later.
If you want to verify
that Pods have been started successfully,
you may want to use a container runtime tools to inspect.
And crictl is the most appropriate tool.
It really is a lot like podman and the docker tools,
and it's very compatible again.
On the next slide, you will find the commands
that I'm going to demonstrate.
Feel free to replace these commands with podman or docker.
That also works.
But I want to show you crictl.
So for this demo,
I'm not going to show you how it works on on Ubuntu.
I am going to show you how it works on Minikube.
We'll install Minikube,
and you will learn all about it in the next lesson.
But I already want to show you how containers are used
in this Minikube environment,
because this will be the appropriate moment
to tell you all about it.
So crictl is a default installation,
and I'm using crictl ps,
which is a list of all the containers.
In Kubernetes, as I will tell you later,
these containers are running as Pods.
So here we can see the Pod IDs.
But we have the container,
we have the contain an image,
and we have the status.
It's really everything that you would normally also see.
So crictl ps -a is showing the same
including Pods that have already exited.
And you can see, oh boy, there's a lot of them.
So in crictl, you also have these other commands.
Use crictl -h for an overview.
And here you see all the commands that are available.
Tag completion unfortunately in Minikube is not installed.
So I need crictl ps to find something.
crictl inspect so that I can do next.
And this inspect is what you can do on any container
used on either the image or the container itself.
And in order to do that, I am typing 75359,
which is the start of the ID of my /etcd container.
And here we can see exactly what it is doing.
If want to figure out what is going on,
there are more options like crictl logs.
And let me do this on the 75359 again.
And, oh, this container doesn't have a log path.
Normally containers do,
but /etcd is kind of special so it doesn't.
So next, what else can we do?
Well, we start with crictl ps, that's for sure.
And let me do a crictl exec, for instance, -it,
on which container?
Well, /etcd is an interesting one, 7535 sh.
That's running a shell in this /etcd container.
And, oh boy, this /etcd container
doesn't happen to have a shell,
so find container that does.
You can shell into this specific container.
The clue here is /etcd is a core component of Kubernetes,
and you can't expect normal behavior of this core component.
That's why commands like this is failing.
Try it on some other containers,
and you'll find one where it does work.
Let me show you one more thing
and crictl stop, stop wild eebc6ee, for instance.
And, oh boy, no such container.
Yeah, I'm making an error.
The second column is for the container image id.
And here we need the container ID itself,
52f3, for instance, or 5d0e2.
So 5d0e2, and there we go.
It is going to stop it.
Hey, this is enough about crictl.
Let's move forward.
But do remember this utility
for the day where you need to do
advanced Kubernetes troubleshooting.