Skip to content
CKADServices and NetworkingSingle nodeEasy

Expose a Deployment with ClusterIP and NodePort Services

Scenario ckad-net-001 · about 6 minutes · 9 points · 9 grader checks

Expose the same pods through a ClusterIP Service with port mapping and a NodePort Service on a fixed node port.

  • service
  • clusterip
  • nodeport
  • endpoints

What you will practise

  • Create Services with kubectl expose and YAML
  • Map a Service port to a different targetPort
  • Pin a NodePort and verify endpoints

Start this lab

With the CLI installed and signed in, this command provisions a single node cluster on your Mac, applies the scenario setup and prints the task below.

goldenkube start ckad-net-001

Task

The task text exactly as the CLI shows it. Solve it on the cluster, then run goldenkube submit.

In namespace "svc" the Deployment "frontend" (image nginx:1.27, 2 replicas, pod label app=frontend, nginx listens on port 80) is not exposed yet. 1. Create a ClusterIP Service "frontend-svc" that listens on port 8080 and forwards to port 80 of the "frontend" pods. 2. Create a NodePort Service "frontend-np" that listens on port 80, forwards to port 80 of the same pods and is reachable on node port 30080. Both Services must have both pods as Ready endpoints, and an HTTP request from the node exam-cp1 to frontend-svc's cluster IP on port 8080 must be answered by nginx.

Requirements and details

Certification
CKAD · Certified Kubernetes Application Developer
Domain
Services and Networking
Difficulty
Easy
Cluster topology
Single node
Cluster features
None beyond the base cluster
Recommended time
6 minutes
Points
9
Grader checks
9
Kubernetes version
1.37
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 9 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.

CKADServices and NetworkingMedium

NetworkPolicy: default deny plus one allowed client

Lock down a namespace with a default-deny ingress policy and allow a single client label to reach an API on one port.

Single node · ~8 min · 8 points

  • networkpolicy
  • default-deny
  • ingress
  • labels
  • networking

goldenkube start ckad-net-002

CKADServices and NetworkingMedium

Ingress with two paths and TLS

Expose two Services under one host with path-based Ingress rules and terminate TLS with a certificate Secret.

Single node · ~8 min · 9 points · Ingress

  • ingress
  • tls
  • secret
  • path-routing
  • networking

goldenkube start ckad-net-003

CKADServices and NetworkingEasy

Service with no working endpoints

Find why a Service does not reach the pods of a healthy Deployment and fix the Service.

Single node · ~6 min · 7 points

  • service
  • troubleshooting
  • selectors
  • endpoints

goldenkube start ckad-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.