Skip to content
A Architect's Notebook
go docker kubernetes learning

Back to Go, This Time Through Docker and Kubernetes

I let tools do what I didn't know how to do, and that's how I learned it.

F

Frédéric Schmidt

2 min read

Before I let a tool do something for me, I want to have done it myself at least once.

That is how I learned Git: on the command line first, and only later with the tools built into Visual Studio or with GitKraken, to save time. Automation by tools, IDEs and assistants is a good thing when you already know the technology and have handled it in a more rudimentary way. It adds a layer that makes me faster and my work better, provided I know what that layer is doing.

For two days this month I did the opposite, on purpose. This note is about what happened.

Why Go, why now

.NET is my job. Go is what I want to write right now.

I have a soft spot for this language. It compiles to a native binary (.NET can do that too, with Native AOT), and its syntax and concepts are simple. Above all, Go lets me start from almost nothing, which forces me to decide on every brick I add.

There are other languages I would like to study, Java and Rust among them. I picked Go because it is the one that attracts me most. I am not leaving .NET, which remains what I use at work and what I keep following.

I had been postponing this for a while. I am studying Kubernetes and Argo CD, and I have a few projects to write, so the moment was right.

What I already knew, and what I didn’t

I have written Go before, on personal projects and with a lot of help from an AI assistant: the backend of a Backstage plugin that manages and displays what lives in a RabbitMQ cluster, and a desktop application built with Wails that syncs my time entries between Toggl Track and other tools.

From those I kept the basics of the language, its error handling, how to write an API with libraries, and unit tests. Then I went back to .NET and forgot a good part of it.

Neither project had a container, a cluster or a remote debugger. So when I came back to Go through Docker and Kubernetes, the language was the familiar part and everything around it was new. On Go’s tooling, I am a rookie.

Where I let the tools do it

The project itself was the sample that the IDE generates when you create a new project. I put the sources in a src folder, a habit I carry from my .NET projects, before I had read what the official Go documentation recommends; its layout guide has no such folder. The habit cost me a first error in the IDE:

package samples is not in std

Then I ran docker init, which I did not know. It generated a Dockerfile and a Compose file, and I admit I did not read them carefully. The build failed with no Go files in /src, because my code was not where the generated file expected it. Normally I write these files by hand in Visual Studio Code, and that is why I usually think about things like publishing ports.

To debug inside the container, I asked an AI assistant for a Dockerfile that embeds Delve, the Go debugger. I read it before running it. It contained an error that stopped the debugger from starting, and I could not see it: I did not know Delve, so there was nothing in that file I was able to doubt. Next, the IDE’s debugger could not connect, because the port was declared in the image but not published when the container started.

Kubernetes added its own surprises. My pod stayed in ErrImageNeverPull. I did not know that an image built on my machine has to be loaded into the minikube cluster, and my cluster runs under a named profile that the commands have to target. Once the image was in, the tag in my manifest was not the right one.

That is also the good surprise of these two days: loading a local image into minikube takes one command, which saves time and keeps things simple.

What comfortable tooling had kept from me

In the .NET world, with Visual Studio, most of this is automated by dedicated tools, for the sake of productivity.

The twist is on my side. When I change ecosystem, that comfort does not come with me, so I have to know a minimum about the underlying technologies and get my hands dirty again.

Rereading is where it showed most. I do not take generated code for granted, least of all code for professional use: I read it closely, first to understand it, because I will be the one maintaining it. But reading only works on what you already know. On Delve, I read and saw nothing.

I would do it again

Speaking only for myself: I would do exactly the same.

My rule holds for professional work. In a lab I relax it deliberately, to confront the problems directly, because I need to hit the errors and fix them. The assistant also brought me Delve, a tool I could not have known about and would have walked past. When the error came, handing it to the assistant was faster than reading the whole documentation, and this project is a lab. Since then I have bookmarked the Delve project to learn its basics properly.

Next comes the language itself, its syntax and its REST libraries, to write a small API. Architecture, with its boundaries and its patterns, comes only after that.

Back to Blog
Share:

Follow along

Stay in the loop — new articles, thoughts, and updates.