Member-only story
Getting Started with the Kubernetes Go Client
I mean… Kubernetes is written in Go right? So this is what you should use?
What’s a Kubernetes Client (again)?
I’ll do the short explanation here since I’ve explained it in a bit more of a long form for the Python client. Any Kubernetes client is a way to communicate with a running Kubernetes cluster in order to do things like get the state of Pods and other resources, or create/destroy these different types of resources.
Go(lang) is one of Google’s and many other company’s backend server language of choice (makes sense for Google since they came up with it). It’s strongly typed, but not Object Oriented (take that Java!), so you’re using functions
and structs
instead of classes.
Why use Go and not Python or something else?
- If you dislike Object Oriented programming (C/Rust fan-boys unite!) Go is up your alley
- It’s fast (but maybe not as fast as Rust)
- Strong typing, always good for complicated things like Kubernetes resources
- You can compile straight to binaries without weird environment dependencies, great for building slim docker images
- Go is widely used within the Kubernetes and Docker stack, as well as for…