A simple Node.js web application designed for testing High Availability (HA) in load balancer configurations. It displays a greeting message along with the server's IP address, making it easy to verify load distribution.
app.js
: Main application file containing the Express server setup and routes.Dockerfile
: Instructions for building the Docker image of the application.package.json
: Node.js project configuration and dependencies..github/workflows/deploy.yml
: GitHub Actions workflow for continuous deployment.k8s/deployment.yaml
: Kubernetes deployment configuration.
- Displays a greeting message with the server's IP address, useful for load balancer testing.
- Includes a health check endpoint at
/health
for load balancer health probes. - Containerized using Docker for easy deployment and scaling.
- Configured for deployment to Kubernetes, ideal for testing HA setups.
-
Clone the repository:
git clone <repository-url> cd simple_web_app_ha
-
Install dependencies:
npm install
-
Run the application locally:
npm start
-
Access the application at
http://localhost:3000
To build and run the Docker image:
-
Build the image:
docker build -t simple_web_app_ha .
-
Run the container:
docker run -p 3000:3000 simple_web_app_ha
The application is set up for continuous deployment to Kubernetes using GitHub Actions. Push to the main
branch to trigger the deployment process. This setup allows for easy testing of load balancer HA configurations.
PORT
: (Optional) Port number for the application to listen on. Defaults to 3000.
- Deploy multiple instances of this application behind a load balancer.
- Access the application through the load balancer's endpoint.
- Refresh the page multiple times to verify that requests are distributed across different instances (you'll see different IP addresses).
- Use the
/health
endpoint to test load balancer health check configurations.
Please read the CONTRIBUTING.md file for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE.md file for details.