Sitemap
Press enter or click to view image in full size
Image generated by Google Gemini

Kubernetes Services Unveiled: Exposing Your Apps Like a Pro

--

Kubernetes is a powerhouse for managing containerized apps, but deploying your app isn’t enough — it needs to be accessible! Whether you’re connecting microservices internally or exposing your app to the world, Kubernetes Services are your go-to tool. Let’s break down the four key service types — ClusterIP, NodePort, LoadBalancer, and ExternalName — in a way that’s simple, practical, and ready to apply.

ClusterIP: The Internal Communicator

What it does: ClusterIP keeps things private, exposing your deployment only within the Kubernetes cluster.

Why use it?

  • Perfect for testing apps in a local environment.
  • Ideal for internal microservices chatting with each other — like a catalogue service talking to a payment service.

How it works: It assigns a unique IP within the cluster and handles load balancing across your pods using a round-robin method. Think of it as a private party — only cluster members are invited.

Key takeaway: ClusterIP is your go-to for internal-only access. No internet exposure here!

Press enter or click to view image in full size
My cluster was up and running
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

Behind the hood, ClusterIP also acts as a Load balancer…it balances traffic evenly.

NodePort: A Peek Outside the Cluster

What it does: NodePort opens a specific port (between 30,000–32,000) on every node in your cluster, letting external traffic reach your app.

Why use it?

  • Great for quick external access during development or testing.

How it works: External users hit the node’s public IP plus the NodePort (e.g., node-ip:32001). Kubernetes then routes this traffic to the ClusterIP service, which spreads it across your pods.

Catch: It’s not production-ready. Node IPs and ports aren’t user-friendly and can change. Imagine asking users to access 192.168.1.10:32001 — not exactly memorable!

Get Sarat Chandra Motamarri’s stories in your inbox

Join Medium for free to get updates from this writer.

Key takeaway: NodePort is a handy stepping stone for external access, but it’s not for the big leagues.

Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size
Press enter or click to view image in full size

LoadBalancer: The Production Superstar

What it does: LoadBalancer exposes your app to the internet with a dedicated load balancer from your cloud provider (like AWS’s Elastic Load Balancer).

Why use it?

  • The go-to choice for production apps needing public access.

How it works: Kubernetes talks to your cloud provider to spin up a load balancer, which gets a stable DNS name (e.g., app.yourdomain.com). Traffic hits the load balancer, which distributes it across your nodes and pods.

Pro tip: Pair it with a DNS service like AWS Route 53 for a user-friendly domain name. No more clunky IPs and ports — your users can just type www.yourapp.com.

Key takeaway: LoadBalancer is the professional way to go public, offering stability and ease of access.

Press enter or click to view image in full size
Press enter or click to view image in full size

Copy the DNS name of the created LoadBalancer and navigate to Route53 and create a record as shown below.

Press enter or click to view image in full size
Subdomain I later changed to kops, not www
Press enter or click to view image in full size
Press enter or click to view image in full size

ExternalName: The External Connector

What it does: ExternalName lets your Kubernetes apps talk to services outside the cluster, like an external database.

Why use it?

  • Seamlessly integrate external resources without running them in Kubernetes.

How it works: It creates a CNAME record, mapping a service name in your cluster to an external DNS name (e.g., db.example.com). If the external URL changes, you only update the ExternalName definition — no need to tweak every app using it.

Scenario: Imagine your product manager asks to integrate an external database. With ExternalName, you map it once, and all your apps can use it without manual updates.

Key takeaway: ExternalName simplifies connecting to the outside world with minimal hassle. (Kubernetes service annotations for loadbalancer github)

Why This Matters

Kubernetes Services are the bridge between your app and its audience — whether that’s other services in the cluster or users on the internet. Here’s the quick rundown:

  • ClusterIP: Internal only, great for microservices.
  • NodePort: External access for testing, but not production-ready.
  • LoadBalancer: The production choice for public-facing apps.
  • ExternalName: Connects your cluster to external services effortlessly.

Feel free to connect with me on LinkedIn and GitHub

--

--