This chapter will guide you through the steps involved in dockerizing Go programs and will iterate the best practices for building the smallest possible container image for your applications. Following this, this chapter will focus on Kubernetes.
We'll begin our tour of Kubernetes by comparing the different types of nodes that comprise a Kubernetes cluster and take a closer look at the function of the various services that make up Kubernetes' control plane. Moving forward, we will be describing a step-by-step walkthrough for setting up a Kubernetes cluster on your local development machine. The last part of this chapter is a practical application of everything you have learned so far. We will bring all the components that we created in the previous chapters together, join them with a fully functioning frontend, and create a monolithic version of Links 'R' Us that we will then deploy on Kubernetes.
The following topics will be covered in this chapter:
- Using intermediate build containers to compile static binaries for your Go applications
- Using the correct set of linker flags to ensure that Go binaries compile to the smallest possible size
- The anatomy of the components that comprise a Kubernetes cluster
- The different types of resource types supported by Kubernetes and their application
- Spinning up a Kubernetes cluster on your local workstation
- Building a monolithic version of the Links 'R' Us application using the components we developed in the previous chapters and deploying it on Kubernetes