Skip to content
Theory · Services and Ingress · lesson 2 of 8

port, targetPort, nodePort

In Docker, one entry describes the ports: -p 8080:80, the host port on the left and the container port on the right. A Kubernetes Service can have three ports, and each lives on its own level of the cluster. Beginners and interview candidates alike mix them up, so let's take them one at a time.

In this lesson

  • A site on port 8080
  • Three fields
  • What about containerPort
  • Compared with Docker
  • Common mistake
  • Key points