To test out the balancing capabilities of Oakestra, we can deploy a simple Nginx server and a client that sends requests to a Round-Robin balanced semantic IP assigned to the server. When scaling up the Nginx service, the client requests will automatically be balanced across the service’s instances.
Oakestra CLI Tool
In this guide we’ll use the comprehensive Oakestra CLI toolkit to interact with the Oakestra-managed infrastructure.
For this example, we will create a microservice named curlv4 using a curlimages/curl:7.82.0 docker image. This service performs a curl request to an Oakestra semantic IP address of our choice (10.30.55.55), then fails. Oakestra will detect the failure and automatically re-deploy the instance indefinitely, and we should observe continous curl requests everytime the service is successfully deployed.
Oakestra Dashboard
You can choose the IPv4 addresses for each service arbitrarily. In your deployment descriptor, you can type an IP address in the form 10.30.X.Y next to the associated balancing policy. In this example, "rr_ip": "10.30.55.55" binds 10.30.55.55 to the round-robin policy for that service. Every time we perform a request towards that address, the packets are balanced across its instances using round-robin balancing. More details are available in the Networking section of the manuals.
Together with the curlv4 service, we deploy a server microservice named nginx using the nginx:latest docker image. This service will be assigned a Round-Robin semantic IPv4 address,10.30.55.55 (as well as a Round-Robin semantic IPv6 address fdff:2000::55:55, but this is optional).
Good to know
To find out more about networking, please refer to the Networking section.
You can use the following SLA template to deploy the services (if you want to have custom setup, feel free to modify the SLA file):
Use the following command to check the instance’s logs:
You’ll see the nginx logs of both instances and the effects of the resulting balancing.
For this example, we used the command oak s i 672cf97ff7728660d15a5852
As you can see both instances got requests from the single client we have, even if the client is always using the same IP address.
Oakestra Dashboard
You can also monitor the services and their instances using the Oakestra Dashboard. To access the dashboard, open your browser and navigate to http://<your-oakestra-root-ip>. See the Dashboard section for more information.