Inspired by Borg, Google’s cluster management system for containerized workloads, Kubernetes was open sourced by Google in 2014. Today, Kubernetes is the best way cloud native apps, microservices and APIs are put into production with high-availability and at any scale.
Concepts every developer needs to know:
1) Kubernetes is a cluster that runs containerized apps in load balanced pods
- There is a master node which exposes a configuration API
- There are worker nodes which run collections of pods
- The master node controls and monitors the worker nodes
- Pods contain one or more containers with shared storage
- The backing store for all cluster data is a distributed k/v store called etcd
2) Apps are defined declaratively and k8s maintains the declared state
- Apps are applied to the config API as a set of yaml Resources called Objects
- The Deployment Resource defines the configuration of an app
- A ReplicaSet of Pods are united into a Service with an IP address and DNS name
- Services are explosed through the Ingress API and an Ingress Controller like Kong Gateway
- Deployment updates can be performed with zero downtime and rollbacks are possible
- Namespaced Environments in the cluster handle staging, test prod
- Canary Deployments enable testing and gradual rollouts
3) Apps move through the Docker toolchain on their way to k8s
- Docker images should be concise, taking full advantage of multistage builds
- Apps are composed sets of images defined in a docker-compose.yml file
- The docker-compose.yml is converted to k8s Resources using Kompose
- After running Kompose, more work is necessary to properly prepare k8s Resources
4) DevOps teams frequently use a Service Mesh like Istio to manage Kubernetes
- A k8s add-on to streamline operations in environments where services interact
Learning resources for developers and DevOps:
- Containerization, composition and Komposeconversion tutorial series from DO
- Kubernetes Quickstart from Google:
- Kubernetes Basics Playlist from Microsoft
- DevOps Best Practices Playlist from Google
- Interactive Browser Based Hands-on Courses from Katakoda
John Knapp was most recently Senior Architect, Cloud Services at leading AR knowledge management platform provider Scope AR.