- TechOps Examples
- Posts
- Kubernetes Port Forwarding Patterns
Kubernetes Port Forwarding Patterns
TechOps Examples
Hey — It's Govardhana MK 👋
Along with a use case deep dive, we identify the remote job opportunities, top news, tools, and articles in the TechOps industry.
👋 Before we begin... a big thank you to today's sponsor PERFECTSCALE
→ Another pod crashed.
→ Another node underutilized.
→ Another autoscaler… not scaling.
Sound familiar?
Learn from experts:
▸ Lukas Stiebellehner – AWS Practice Lead @ DoiT
▸ Anton Weiss – Chief Storyteller, ex-CTO, DevOps leader
→ Get practical. Get optimized.
IN TODAY'S EDITION
🧠 Use Case
Kubernetes Port Forwarding Patterns
🚀 Top News
👀 Remote Jobs
Jenzabar is hiring a Systems Administrator III
Remote Location: Worldwide
BrowserStack is hiring a Devops Engineer
Remote Location: India
📚️ Resources
📢 Reddit Threads
Not only quality technical stuff like this, I create animated visual explainers of mental models and smart ideas that help you grow in life and career.
The DARK Truth About Online Dishonesty - My latest video is out now.
Your approach towards social media will change after this.
Give it a try !
You’ve heard the hype. It’s time for results.

After two years of siloed experiments, proofs of concept that fail to scale, and disappointing ROI, most enterprises are stuck. AI isn't transforming their organizations — it’s adding complexity, friction, and frustration.
But Writer customers are seeing positive impact across their companies. Our end-to-end approach is delivering adoption and ROI at scale. Now, we’re applying that same platform and technology to build agentic AI that actually works for every enterprise.
This isn’t just another hype train that overpromises and underdelivers. It’s the AI you’ve been waiting for — and it’s going to change the way enterprises operate. Be among the first to see end-to-end agentic AI in action. Join us for a live product release on April 10 at 2pm ET (11am PT).
Can't make it live? No worries — register anyway and we'll send you the recording!
🛠️ TOOL OF THE DAY
drawdb - Free, simple, and intuitive online database diagram editor right in your browser.
Build diagrams with a few clicks, export sql scripts, customize your editor, and more without creating an account.
🧠 USE CASE
Kubernetes Port Forwarding Patterns
You're inside a dev cluster, access to the network is restricted, and the service you just deployed is acting up. There’s no LoadBalancer, no ingress controller in place, and opening up a port is not an option because the network team is either slow or says no.
This is where kubectl port-forward unblocks you.
Here are four port forwarding patterns you’ll actually use.

Download a high resolution copy of this diagram here for future reference.
1. Port Forward to Pod
Quickest way to access a container.
It sets up a direct TCP tunnel from your machine to the container port. No Service required.
Ideal for quick API testing or debugging a one-off container without having to figure out DNS or labels.
kubectl port-forward pod/k8s-pod 8080:80
2. Port Forward to Service
Ideal when multiple pods are behind a service.
Built-in load balancing (round-robin), session affinity if configured, and the ability to test service level behavior without exposing it externally.
kubectl port-forward svc/k8s-service 8080:80
Note: Even though the pod port behind the service is :50
(as shown in the image), the kubectl port-forward
command is forwarding to the Service's target port, which is commonly exposed as :80
3. Port Forward via Deployment
Often, you just deployed something via a Helm chart or GitOps pipeline, and you don’t want to manually inspect pod names.
If you know the Deployment name, this shortcut selects one of its pods using label selectors.
kubectl port-forward deploy/k8s-deploy 8080:80
4. Port Forward from Another Cluster Context
This one comes up when you're managing multiple clusters.
Maybe a dev cluster in EKS and a staging cluster in GKE and your local kubeconfig has contexts for each.
Also relevant when you have a bastion host in place and you’ve configured ProxyCommand
in your kubeconfig for that cluster.
Forwarding just works over the jump host without needing to expose anything externally.
kubectl --context=other-cluster port-forward pod/k8s-pod 8080:80
kubectl port-forward provides a practical way to debug or test workloads without creating new attack surfaces.
Give it a try next time you hit a service that’s live inside the cluster but invisible from the outside.
We are bringing a live, expert led session on optimizing your EKS clusters with Karpenter by Lukas Stiebellehner (AWS Practice Lead, DoIT) and Anton Weiss (Chief Storyteller, ex-CTO, DevOps leader)
Looking to promote your company, product, service, or event to 43,000+ Cloud Native Professionals? Let's work together.
If you’re interested in starting a newsletter like this, try out beehiiv (it’s what I use).
You get a 30 day free trial + 20% OFF for 3 months when you sign up using the link below.
Partner Disclosure: Please note that some of the links in this post are affiliate links, which means if you click on them and make a purchase, I may receive a small commission at no extra cost to you. This helps support my work and allows me to continue to provide valuable content. I only recommend products that I use and love. Thank you for your support!