There could be need to talk to Kubernetest cluster from segregated docker containers. It’s possible to do so:
build the pipe from the container to the host machine
There are several ways to connect the host machine. the container is running together with the host, behaving like on the same subnet. you can access it through the public IP.
otherwise, more elegantly, you can leverage on
host.docker.internal to talk to the host
proxy the resources for the Kubernetes cluster
you can start a Kubernetest proxy to talk to the cluster.
kubectl proxy --port=8080 --disable-filter &
then to talk to the resources in the cluster from the container, you can do