Communicate with other workloads ΒΆ
Use service discovery to call another workload in the same environment.
To call a workload in another environment, use its ingress.
Prerequisites ΒΆ
- Your workload has configured policies for outbound traffic to the target workload.
- The target workload has configured policies for inbound traffic from your workload.
Identify the target address ΒΆ
Find the target application's name and the team it belongs to.
Use the team name wherever the examples below show <team-name>.
Call an application in your team ΒΆ
If both applications belong to the same team and run in the same environment, use:
http://<app-name>Call an application in another team ΒΆ
If the target application belongs to another team in the same environment, include its team name:
http://<app-name>.<team-name>When you move an application to another team, update callers to use its new address and update access policies on both sides.
Use full hostname when using webproxy on-premises
If your workload has webproxy enabled, you must use the full hostname for all service discovery calls:
http://<app-name>.<team-name>.svc.nais.localThis keeps calls within the environment from going through the proxy, as the environment variable NO_PROXY includes *.local.
Call the address ΒΆ
Call the workload through its internal address using HTTP from your own workload:
GET /resource HTTP/1.1
Host: <app-name>.<team-name>