target port

The port on the pod that a Service forwards to, which may differ from the port clients use on the Service itself.

In more detail

A Service can listen on port 80 and forward to targetPort 8080, where the container actually listens. containerPort in the pod spec documents the port but does not open or restrict it. Naming ports lets an Ingress or route refer to them by name.

Example

ports:
  - name: http
    port: 80
    targetPort: 8080

Related terms

Taught in

References

Certification courses