Better Practices
Published in

Better Practices

Deploying a scalable web application with Docker and Kubernetes

Learn how to test and deploy a Node.js app using containers and an orchestration engine

Photo by chuttersnap on Unsplash

We’re already seeing tremendous benefits with Kubernetes — improved engineering productivity, faster delivery of applications and a simplified infrastructure.

Teams who were previously limited to 1–2 releases per academic year can now ship code multiple times per day!

Chris Jackson, Director for Cloud Platforms & SRE at Pearson

Why use containers?

Photo by Erwan Hesry on Unsplash
Photo by Markus Spiske on Unsplash

How do containers work?

Container image

Container

Container orchestration

contain your excitement

Every service gets the flexibility of configuring how to run their services. So services engineers can focus on building the application while platform engineers can focus on how to build and deploy automatically.

Docker takes over the responsibility of configuring the environment and standardising the deployment pipeline. This gives us faster deployment and scaling time because the build happens only once during CI.

Saswat Das, Platform engineer at Postman

Why use Kubernetes?

The Kubernetes master is responsible for maintaining the desired state for your cluster

Kubernetes simplifies the deployment process for your application, and provides tools to make your application super robust.

With Kubernetes, you get rolling deployments with no downtime, service discovery, and the flexibility to change cloud providers easily.

Dan Pastusek, Founder of Kubesail

A Postman recipe for deploying a Node application with Docker and Kubernetes

Use containers to test and deploy the app

Develop the app

1. Transform the original URL

2. Redirect the new URL back to the original URL

Import the catURL collection and catURL-local environment from the Postman templates

Test the app

If the tests don’t pass, your code doesn’t deploy.

Deploy the app

Configuration file for backend deployment
It’s a litter bit amazing.
Continue testing your production APIs to ensure they’re functioning properly

A final thought about containers and orchestration

--

--

For individual engineers to the largest teams, Better Practices is intended to distill knowledge from the Postman community. This is a place to learn about modern software practices together! Read more: https://medium.com/better-practices/introducing-better-practices-e9cf14cf0c88

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store