Kubernetes is nothing but a Platform from which you can run and manage containers, means those small processes which use their independent compute and are managed using Kubernetes, here are some traits of it:
· Its Open source
· Its developed by Google
· It is the most popular container management platform used across the world
· All other microservices management platform whether On-premises or cloud are built on top of Kubernetes.
Now the question which comes to our minds is that if we have docker and we know how to use docker to run containers then what is the need of Kubernetes, the argument is valid if you are going to use Docker on a single VM and run 2 or 3 containers but!! Here we are talking about microservices based applications which can have hundreds of different services which would definitely require many VMs and on top of that multiple copies of containers for redundancy plus the integrations between containers, plus the ingress / egress controls, plus the monitoring; well, the list can go on and on and its practically not possible to manage all these things manually on so many systems hosting the microservices application.
Hence, we need a platform with a single Console a single pane of glass from where we can control and manage the entire Container Infrastructure taking care of all the management aspects such as:
· Container / Pod creation deletion
· Running and monitoring containers
· Managing egress and Ingress traffic
· Interconnectivity between containers
· Auto scaling of Pods based on the load
· Auto scaling of Nodes based on the load
Normally how a Kubernetes works is that it has a model of "Master and Worker Nodes" where Masters are the orchestrators which orchestrate and control all the container related tasks and the Workers are the actual Nodes which host the containers
The diagram shown can give you a better view of understanding of Kubernetes, Note: The Master Servers and the Worker Nodes are nothing but VMs
Although I have portrayed Kubernetes as a Container platform which makes your docker related tasks easy it’s still considered to be complex by large enterprises hence there are companies like Redhat who have built Open-shift on top of Kubernetes to further add features which makes it much more easier to manage the microservices platform in an Enterprise
And of course, there are cloud providers like Microsoft, AWS and Google who have their own flavors of managed Kubernetes on their clouds where you can host your microservices based application.
I was not sure whether I should be talking about this small topic over here, but after a bit of grappling around I felt this stuff has its own importance for many readers.
Ok, so, we have understood what a container is and how it runs on top of Docker and the Operating system but where did the container came from, is it some kind of a file, an exe, a text file and who built it, so now we are turning towards the concept of Docker images; yes, it’s an image, a file which has to be executed using Docker Engine to run as a container.
Who builds these images, you can build it !!
There are millions of prebuilt images already present on the docker website for various applications which you can just pull from “hub.docker.com” and start running as a container, or else you can build you own image by using a Docker Base-image (of the OS) and Docker engine, all you need is to write a docker file and specify the following parameters:
Your base image of your OS “which again you can find it on the “Docker Hub.”
Run command for additional installation on it
The startup command.
That’s it your docker image is ready.
Docker image creation
Although this is the standard framework for building container images I have taken the most basic example here but there are other advanced techniques and tools which are used to create customized images based on your requirement