Getting Started with Kubernetes

Getting Started with Kubernetes

Kubernetes has become the go-to platform for container orchestration, enabling developers and operations teams to deploy, manage, and scale containerized applications efficiently. If you’re new to Kubernetes, this guide will walk you through the basics, from what Kubernetes is to how to set up your first cluster and deploy an application. 

What is Kubernetes? 

Kubernetes, often abbreviated as K8s, is an open-source platform designed to automate the deployment, scaling, and management of containerized applications. It abstracts the underlying infrastructure, providing a consistent environment for applications to run across different environments — from local machines to on-premises data centers and public clouds. 

Why Use Kubernetes? 

  • Scalability: Automatically scale your applications based on demand. 
  • High Availability: Automatically redeploy and reschedule containers in case of failure. 
  • Portability: Run the same application on any platform with minimal changes. 
  • Declarative Configuration: Manage application lifecycle through simple, declarative YAML files. 

Let’s understand Kubernetes in the form of a story: 

Chapter 1: The Chaos in the Kingdom 

Once upon a time, in a land of servers and applications, developers faced a growing problem. They were building amazing applications and packing them into magical crates called containers (think of Docker). 

But chaos grew… 

These containers needed to be deployed, scaled, and managed across different kingdoms (servers). Doing this manually was like herding cats during a thunderstorm. Every knight (developer) had their own way, and soon the land was filled with confusion. 

Chapter 2: The Rise of the Orchestrator 

Then came a wise wizard named Kubernetes – the master orchestrator of containers. 

Kubernetes didn’t just move containers; it managed them. He made sure: 

  • Each crate (container) had a proper home. 
  • If one failed, it was replaced instantly. 
  • If demand increased, more were summoned. 
  • If one wasn’t needed, it was gracefully dismissed. 

He brought order to the chaos with his army of magical terms: 

  • Pods: Tiny floating ships carrying one or more containers. 
  • Nodes: The powerful lands (machines) where pods lived. 
  • Cluster: A kingdom of nodes ruled by the great Kubernetes. 
  • Deployments: Blueprints for how pods should behave. 
  • Services: Gateways to reach the pods from the outside world. 

Chapter 3: A Young Developer’s Quest 

Our story follows you, a young developer from the village of Codeville. Inspired by the tales of Kubernetes, you set off on your first journey to master the orchestrator. 

Chapter 4: The Tools of the Trade 

Before heading out, you gather essential tools: 

kubectl – the command-line wand to speak with Kubernetes. 
Minikube – a magical sandbox to summon your own local kingdom (cluster). 

You install them like so: 

# macOS 
brew install kubectl
brew install minikube


# Windows
choco install kubernetes-cli
choco install minikube

Once equipped, you summon your very first cluster (run as administrator): 

minikube start

Boom! A tiny Kubernetes kingdom appears on your machine. 

PS C:\Windows\System32> minikube start 

* minikube v1.36.0 on Microsoft Windows 11 Pro 10.0.26100.4652 Build 26100.4652 

* Automatically selected the docker driver. Other choices: hyperv, ssh 

* Using Docker Desktop driver with root privileges 

* Starting "minikube" primary control-plane node in "minikube" cluster 

* Pulling base image v0.0.47 ... 

* Downloading Kubernetes v1.33.1 preload ... 

    > preloaded-images-k8s-v18-v1... : 347.04 MiB / 347.04 MiB [----------] 100.00% 15.06 M 

    > gcr.io/k8s-minikube/kicbase... : 502.26 MiB / 502.26 MiB [----------] 100.00% 19.16 M 

* Creating docker container (CPUs=2, Memory=8000MB) ... * Preparing Kubernetes v1.33.1 on Docker 28.1.1 ... 

! Failing to connect to https://registry.k8s.io/ from inside the minikube container 

* To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking 

/proxy/ 

- Generating certificates and keys ... 

- Booting up control plane ... 

- Configuring RBAC rules ... 

- Configuring bridge CNI (Container Networking Interface) ... 

* Verifying Kubernetes components... 

- Using image gcr.io/k8s-minikube/storage-provisioner:v5 

* Enabled addons: storage-provisioner, default-storageclass 

* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default 

Chapter 5: Summoning Your First Pod 

Your mentor instructs you: “Summon a noble web server named nginx.”

Picture2 1 - kubernetes

Kubernetes hears your call and deploys a pod in the cluster. You check on it: 

Getting Started with Kubernetes

Chapter 6: Let the World See It 

But a pod alone is hidden deep within the cluster. So you create a service – a magic portal that allows the outside world to access it: 

Picture4 - kubernetes

A browser window opens, showing a grand welcome from the NGINX realm. Success! 

Picture5 - kubernetes

Chapter 7: Cleaning the Battlefield 

When your quest is complete, you must clean up your kingdom: 

Picture6 - kubernetes

The cluster vanishes like a mist over the mountains. 

Chapter 8: The Road Ahead 

You’ve only begun your journey. Ahead lie: 

  • YAML scrolls to define Kubernetes resources 
  • ConfigMaps and Secrets to hide your precious data 
  • Helm, the package manager, for deploying mighty applications 
  • And vast cloud kingdoms: AWS, Azure, and Google Cloud 

With practice, you’ll master the elements and become a Kubernetes Sorcerer, orchestrating containers with ease, no matter how complex the challenge. 

-Sherwin Dcosta
Full Stack Engineer