We have several projects within the same environment.
For instance, Project 1 with Environment=Production and Service=A_web, and Project 2 with Environment=Production and Service=A_web.
Our goal is to use QOVERY_APPLICATION_XXX_HOST_INTERNAL for communication between Service A’s REST APIs instead of relying on XXX_HOST_EXTERNAL or a defined domain.
I attempted to send curl requests, but encountered issues with host name resolution.
Do I need to use kubernetes service urls or am I missing something ?
From what I understand, you are trying to communicate between services spread into several projects.
From Qovery perspective, all services exposed variables (such as internal and public hosts) are scoped to the environment. E.q. project 1 having service 1 and 2 and project 2 having service 3 and 4, service 1 and 2 will see each other exposed variables but services 3 and 4 won’t see those.
Here’s a figure showing how your services can communicate between each other depending whether those are from the same env, project or cluster.
So Qovery exposes HOST_EXTERNAL and HOST_INTERNAL to services WITHIN the same env only.
It’s possible for you to declare by yourself HOST_EXTERNAL and HOST_INTERNAL across environments / projects.
For example, your service 1 has:
HOST_EXTERNAL=service-a.z9d173239.cargo.rocks
HOST_INTERNAL=service-a.z9d173239
Nothing prevent you from declaring in Env 2 those two variables manually (but you won’t be able to call it QOVERY_XX): dotted arrows on the figure above:
You won’t be able to use HOST_INTERNAL between two services not running on the same cluster since this is an intra cluster resolution.
Doing this might be a bit cumbersome, so I would personally user custom domains to communicate IF services have to be in different environments as it’s the more flexible setup IMO.
Now comes my questions
Why don’t you want to use HOST_EXTERNAL?
Why don’t you want to use custom domains?
Why would 2 apps not from the same env should communicate between each others?
Why, if you require two services to communicate between each others via HOST_INTERNAL don’t you put those within the same env?
So only if you really really really want to avoid using custom domains / external host, then you can declare your services internal routes ENV variables at env level (you can copy value from QOVERY_XXX_INTERNAL_HOST to your new env variable).
Given
Env 1:
Service 1: QOVERY_XXX_INTERNAL_HOST: service_1_internal_host
Service 2: QOVERY_YYY_INTERNAL_HOST: service_2_internal_host
Env 2:
Service 3: QOVERY_ZZZ_INTERNAL_HOST: service_3_internal_host
Service 4: QOVERY_AAA_INTERNAL_HOST: service_4_internal_host
Create the following variables
to Env 1:
SERVICE_3_HOST_INTERNAL=service_3_internal_host
SERVICE_4_HOST_INTERNAL=service_4_internal_host
to Env 2:
SERVICE_1_HOST_INTERNAL=service_1_internal_host
SERVICE_2_HOST_INTERNAL=service_2_internal_host
This way, you should be able to use in service 1 for example SERVICE_3_HOST_INTERNAL to reach service 3