My journey towards container world

What is this Blog all about?

In this blog I will be sharing how I got acquainted with the container world and some basics about containers, kubernetes and openshift.

How and what has been done so far ?

It has been 2 months since I joined Red Hat and I have learnt a lot of things over here. Before joining Red Hat, I was always overwhelmed with the concepts of containers and kubernetes, but after the sessions which were conducted by the engineers working here and after completing the assignments which they gave me to solve, it became easy for me to get a hold of it. I was first introduced with the difference between a container and virtual machines. then about Docker, Kubernetes and finally the OpenShift. We will first understand what these things are one by one and then What all did I do to learn these things?

Virtual Machines

Virtual machines are an emulation of a real computer and can execute all the programs like a real computer does. Virtual machines provide hardware level virtualization.You might be wondering, what hat does it mean? You have a host machine and several guest machines with different OS running on top of the host machine and each of them has dedicated hardware like CPU and RAM which is provided by the host machine. The guest machine has all the application code and binaries required to run the application. There is one layer between the host machine and guest machine which is known as hypervisor. A hypervisor allows a host machine to distribute or share its resources among the guest machines running on top of it.

Virtual Machine

Containers

After the virtual machines, the concept of containers in the world got popular. A container provides OS level virtualization which means it provides virtualization by abstracting the user space whereas a VM packages the virtual hardware, a kernel (i.e. OS) and user space for each new VM. A container will have private space for processing and will contain all the application code and dependencies, libraries to run the application.

Container

I hope you must have got a clear idea of containers and VMs. Now, let’s talk a little bit about the things that revolve around containers which are Docker, Kubernetes and Openshift.

Docker

There must be some tool to communicate with containers which is where Docker comes in. Docker is a tool to create, deploy and run the container.

Kubernetes

It might be easy for us to deploy containers, but to manage containers at scale is not an easy task. That’s where Kubernetes comes into picture. Kubernetes helps to orchestrate multiple containers. It eliminates manual processes involved in deploying and scaling the application. Let’s suppose you have a container which dies due to some reason then you would have to go manually restart the container every time it stops which can become a more tedious task if you have multiple containers to manage. So, to tackle or solve this problem we have kubernetes.

OpenShift

OpenShift is also an orchestration tool and a commercialized containerization software product created from an open-source project which is kubernetes. It adds additional features which are not present in kubernetes like UI for effective cluster administration, integrated ci/cd, operator hub, strict security policies etc.

What did I do to learn these things?

I was asked to develop a sample application, both backend and frontend, with any language of our choice and then containerize it using docker. After completing that successfully, the next step was to make both the frontend and backend containers talk to each other for which I used docker-compose. I was then introduced to another tool known as kubernetes. There were at least 2 sessions conducted on kubernetes which helped me understand it in depth. After that, to test my knowledge and to make more comfortable with kubernetes I was asked to deploy the same application which I built and containerized before. I learnt about Pods, Replica Sets, Deployments, Services and what not. It was really fun and interesting learning and implementing all the concepts. You can check out my assignment over here.

To dig a little deeper, I was also given 150 questions on kubernetes. I know that sounds a little intimidating but it was easy and in most of the questions it was only required to write some commands.

It covered the concepts of namespaces, pods, multi-container pods, deployments, jobs and cron jobs, persistent Volumes and persistent volume claims, services and, service accounts and also secrets and config maps. Obviously, it took a lot of time to complete these questions but it was all worth it. In the meantime, I am also learning OpenShift (Red Hat product) from DO288: Red Hat OpenShift Development II: Containerizing Applications, a course by Red Hat.

I hope this blog will help you to get started with the container world. Feel free to drop any suggestions or comments you have.