2 Kubernetes & GitOps
This chapter covers:
- Problem-solving with Kubernetes
- Running and managing Kubernetes locally
- The basics of GitOps
- Implementing a simple Kubernetes GitOps operator
In chapter 1, you learned about Kubernetes and why it’s declarative model makes it an excellent match to be managed using GitOps. This chapter will briefly introduce Kubernetes architecture and objects and learn about the differences between declarative and imperative object management. By the end of this chapter, you will implement a basic GitOps Kubernetes deployment operator.
Before diving into why Kubernetes and GitOps work so well together, let’s talk about Kubernetes itself. This section provides a high-level overview of Kubernetes, how it compares to other container orchestration systems, and its architecture. We will also have an exercise that demonstrates how to run Kubernetes locally, which will be used for the other exercises in this book. This section is only a brief introduction and refresher to Kubernetes. For a fun but informative overview of Kubernetes, check out “The Illustrated Children’s Guide to Kubernetes” and “Phippy Goes to the Zoo” by the Cloud Native Computing Foundation[8]. If you are completely new to Kubernetes, we recommend reading Kubernetes in Action, by Marko Lukša and then returning to this book. If you are already familiar with Kubernetes and running minikube, you may skip to the exercise at the end of section 2.1.