11 minutes away from Kubernetes

A hyper-condensed 101 of the container orchestration platform in plain(ish) English to hit the ground running

Image for post
Image for post
Photo by Manuel Nägeli on Unsplash

Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications.

The basics

Orchestrating the workload

The application container is wrapped in a Pod, that smallest computing unit managed by Kubernetes
The application container is wrapped in a Pod, that smallest computing unit managed by Kubernetes
To avoid managing individual Pods, workloads are organised in ReplicaSets and Deployments
To avoid managing individual Pods, workloads are organised in ReplicaSets and Deployments
Containers are run in Pods, a ReplicaSet is in charge of ensuring a given number of them are running at any point in time. The Deployment orchestrates all the necessary steps to start and have running the Pods.
The service is the method by which the requests from outside of your workload are routed to your Pods
The service is the method by which the requests from outside of your workload are routed to your Pods
Example of how an ExternalName service overrides DNS resolution within the cluster
Example of how an ExternalName service overrides DNS resolution within the cluster
In the cluster on the left there’s no ExternalName service created, hence, the requests to db-01.example.com will resolve normally. In the cluster on the right, the Service is created so the same domain will resolve internally.
A headless Service will generate A records for all the Pod IPs it’s serving, under a domain name matching the Service name
A headless Service will generate A records for all the Pod IPs it’s serving, under a domain name matching the Service name
An example of A records automatically configured by the Service, pointing to the Pod IPs
Pods are labeled and Services use these to determine how/where to route the incoming requests.
Pods are labeled and Services use these to determine how/where to route the incoming requests.
A Service uses Pods labels to determine where to route the requests (Yes, the third colour is indigo. To me it was just purple, but as it turns out, it’s not)

Bonus track: Autoscalers

Configuration objects

Security

Kubernetes internal architecture considerations

Nodes are organised in NodePools and workloads can be configured to have higher affinity with a NodePool than others
Nodes are organised in NodePools and workloads can be configured to have higher affinity with a NodePool than others

Stateless vs stateful

Actually, in Kubernetes a stateless deployment is called Deployment; while a stateful deployment is called StatefulSet

The API

Why an API?

kubectl create deploy my-deployment --image=my-app
kubectl create apply -f my-deployment.yaml

Some other commands examples

kubectl get pods
kubectl describe deploy my-deployment
kubectl delete rs my-replicaset

Written by

Technology enthusiast. Less is more.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store