Service port vs targetPort
Scenario cka-net-007 · about 6 minutes · 5 points · 6 grader checks
Expose a Deployment on a Service port that differs from the container port.
- service
- clusterip
- targetport
- networking
What you will practise
- Distinguish Service port from targetPort
- Create a ClusterIP Service with port mapping
- Verify endpoints
Start this lab
With the CLI installed and signed in, this command provisions a two nodes cluster on your Mac, applies the scenario setup and prints the task below.
goldenkube start cka-net-007Task
The task text exactly as the CLI shows it. Solve it on the cluster, then run goldenkube submit.
Requirements and details
- Certification
- CKA · Certified Kubernetes Administrator
- Domain
- Services & Networking
- Difficulty
- Easy
- Cluster topology
- Two nodes
- Cluster features
- None beyond the base cluster
- Recommended time
- 6 minutes
- Points
- 5
- Grader checks
- 6
- Kubernetes version
- 1.37
- Minimum CLI version
- 0.1.0
- Scenario version
- 1
- Published
Grading runs locally: 6 state checks read your cluster when you submit; the scenario passes when every check passes. Hints, the reference solution and the check definitions are available only inside the CLI, not on this page.
More Services & Networking labs
ClusterIP Service for a Deployment
Expose an existing Deployment inside the cluster with a ClusterIP Service that selects all its pods.
Two nodes · ~6 min · 5 points
- service
- clusterip
- endpoints
- networking
goldenkube start cka-net-001
NodePort Service with a fixed port
Expose a Deployment outside the cluster with a NodePort Service on a specific node port.
Two nodes · ~6 min · 5 points
- service
- nodeport
- networking
goldenkube start cka-net-002
NetworkPolicy: allow ingress from one app only
Restrict ingress to database pods so only client pods may reach them on a single TCP port.
Two nodes · ~9 min · 7 points
- networkpolicy
- ingress
- cilium
- networking
- security
goldenkube start cka-net-003
Ingress routing to a Service
Create an Ingress that routes a hostname and path prefix to an existing Service through the nginx IngressClass.
Two nodes · ~8 min · 7 points · Ingress
- ingress
- ingressclass
- nginx
- networking
goldenkube start cka-net-004
Independent community project, not affiliated with or endorsed by CNCF or The Linux Foundation. Lab results are practice feedback, not an exam score.