Kubernetes ft. Spring Boot (Series) - Creating the services #1
There is life after building the
In this series we'll create a Kubernetes environment that will manage 2 simple Spring Boot applications that will communicate with each other through HTTP requests.
We'll have a
calling application and a
receiver application. A client will send a request to the
calling application, this will then send a request to the
receiver application and the response will be returned all the way to the client.
For the sake of simplicity, the request from the
client will be passed over to the
receiver service without doing any business logic and will be returned as a response all the way back to the
With the help of Spring Initializr creating the applications is quite straightforward. We'll create two
Gradle projects with Java 11 and we'll only need the
Spring Web dependency added to the projects.
- We'll configure the server to run on port
9991and have as a context path
/caller. So the client's requests will be sent to:
- Defining the request body DTO
- It will also need a REST controller to be able to receive requests from the
- The service that will actually send the request to the
- Server configuration for port and context path
- Creating the endpoint on the
Simulate being the
client by sending a request through Postman to the
To be continued
In the next post we'll deploy them to a
K8s cluster to see how we can interact with our services in a separate environment rather than
localhost. See you there!
Stay tuned! 🚀