Deploying a Web Application to Kubernetes – Basics

Introduction

I have previously written few posts on Kubernetes basics. There we covered some building blocks and how to get started with it.

Here is the high level information about the core Kubernetes resources:

  • Pod: Manages container and container environment.
  • Deployment: Manages pods and rolling updates.
  • Service: Manages network routing and DNS names.

you can read more details about these from the following earlier posts:

We have done some demos in those posts. However, now I want to kind of combine all those learning by deploying a web application to kubernetes. This will help us to have a base line for those Kubernetes basics.

Setting the Scene

I have a very simple web application. The application is built around Accounting domain and it has a frontend written in Angular, a backend API built using .NET Core and a Postgres database for storage. You can use any other application, written in different programming langauges and deployed to Kubernets principles will be same.

For this application, we have one docker image for web part (angular frontend and .NET Core Web API) and the second image for Postgres database and we also have a docker-compose file for the application. Its a very simple design and will help us to focus more on kubernetes part.

We will not be discussing application code or docker part and I am assuming that you are already familiar with docker and docker-compose.

For those of you who want to get more details about how to build and containerize such application, can check out the following two books:

I took the application code and docker files for Accounting Web Application as a starting point and copied it for folder for this post. Here is how the new folder looks like (this is git repository from earlier post, you can clone it on your machine). I also created a new folder k8s which will hold our YML files for kubernetes:

Subscribe to continue reading

Subscribe to get access to the rest of this post and other subscriber-only content.

Comments are closed.