Build and Deploy an Angular, Node.js, PostgresQL and Microservices App on Azure Kubernetes

All in one. Learn everything in this tutorial from scratch.

What you will learn in this tutorial

  1. Microservices
  2. Angular
  3. NodeJs
  4. PostgresQL
  5. Kubernetes
  6. Azure Cloud

Pre-requisites for this tutorial

You need to have these software installed on your system before get started with this tutorial.

  1. Angular Cli (Latest version)
  2. Docker
  3. VS Code (You can choose any Editor you like)
  4. Postgres Database— PgAdmin GUI

Node.js API (with Postgresql)

I will create simple backend in Node.js using Express.

Image for post
Image for post
Image for post
Image for post

Angular

Angular application provide single page application. Single page application give us great user experience, very reactive application and it feels like mobile application.

Image for post
Image for post

Expected frontend app

Image for post
Image for post
Image for post
Image for post

Microservices

For microservices, we make use of Docker.

What is Docker?

Docker provides the ability to package and run an application in a loosely isolated environment called a container. Container is linux based small size virtual machine that isolate your application and all the dependencies. The isolation and security allow you to run many containers simultaneously on a given host. You can even run Docker containers within host machines that are actually virtual machines!

What are Microservices?

  • Loosely coupled
  • Independently deployable
  • Organized around business capabilities
  • Owned by a small team
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Microservice Deployment

For microservices deployment there are some pre-requisites. Please make sure before starting this section, you should have these.

  1. Docker Account — You can create an account on Docker hub using the following link. https://hub.docker.com/signup
  2. Azure Cli — You can install azure cli using following link https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
  3. Kubectl — You can install kubectl using following link https://kubernetes.io/docs/tasks/tools/install-kubectl/

What is Kubernetes?

Kubernetes, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.

What is Kubernetes Cluster?

A Kubernetes cluster is a set of nodes that run containerized applications. Containerizing applications packages an app with its dependences and some necessary services. … Kubernetes clusters allow containers to run across multiple machines and environments: virtual, physical, cloud-based, and on-premises.

Image for post
Image for post
  1. Services
  2. ConfigMap
  3. Secrets
  4. Ingress
  5. StatefulSet
  6. Volumes
  7. Pod

Postgres Deployment

Let’s get to the point and start implementing. I will create deployment file for Postgres in my tutorial Node.js application. I will write deployment and service definition in same file but as i mentioned secret component which is used for secret keys. As we do not expose our secret key in deployment file.

Image for post
Image for post

Node.js App Deployment

Nodejs application required image so we need to push the local image to Docker hub. You can build the image and tag image with repository name

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Angular App Deployment

In angular application, i will replace http://localhost:3000/ URL with Node.js microservice External API. We should write a separate service for that but i will use URL and work with that for simplicity.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Consultant Development having expertise in NodeJs, Angular, C# .Net Core and Microservices. 🥳 👌

Get the Medium app