How Kubernetes came into use?
Before using Kubernetes we were using Docker for containerization and accessing the application. But there were some limitations of docker.
-> If the docker container fails then we have to restart it manually.
-> If we want to scale up the container means if in our app there is a lot of traffic then the container is failed in that situation.
These same issues were faced by Google. Google Engineers made an architecture through which all these issues were solved.
-> If a container is failed then it can be autohealed.
-> If a container has a lot of load, it can be autoscaled.
-> This architecture has also solved the issue of resource allocation suppose we want that on a particular server the frontend should run and on another server, our backend should run and for the backend, more machines should be allocated, and for the backend, more machines should be allocated and for frontend, there should be fewer machines allocated. So Google made Kubernetes (K8s).
What is Kubernetes(K8s) ?
Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management. Originally designed by Google, the project is now maintained by the Cloud Native Computing Foundation.
Orchestration means how the containers are working and where they are going, who they are communicating with through the network, how they are deploying, how the downtime is coming, how they are calculating logs, and how with the security the deployment is taking place. So all these things come in orchestration.
Multi-Environment and Multi-Container Deployment means that we can tell that this is our production server and this is my deployment server. So there will be only one configuration in that container that will go to production, testing, or development.
What is Monothithic and Microservice Architecture?
1. Monolithic Architecture
In a monolithic application, there is a big system and in that system, we have frontend, backend, databases, and cache. All the things are present in a single system. It is a singular, large computing network with one code base that couples all of the business concerns together. Making a change to this sort of application requires updating the entire stack by accessing the code base and building and deploying an updated version of the service-side interface.
2. Microservice Architecture
In microservices, there are different services in which the frontend, backend, and database is running. So there are these types of services present and in these services suppose in frontend for authentication there is a different service. In the backend for social media, routing, and URL there are different services. So in microservices with these small services, a big system is formed.
Why microservices is important?
It is very important for a system to be loosely coupled. Loosely coupled means let's say if our system is down then the whole system should not get down. Only the service that is creating issues should be down.
Like, suppose we are using Instagram, and sometimes the post didn't get refreshed. The feed can't be refreshed but we are able to use Instagram and are able to see the people's stories. It's like just new feeds are not coming. This is because the application's UI is separate and the story is separate. Messaging is separate and everything is separate. Sometimes we can't upload the post because the microservice of upload is down. So today everything is working on microservices and Kubernetes is specially designed for the microservices.