East-west communication is when services/pods/containers communicate with each other inside the cluster. As you may recall, Kubernetes exposes all the services inside the cluster via both DNS and environment variables. This solves the service discovery problem inside the cluster. It is up to you to impose further restrictions via network policies or other mechanisms. For example, in Chapter 5, Configuring Microservices with Kubernetes, we established mutual authentication between the link service and the social graph service.
North-south communication is about exposing services to the world. In theory, you could expose just your services via NodePort, but this approach is beset by numerous problems, including the following:
- You have to deal with secure/encrypted transport yourself
- You can't control which pods will actually service...