Kubernetes: You need to know this When you do a port forward to a...

@MuthaNagavamsi
Mutha Nagavamsi⚡️@MuthaNagavamsi
7 views Jan 14, 2024 ~1 min read
Advertisement
1
Kubernetes: You need to know this

When you do a port forward to a nginx service,

you happily create a tunnel to a single pod ☺️

kubectl port-forward svc/nginx 8080:80

Now. Here's a problem:

1. Wonder what happens if traffic serving pod is terminated?
2. The browser returns "refused to connect" error.

Why?

Because the tunnel is broken.

To re-establish connection:

"You need to run port-forward command again."
"Port forwarding is useful for testing only."
"For production use-cases, always use deployments with ingress"

Hope you happily learned something.

A Repost is useful ♻️

I am Mutha Nagavamsi. And you can trust me if you want quality Kubernetes & DevOps content.

P.S. Let me know your thoughts below. It helps everyone.
Media image
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement