What on earth are Kubernetes, a beginner's guide to understanding Kubernetes. -Part 1
By: Jacques Potgieter
Tags: Introduction, Junior Developer, Kubernetes, Programming, Cloud Services

I’ve just completed a six month bootcamp called Flatiron School. I took some much needed downtime after finishing the rigorous program. But I quickly became restless, wondering what I might choose to learn next. I’ve always been interested in the cloud and for a long time it has been a very nebulous idea to me. Until now, My itch has been scratched and now I know just enough to get myself into trouble.

So I’ve decided to Launch into Kubernetes and understand how this world of clouds actually works. What better way to start off a series of blogs than to dive into something new, highly complex and very exciting! I’m not tackling this alone however. The great internet will provide guidance. My goal by the end of this blog is to have a condensed overview of the structure of Kubernetes and how to set up the coding environment required to practice. Like the topographers of old, I hope to equip all that come after me with a lay of the land and an x that marks an understanding of something far greater than ourselves. Alright, enough of that romantic crap, let’s get into the nitty gritty. But first, I must give a lot of credit. The snapshots found on this blog are from a Kubernetes Tutorial for Beginners as well as a much more thorough four hour video on Kubernetes. TechWorld with Nina is an awesome resource for further learning!

First things first, let’s talk about what on earth Kubernetes are. In simplest terms, it is a way to separate parts of an application for easy update, destruction and scalability. Instead of having your entire application and its various parts running on your machine, kubernetes allows us to place the application on the cloud, using structures called nodes.

Below is a representation of one node and its inner bits. Within a node, several Pods are found. Pods are ephemeral, meaning they can be easily destroyed, or fall into disfunction. A pod is simply a part of, or an entire application. In the photo we have two pods which are the front and back end of an application. In this case, the Pod is an abstraction over Docker. This helps to optimize runtimes and simplify communications. Each Pod is given an IP address. I’ll come back to this idea later.

#basic structure of kubernetes

Node — An application can run thousands of Nodes and typically has multiple copies of a single node in operation. When a change occurs use will switch to a different node without any down time. There are two different kinds of nodes. Worker nodes and master nodes. One is the Brains, the other the brons. Both play a vital part in Kubernetes functionality.

Volume — a Volume is a storage device, either local or remote, this is important because Kubernetes does not manage data persistence. Updates are batched and sent to the volume so that no data is lost when the app reboots.

Service — a Service is what connects nodes so that on pod death connection is not lost. This is important because without a Service the administrator would have to update the custom IP address each time a Pod dies. That’s not very efficient. Another part of a Service is an Ingress, an Ingress is used to connect with an external service (web app) the Ingress will forward the request to the Service.

Deployment — This is a blueprint for application pods, a user will create a deployment so that each time a new node is created, it has a blueprint for its contents. An important note here is that Deployments are used only for stateLESS Apps.

statefulSet — This is very important for an application that is stateFULL or Databases, it manages which DB copy reads and writes to the volumes. They are harder to use and often not used in favor of having the DB on a local server.

#Worker Nodes and Master Nodes.

A Master node is in charge of several key functions, in short the Master nodes (typically there are at least two for production builds) are made up of four major components.

API Server — Accepts incoming requests, validates and sends the request off to the Scheduler

Scheduler — Decides which worker node to assign the request based on resources used in each available node.

Controller manager — This actually does the work of sending the request to the specified node, as per the Schedulers demands.

ETCD — The brains of the operation. This component manages the logic and data each portion of the master processes need.

It will come as no surprise to you that a Worker node is responsible for carrying out the requests. That could be a fancy hello world application or a state of the art user interface for a university, security company or beyond. There are three key processes that need to be installed on a worker node…

Kube Proxy — Manages the incoming requests from the Master node.

Some kind of Container runtime like Docker

Kubelet — Is responsible for maintaining a set of pods within the node.

#The Setup

So now that we have a basic grasp of the different components and their functions. Let’s get our coding environments set up in preparation for blog #2 all about a practice app using Kubernetes.

First we need to make sure that virtualization is enabled on your system. I am running on windows 10, soy set up may be different than yours. Load the task manager and navigate to the performance tab. Check there to see if Virtualization is enabled.

If virtualization is not enabled. You will need to look up how to update the setting in your BIOS. This will be based on your motherboard documentation. My BIOS setting was not clear and required some searching.

Once that is set up you can use many different virtualization options. I chose to install Docker, but I also have VirtualMachine installed to run my coding environment in and could have used that. Go to the learning environment install page for Kubernetes Here.

In your Command line Interface, use one of these commands based on your preference to install minikube. I chose to use chocolaty sense that is what I previously used. Minikube has kubectl as a dependency and will automatically install!

#Bam! We did it!!

just like that we are set up and ready to go. Next week, I’ll dive into a project app and talk about how to take advantage of the Kubernetes design flow! In the mean time check out this 4 hour video on Kubernetes. For now, happy holidays and I’ll catch you next week.