Testing APIs Running Inside Kubernetes
How to reach a cluster-internal service from a browser-based API client — port-forwarding to localhost, and what Agent does once the service is reachable.
A service running inside a Kubernetes cluster isn't reachable from your machine at all by default — it has a cluster-internal address that only makes sense from inside the cluster's own network. Before a browser-based API client (or any client) can reach it, something has to bridge that gap first.
The most reliable path: port-forward
kubectl port-forward is the straightforward way to make a cluster-internal service reachable from your machine, regardless of your network setup:
kubectl port-forward svc/my-api 8080:80This maps port 8080 on your machine to port 80 on the my-api service inside the cluster, for as long as the command keeps running. Once it's up, http://localhost:8080 on your machine reaches that service — at that point, it's a plain localhost API as far as anything trying to test it is concerned, same restriction as any other localhost endpoint.
If your machine is already on the cluster's network
If you're connected to the cluster's network directly (a VPN into the cluster, or running from a machine inside it), a cluster-internal service may be reachable at its in-cluster address without port-forwarding at all. This depends entirely on your cluster's networking setup — it's not something a testing tool can turn on if the underlying network path doesn't exist.
Where Agent fits
Whichever way the service becomes reachable from your machine — port-forwarded to localhost, or reachable directly over the cluster's network — AlleForge Agent bridges it into your browser tab the same way it does any other private destination: a local encrypted tunnel between your browser and your machine, with the actual request made outside the browser's sandbox.
A concrete example
# Forward the service to a local port
kubectl port-forward svc/orders-api 8080:80
# In another terminal, confirm it's actually listening
curl http://localhost:8080/healthIf the curl works, Agent (running) can reach it the same way — send the request from AlleForge to http://localhost:8080/health as you normally would.
What this doesn't fix
Agent bridges the browser-to-local-machine boundary. It doesn't set up cluster networking, fix a misconfigured service, or replace kubectl port-forward — if curl can't reach the service from your machine, nothing at the browser-client layer will either. Start there.
See this in AlleForge
See AlleForge Agent