Getting Started with Kubernetes (K8s)

Bhargav Shah
3 min readNov 6, 2019

--

A quick way to get started with K8s

https://kubernetes.io/

Let’s Understand components in Kubernetes (K8s)

Kubernetes Architecture

Clients:

  1. User Interface (UI): Kubernetes has Web UI (Dashboard) which is a web-based user interface. In fact, UI can be anything that can work with Kubernetes exposed APIs.
  2. Command Line Interface (CLI) — Kubectl: It’s a tool that most preferred way to communicate with your K8s cluster. Install kubectl on MAC OS. kubectl command list can be found here.

Master Node:

  1. API Server: kube-apiserver” is the most important component of the control plane. The API server provides an HTTP- or HTTPS-based RESTful API, which is the hub between Kubernetes components, such as kubectl, the scheduler, the replication controller, the etcd data store, the kubelet and kube-proxy, which runs on Kubernetes nodes, and so on.
  2. Scheduler: “kube-scheduler” is responsible for scheduling pods on to worker nodes. The scheduler needs to take into account individual and collective resource requirements, quality of service requirements, hardware/software/policy constraints, affinity and anti-affinity specifications, data locality, inter-workload interference, deadlines, and so on.
  3. Controller-Manager: “kube-controller-manager” performs cluster operations. A controller watches the shared state of the cluster through the kube-apiserver and makes changes attempting to move the current state toward the desired state.
  4. Etcd: “etcd” is a distributed key-value store written in golang that provides a reliable way to store data across a cluster of machines. Kubernetes uses it as its brain, but only the kube-apiserver can communicate to it to save desired states.

Worker Node:

  1. kubelet: An agent that runs on each worker node in the cluster. It makes sure that containers are running in a pod. It is periodically communicating with kube-apiserver to check and report.
  2. kube-proxy: The proxy handles the network proxy and load balancer for each container. It changes Linux iptables rules (nat table) to control TCP and UDP packets across the containers.
  3. Container Runtime: The container runtime is the software that is responsible for running containers. Kubernetes supports several container runtimes: Docker, containerd, cri-o, rktlet and any implementation of the Kubernetes CRI (Container Runtime Interface).

How to get started with Kubernetes Cluster?

There are so many options available to install and get started with the K8s cluster. Let me share you some of the popular methodologies,

Online:

  1. Play-with-Kubernetes: https://labs.play-with-k8s.com
  2. Katacoda: https://www.katacoda.com/courses/kubernetes/playground

Tools:

  1. Docker Desktop for MAC: https://docs.docker.com/docker-for-mac/install/
  2. Using Minikube: https://kubernetes.io/docs/tutorials/hello-minikube/
  3. Using Kubeadm: https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/
  4. Vagrant: Helpful link 1 and Helpful link 2

Hard Way:

  1. Kelsey Hightower Kubernetes the hard way
  2. Kubernetes The Hard Way On VirtualBox

“Docker for MAC” and “Online options” are fastest to get started.

Where to find more help?

  1. Kubernetes Official Docs: https://kubernetes.io/docs/home/
  2. Official Github: https://github.com/kubernetes/kubernetes
  3. Community and Google

In the next step, We will deploy a simple application on our Kubernetes cluster. we will be deploying the “Hello World” equivalent application on Kubernetes Cluster.

Thank You.

--

--

Bhargav Shah
Bhargav Shah

Written by Bhargav Shah

Cloud Solution Architect at Walmart Japan

No responses yet