unikraft / kraftkit

Build and use highly customized and ultra-lightweight unikernel VMs.
https://unikraft.org/docs/cli
BSD 3-Clause "New" or "Revised" License
204 stars 61 forks source link

Compose add all instances in a service group #1671

Open razvand opened 1 month ago

razvand commented 1 month ago

Describe the bug

When using Compose, via kraft cloud compose up, a service group is created and all instances are added to that service group. That means both the service-providing instance and backing instances, such as databases or others are added to the service group.

However, when creating a service group, it load balances (round robins) between instances. Which means it will query both service-providing instances and backing instances.

Only the service-providing instance should be added to the service group.

Steps to reproduce

Use this PR and run:

kraft cloud console up
curl https://python.dal0.kraft.host
curl https://python.dal0.kraft.host
curl https://python.dal0.kraft.host
curl https://python.dal0.kraft.host

Some runs will show an error message:

<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>openresty</center>
</body>
</html>

Expected behavior

Only the service-providing instances should be part of the service group, allowing to be queried.

Which architectures were you using or does this bug affect?

No response

Which operating system were you using or does this bug affect?

No response

Relevant log output

No response