Skip to main content
In this tutorial, we’ll set up and run two cooperating microservices on your local machine:
  1. Spring Boot “numeric” service
  2. Node.js “plus-one” service (packaged in Docker)
By the end, you’ll be able to call endpoints on the Spring Boot app that delegate to the Node.js service and observe the logs in both environments.

1. Clone and Import the Project

  1. Clone the Git repository and open it in your IDE of choice (Spring Tool Suite, IntelliJ, VSCode, etc.).
The image shows a Windows File Explorer window open to a directory named "devsecops-k8s-demo," containing various folders and files. The desktop taskbar is visible at the bottom, displaying several application icons.
  1. Import the project as a Maven project:
The image shows the Spring Tool Suite IDE with an "Import Maven Projects" dialog open, displaying options to select Maven projects from a specified directory. The desktop taskbar is visible at the bottom with various application icons.

2. Inspect the Maven POM

Open the pom.xml file at the project root. You’ll find the Spring Boot parent and starter dependencies:
For more details on Maven POM configuration, refer to the Maven Reference Documentation.

3. Review the Spring Boot Controller

The core logic resides in NumericController.java. It defines three endpoints:
Toggle the baseURL between localhost (for local debugging) and node-service (for Kubernetes) before running the app.

4. Run the Node.js “plus-one” Service in Docker

Ensure Docker is installed and running on your machine.
Make sure port 5000 is free. If another service is using this port, stop it or choose a different host port.
Execute:
You should see output similar to:

4.1 Test the Node.js Service

In a browser or via curl:
Expected response: 1000
The image shows a web browser displaying a page with the number "1000" on it. The URL in the address bar is "localhost:5000/plusone/999".

5. Run and Test the Spring Boot Application

Start the Spring Boot service:
  • In your IDE: Run As → Spring Boot App
  • Or via Maven:
By default, it listens on port 8080. Test the endpoints: Sample Responses
  1. Welcome:
  2. Compare:
  3. Increment:
The image shows a web browser displaying a local URL with the number "56" on a blank page. The browser has multiple tabs open, and there is a small video call or webcam feed in the top right corner.
In your IDE console, look for:
In the Docker container logs you’ll see:

6. Next Steps

Before deploying to Kubernetes:
  1. Switch baseURL back to
  2. Configure a Maven build and set up a Jenkins pipeline to automate the Spring Boot deployment.

Watch Video