Why You Should Learn Docker 🐋 & Kubernetes ☸️?
Tags: docker, kubernetes, beginners, devops
Published: 2024-01-07 00:01:22

If you are a developer, I'm sure you must have heard this phrase: **"It works on my machine."** It's heartbreaking when our code runs on your machine but behaves undesirable on a friend's machine.

![It works on my machine meme](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/if42243sze1ehj0qhk4d.png)

**There are multiple reasons for that.**

It may happen because of a **package error**, like when you use a **different version** of a package and your friend is using an old version, so a feature is not accessible for your friend.

Or may happen due to the operating system. like you have **MacOS** but your friend has **Windows OS**, and the library or package you are using **may not be present** on your friend's operating system. blah blah blah!!

## Why Docker?

Lemme give you some practical examples of what docker tries to solve. Surely this is going to blow 🤯 your mind.

### Development

Install Postgres, MongoDB, Node.js, run multiple scripts, etc. Oh, wait, you are on **macOS**? Also, change these **configurations**. It sounds familiar, naa. Yeah, these are the steps involved in setting up the development environment.

![Development](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2krc5x2plnv3ofm3kfa8.png)


**What if I told you that you could do it in one step? Yes, you need to run the `docker compose up` command. Easy pisy.**

It makes the development environment setup so easy. 

### Deployment

For deploying any project, you need to create a cloud instance, install OS, install libraries, install dependencies, copy binaries, and then run it with these options.


![deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j29rujo33fzrod3l9sls.png)


**But wait, there is a simple process: just run the container image with options. Deployed 🎉**

So now deployment process is no longer complex, docker solves this problem by creating easy-to-use portable containers.

## Why Kubernetes?

Now you may ask, if docker solves this problem then, what Kubernetes does?

Imagine you have a web application that has **gained popularity rapidly**. Initially, running a **single instance** of your application on a server was sufficient. 

However, as user traffic grows, a single server becomes **insufficient to handle the load efficiently**. Without Kubernetes, scaling your application manually would involve setting up additional servers, configuring load balancing, and managing traffic distribution a complex and time-consuming process.

**Kubernetes helps here to automatically provision and remove server instances according to the load. It efficiently manages load balancers, ensures high availability, and seamlessly handles failures**


So, I hope you now have the motivation to learn Docker and Kubernetes.

Believe me, it is going to help a lot in your development process. and also give you an **edge** over the **hiring process**.

So, **buckle up and go through this series** to understand better. 🚀

**See you soon in the next blog. 👋**

Connect with me on [LinkedIn](https://www.linkedin.com/in/mukeshkuiry) and [Twitter](https://twitter.com/mukeshkuiry07) for more. 🌐👩‍💻