We will divide this in the following manner:
- What are microservices?
- Build docker images and push to docker hub
- Create deployment and services
- Finally, run kubectl commands.
We will first explore the micro-services architectural style.
What are microservices?
Micro-services architecture (often shortened to microservices) refers to an architectural style for developing applications. Micro-services allow a large application to be separated into smaller independent parts.
What this means is, your application consists of different functions such as payment gateway, front-end, backend, etc. (These are very broad classifications and consist of many entities which can be broken down into simpler units.). Managing all these if they are tightly coupled is difficult. Hence micro-service architecture tends to break your functionalities into simpler, manageable units which can be managed and scaled independently. If you want to explore more about this see the article.
How to achieve this?
It can be achieved through containerization and docker helps achieve this. Since this article focuses on managing apps with docker and k8s, if you want to learn more about docker and Kubernetes see this.