DEV Community

Cover image for Kubernetes and Pods ...
Bek Brace
Bek Brace

Posted on

Kubernetes and Pods ...

Let me tell you about Kubernetes ..

Kubernetes : a tool for managing and automating containerized workloads in the cloud.

Imagine you have an orchestra (containers ) , think of each individual musician as a docker container , to create beautiful music we need a conductor to manage musicians and set the tempo.

Now imagine the conductor as Kubernetes and the orchestra as an app like robinhood , when the markets are closed , an app like robinhood is not doing much and when they open it needs to fulfill millions of trades for overpriced stocks like shopify, alibaba and tesla.

Kubernetes is the tool that orchestrates the infrastructure to handle the changing workload , it can scale containers across multiple machines and if one fails it knows how to replace it with a new one.

A system deployed on Kubernetes is known as a cluster, the brain of the operation is known as the control plane: it exposes an API server that can handle both internal and external requests to manage the cluster, it also contains its own Key:Value database called ETCD, used to store important information about running a cluster.

What it's managing is one or more worker machines called "NODES".
When you hear "node" think of a machine, and each node is running something called "KUBELET" which is a tiny application that runs on the machine to communicate back with the main control plane.

Inside of each "node" we have multiple "pods" which is the smallest deployable unit in "Kubernetes".

When you hear "pod", think of a pot of wales or containers running together.

As the workload increases, "Kubernetes" can automatically scale horizontally by adding more nodes to the cluster.
In the process, it takes care of complicated things like networking, secret management and so on.

It's designed for high availability and one way it achieves that is by maintain a replica set, which is just a set of running pods ready to go at any given time.

As a developer, you define objects in yaml that describe the desired state of your cluster, for example, we might have an nginx deployment that has a replica set with three pods; in the spec field we can define exactly how it should behave like its containers, volumes, ports and so on.

You can take this configuration and use it to provision and scale containers automatically and ensure that they're always up and running and healthy.

Top comments (0)