Fixing 'failed to get zoekt index server endpoints' when running frontend in Docker
Overview
If your frontend logs show an error about failing to get Zoekt index server endpoints and mention missing KUBERNETES_SERVICE_HOST/KUBERNETES_SERVICE_PORT, this is because the frontend is trying to use Kubernetes service discovery. When running in Docker (not Kubernetes), those env vars are not present and the frontend cannot auto-discover Zoekt.
Cause
The frontend attempts in-cluster (Kubernetes) discovery by default.
In Docker setups there is no Kubernetes API, so KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT are undefined.
Without explicit config, the frontend cannot find the Zoekt webserver or indexer and logs an error like: "failed to get zoekt index server endpoints".
Solution
Provide the frontend with the Zoekt service endpoints via environment variables in your Docker configuration (for example, docker-compose.yml or your .env file).
Required environment variables
INDEXED_SEARCH_SERVERS— points to the Zoekt webserver (example:zoekt-webserver-0:6070).INDEXED_SEARCH_INDEXER— points to the Zoekt indexer if needed (example:zoekt-indexserver-0:6072).
Example (docker-compose environment)
environment: - INDEXED_SEARCH_SERVERS=zoekt-webserver-0:6070 - INDEXED_SEARCH_INDEXER=zoekt-indexserver-0:6072
Steps
Add the two variables above to your frontend service in docker-compose.yml or to your .env.public/.env file used by the frontend.
Restart the frontend container so it picks up the new environment variables.
Verify logs to confirm the error is gone and the frontend connects to Zoekt.
Troubleshooting
Ensure the hostnames and ports match your Zoekt containers and are reachable from the frontend container.
If you still see Kubernetes discovery errors, confirm there are no leftover settings forcing in-cluster discovery.
When to contact support
If the frontend still cannot connect after setting and verifying the variables and restarting, collect frontend logs and your docker-compose configuration and contact support.