Forwarding container ports
In the previous chapters, you learned how to work with the Kubernetes services to forward the container port internally and externally. Now, it's time to take it a step further to see how it works.
There are four networking models in Kubernetes, and we'll explore the details in the following sections:
- Container-to-container communications
- Pod-to-pod communications
- Pod-to-service communications
- External-to-internal communications
In this section, we will run two nginx web apps in order to demonstrate how these four models work. The default port of nginx in Docker Hub (https://hub.docker.com/_/nginx) is
80. We will then create another nginx Docker image by modifying the nginx configuration file and Dockerfile from ...