DEV Community

Cover image for Kubernetes Services & Networking — My Week 15 Hands-On Journey (ClusterIP, NodePort, LoadBalancer)
Ebelechukwu Lucy Okafor
Ebelechukwu Lucy Okafor

Posted on

Kubernetes Services & Networking — My Week 15 Hands-On Journey (ClusterIP, NodePort, LoadBalancer)

If you’ve ever deployed an app on Kubernetes and thought:
“Okay… my Pods are running, but how do I actually reach them?”
Then you’re exactly where I was this week.
In this hands-on lab series, I explored one of the most important

Kubernetes concepts:
Services & Networking

I didn’t just read about it, I built, broke, tested, and fixed things myself.
Let me walk you through what I learned
Why Kubernetes Services Matter (Simple Explanation)

Think of Pods like people living in apartments:

They come and go (ephemeral)
Their “room numbers” (IP addresses) change
You can’t rely on reaching them directly

Kubernetes Services act like a reception desk:

One stable address
Routes requests to the right Pods
Only sends traffic to “healthy” Pods

Lab 7 — ClusterIP (Internal Communication)

What I Did

Created an NGINX Deployment with 2 replicas
Added labels (app: nginx) to connect Pods with Services
Created a ClusterIP Service

Verified:

Service IP
Endpoints
DNS resolution inside the cluster
Tested communication using a BusyBox test pod
Key Commands I Used
kubectl apply -f nginx-deployment.yaml
kubectl apply -f clusterip-service.yaml

kubectl get svc
kubectl get endpoints

kubectl run tester --image=busybox --restart=Never -- sleep 3600
kubectl exec -it tester -- wget -qO- http://nginx-clusterip
What I Learned
ClusterIP is internal-only (perfect for microservices)
Services use labels + selectors to find Pods
Only READY Pods receive traffic
Issue I Faced
Initially confused why traffic failed

How I Solved It

Checked:
kubectl describe svc nginx-clusterip
kubectl get endpoints

Realized:
Service works only if labels match Pods

Lab 8 — NodePort (External Access)

What I Did
Created a NodePort Service
Exposed my app on port 30080
Checked node IP
Tried accessing from browser
Key Commands
kubectl apply -f nodeport-service.yaml
kubectl get svc nginx-nodeport
kubectl get nodes -o wide

Issue I Faced
curl http://localhost:30080
❌ Failed to connect

Why It Happened

I was using:
WSL + kind cluster
NodePort doesn’t always work directly on localhost in this setup

How I Solved It

Option 1: Port Forward (Worked instantly)
kubectl port-forward svc/nginx-nodeport 8080:80

Then opened:
http://localhost:8080
Option 2: Internal Testing (Best Practice)
kubectl run tester --image=busybox --restart=Never -- sleep 3600
kubectl exec -it tester -- wget -qO- http://nginx-nodeport

What I Learned
NodePort exposes app via:
:

Works great for:
Local labs
On-prem setups
But depends on the network environment

Lab 9 — LoadBalancer (Cloud Simulation)

What I Did
Created a LoadBalancer Service
Applied it in my local environment

Observed:
EXTERNAL-IP stayed
Key Commands
kubectl apply -f loadbalancer-service.yaml
kubectl get svc
Issue I Faced
EXTERNAL-IP:

Why It Happened
I was NOT using cloud (like Microsoft Azure or AWS)
LoadBalancer needs a cloud provider integration
How I Solved It
Used Port Forward to simulate access
kubectl port-forward svc/nginx-loadbalancer 8080:80

Learned Alternative Options
Use:

Minikube tunnel
MetalLB (bare metal)
Or a real cloud like Microsoft Azure (AKS)

What I Learned
LoadBalancer gives:
Public IP
Internet access
But only works with:

Cloud providers (AKS, EKS, GKE)
Real DevOps Insight (This Changed My Understanding)
Before this lab, I thought:
“Services are just networking configs…”

Now I understand:
Services are the core of Kubernetes communication
Everything depends on them:
Microservices
APIs
External traffic
Load balancing
Real-World Application
Here’s how this applies in real DevOps work:
ClusterIP
→ Backend services talking internally
NodePort
→ Testing apps before production
LoadBalancer
→ Production apps exposed to users

My Reflection

The biggest lesson for me:
Kubernetes is not just about running containers…
It’s about making them reachable, scalable, and reliable
This lab made everything click.

Final Thoughts

If you're learning Kubernetes:
Don’t just watch tutorials
Break things. Test things. Fix things.
That’s where real understanding comes from.

Let’s Connect
If you're also learning DevOps or Kubernetes, I’d love to connect and share ideas!
What part of Kubernetes confused you the most?
Have you tried exposing apps yet?
Drop a comment

kubernetes #devops #cloudcomputing #learninginpublic #100daysofcode #azure #containers #docker #beginners

Top comments (0)