Kubernetes – View Docker Image’s Console Trace in Kubernetes Dashboard

dockerkubernetesmicrok8s

I'm working through a tutorial that uses Kubernetes: .NET Microservices – Full Course

The instruction is aimed at MS Windows 10, but I'm working through it in both Windows and Linux, just because.

The actual code is written in .NET 5.0 using VS Code, both of which work fine in both Windows and Linux. The instruction uses Docker Desktop, but for the docker-specific stuff I've been able to use the standard Docker (docker/focal,focal 1.5-2 all) and that's worked fine, so far.

But the tutorial relies on the Docker Desktop installation of Kubernetes, and Docker Desktop hasn't actually been released for Linux, quite yet. So I'm using MicroK8S, which has installed and run fine, I think, with two issues.

  1. In Windows when I apply a deployment yaml file using the Docker Desktop Kubernetes install, it creates a pod and runs a deployment, and the running docker container shows up in a "docker ps" listing. When I apply the same yaml file in Linux, using MicroK8S, it looks like it is working, but the container does not show up in "docker ps".

  2. In Windows you can list the depolyments in Docker Desktop, and by clicking on one you can see the console trace of the docker container. See timestamp 3:11:10 in the linked video. When I run in Linux, the Docker Desktop GUI isn't available. MicroK8S does make the Kubernetes Dashboard available, and in it I can see my pods, deployments, and replica sets.

What I have not figured out is how to view the docker console trace in Kubernetes Dashboard.

Any ideas?


Note – I have figured out how to view the trace using the kubectl command line:

microk8s kubectl logs platforms-depl-5dd6f7cb9-x2r4k platformservice

I'm sure there is some way of doing this from the Kubernetes Dashboard GUI, but I haven't found it.

Best Answer

As is usually the case, when I'm working in something new, and I don't see what I expect, I was looking in the wrong place.

The .yaml file I created while following the tutorial created a deployment and because the .yaml specified a single replica it created a single pod. If I set "replicas: 2" I see two pods.

And if I click the hamburger icon on a pod to bring up the "Actions menu", there is a "Logs" option. Clicking on that displays the docker container's log trace - which is what I was looking for.

Related Topic