
☸️ Simple to Scalable: Deploying a Node.js App on Kubernetes with Health Checks, Configs & Monitoring
By Sharan Panthi
#kubernetes#minikube#health monitoring#config maps#secrets#rolling updates#scalable#prometheus#grafana#monitoring
This guide walks you through deploying a Node.js Express API to Kubernetes using Minikube, with clear, beginner-friendly steps. By the end, you’ll have a containerized app running in Kubernetes, complete with health checks, configuration management, scaling, and monitoring with Prometheus and Grafana.
🧱 1. Basic App Setup
Let’s start by setting up a simple Node.js Express API, containerizing it with Docker, and deploying it to a local Kubernetes cluster using Minikube.
Step 1: Create a Node.js Express API
Create a file named server.js
for a basic Express API with health check endpoints.
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
const message = process.env.APP_MESSAGE || 'Hello, World!';
res.send(message);
});