Kubernetes Deep Dive

Sign Up Free or Log In to participate!

How does kubernetes namespaces affect networking?

Are pods and services able to talk to each other across different kubernetes namespaces?

2 Answers

When you create a namespace with the basic configuration, it does not prevent connectivity from other namespaces. You can connect to Services in other namespaces using the DNS:  ..svc.cluster.local.    So, if you exec into a container in the default namespace and want to access a service in the test namespace, you can connect like such:  curl -i http://hello-svc.test.svc.cluster.local:8080.     If you wanted to connect to the hello-svc in the default namespace, you can just reference the service name curl -I http://hello-svc.

For your information, if you are looking for how to restrict the networking, you may want to look into the network policy for more details. (https://kubernetes.io/docs/concepts/services-networking/network-policies/)

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?