I believe my question is pretty straightforward. I'm doing my prerequisites to install Kubernetes cluster on bare metal.
Let's say I have:
master - hostname for Docker DB container which is fixed on first node
slave - hostname for Docker DB container which is fixed on second node
Can I communicate with master from any container (app, etc.) in a cluster regardless it's running on the same node or not?
Is this a default behaviour? Or anything additional should be done?
I assume that I need to setup hostname
parameter in YAML or JSON file so Kubernetes is aware what the hostname is.
Probably this is not the factor, but I plan to use Kubespray installation method so it gets Calico networking for k8s.
Many thanks
Yes,
You can access and communication from any container in a
namespace
via hostname.Here is an example about Kubernetes
Service
configure:Deployment
configure:And from other services, for e.g your
slaver
.env
will be:It's will work inside Cluster even if you not publish External IP.
Hope this can help you.