This is the guide I wish I had when I was starting my Kubernetes journey. Kubernetes is a complex technology with many new concepts that takes time to get your head around. In this guide, we will take an incremental approach to deploying applications on Kubernetes. We will cover what and why of Kubernetes and then we will learn how to deploy a real-world application on Kubernetes. We will first run application locally, then using Docker containers, and finally on Kubernetes. The guide will also cover Kubernetes architecture and important Kubernetes concepts like Pods, Services, Deployment.
In this guide, we will cover following topics:
- What is Kubernetes?
- The real reasons you need Kubernetes
- Kubernetes Architecture
- Deploying a real world application on Kubernetes
What is Kubernetes?
Kubernetes is a platform for managing application containers across multiple hosts. It abstracts away the underlying hardware infrastructure and acts as a distributed operating system for your cluster.
Kubernetes is a greek for Helmsman or Pilot (the person holding the ship’s steering wheels)
Kubernetes play three important roles:
- Kubernetes allocates and manages access to fixed resources using build in resource abstractions like Persistent Volume Claims, Resource Quotas, Services etc
- Kubernetes provides an abstracted control plane for scheduling, prioritizing, and running processes.
- Kubernetes provides a sandboxed environment so that applications do not interfere with each other.
- Kubernetes allows users to specify the memory and CPU constraints on the application. It will ensure application remain in their limits.
- Kubernetes provides communication mechanism so that services can talk among each other if required.
- Kubernetes gives the illusion of single infinite compute resource by abstracting away the hardware infrastructure.
- Kubernetes provides the illusion that you need not care about underlying infrastructure. It can run on a bare metal, in data centre, on the public cloud, or even hybrid cloud.
- Kubernetes gives the illusion that applications need not care about where they will be running.
- Kubernetes provides common abstractions like Services, Ingress, auto scaling, rolling deployment , volume management, etc.
- Kubernetes comes with security primitives like Namespaces, RBAC that applications can use transparently
I learnt about the three roles – Referee, Illusionist, and Glue from the book Operating Systems Principles and Practices by Thomas Anderson and Michael Dahlin