Skip to content

Communicate with other workloads in the same environment

This guide shows you how to communicate with other workloads inside the same environment by using their internal service address. The address is derived by using service discovery.

Prerequisites

Identify the target address

To identity the address of the workload we are communicating with, we need to know its name and what namespace its running in.

Target exists in the same namespace

If the workload you are calling is in the same namespace, you can reach it by calling its name directly using HTTP like so:

http://<name>

Target exists in another namespace

If the workload is running in another team's namespace, you need to specify the namespace as well:

http://<name>.<namespace>

Note for on-prem

If your workload has webproxy enabled, you should use the full hostname for all service discovery calls:

http://<name>.<namespace>.svc.nais.local

This is to ensure that your workload does not attempt to perform these in-cluster calls 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: <name>.<namespace>