Study. uk . com
  1. Home
  2. All questions
  3. Question 703

CKA study material · question 703 of 1000

A Service declares port: 80 and no targetPort. Which container port does traffic reach?

  1. The container's first declared port
  2. 80
  3. 8080, the conventional default
  4. None; targetPort is required
Show the answer

Answer: B. 80

targetPort defaults to the same value as port. It may also name a container's named port rather than a number, which lets the container change its port without editing the Service.

Source: Service (Kubernetes) — Defining a Service › Port definitions

Challenge yourself on this topic → Study as cards