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: 8080Related terms
- Kubernetes Service — The Kubernetes object that gives a changing set of pods one stable name and address, and spreads traffic across the ready ones.
- port — A number from 1 to 65535 that picks out one service on a machine, such as 22 for SSH or 80 for plain web traffic.
- NodePort — A Service type that opens the same port, by default in the range 30000 to 32767, on every node and forwards it to the Service.
Taught in
- Running, And Still Down — Certified Kubernetes Application Developer (CKAD) Exam Prep
- API Deprecations And Migrations — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Debugging Applications In Kubernetes — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Empty Endpoints — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Services And Networking: Timed Drill And Checkpoint — Certified Kubernetes Application Developer (CKAD) Exam Prep
- A Name That Outlives Its Pods: Services And DNS — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- From Docker To Desired State — Kubernetes: Production-Grade Container Orchestration
- Namespaces, Labels And Declarative Manifests — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: Probes, Logs, exec And CrashLoopBackOff — Kubernetes: Production-Grade Container Orchestration
- ClusterIP, Selectors, EndpointSlices And DNS — Kubernetes: Production-Grade Container Orchestration
- NodePort, LoadBalancer And ExternalName — Kubernetes: Production-Grade Container Orchestration
- Ingress: Controllers, Hosts, Paths And TLS — Kubernetes: Production-Grade Container Orchestration
- Troubleshooting: DNS, Empty Endpoints And Broken Routes — Kubernetes: Production-Grade Container Orchestration