frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Kubernetes egress control with squid proxy

https://interlaye.red/kubernetes_002degress_002dsquid.html
22•fsmunoz•2h ago

Comments

m1keil•1h ago
Pragmatic and practical. I learned something, thanks.
btreecat•1h ago
I like this approach!

I am struggling to lock down a pod in my home cluster to allow local connections to it's web UI but force all other connections through a VPN client. I'm going to investigate if I could use squid for this.

My next approach is going to involve using a sidecar.

One heads up to the author, the text based charts didn't render well on FF mobile. Text is meant to reflow based on screen size, typeface etc. I feel this is a great case for using a drawing/image instead.

brynx97•56m ago
I had challenges with split-DNS in my homelab k3s cluster trying to do this. I ended up just putting the apps in docker-compose on a VM that has static routes for my local homelab networks. I looked at tailscale to solve this since it has a kubernetes operator, but tailscale doesn't fit my use cases or work well with all of my devices.
btreecat•48m ago
> I had challenges with split-DNS in my homelab k3s cluster trying to do this. I ended up just putting the apps in docker-compose on a VM that has static routes for my local homelab networks. I looked at tailscale to solve this since it has a kubernetes operator, but tailscale doesn't fit my use cases or work well with all of my devices.

I don't need tails scale for this, seems like overkill.

I would like to better understand why my combination of marked packets and SOCK5 proxy are not fully working for certain UDP traffic. I also need to investigate if disabling ipv6 will help.

Using a VM or docker compose when I have k3s feels like admitting defeat with out understanding why.

baobun•14m ago
> I would like to better understand why my combination of marked packets and SOCK5 proxy are not fully working for certain UDP traffic

I think UDP support for SOCKS5 proxies and clients is very spotty, especially beyond DNS. Probably some bugs out there. That might go for UDP in more or less esoteric container networking setups too...

If everything else fails, I've had the least hassle with socat, as well as just chucking workloads in full vm (if in container with --network=host) and using ip routes and policies.

baobun•23m ago
Using an http proxy like squid (or apache/haproxy/caddy/envoy/trafficserver/freenginx) does sound like what you should do next.

If you need the pod to do outbound connections as well as receive incoming traffic, usually that would be two different proxies (forward and reverse, respectively). Unless you do some fancy p2p service mesh.

baobun•50m ago
Not just squid but mostly any http proxy can be run in forward mode if you want.

Caddys "magic TLS" can be neat for this if you actually do want to dynamically intercept those https connections in an easy way. It's a use-case where Caddy really shines. You can go nuts trying to configure that cleanly in squid. The docs (perhaps intentionally) make you work for the hidden knowledge of these dark arts. You also get modernities like builtin http2, http3, etc.

Nobody else bothered by squids very lengthy restart time or have I just never configured it properly?

(Not to dunk on squid, it's otherwise mostly great. Especially for its caching features)

oldsj•50m ago
I’ve been working on running agents (Claude agent sdk) on k8s this looks great to control their egress
merpkz•47m ago
You don't need a sidecar to stream logs of squid, that's anti-pattern, instead just tell squid to write logs to /dev/stdout, like this:

  logfile_rotate 0
  cache_log stdio:/dev/stdout
  access_log stdio:/dev/stdout
  cache_store_log stdio:/dev/stdout
Running squid in container is a bit tricky, since it is indeed an ancient piece of software, but I have managed to run it successfully before with squid configuration like this:

  max_filedescriptors 1048576
  pid_filename /dev/shm/squid.pid
  cache_effective_user squid
  cache_effective_group squid
and deployment has these set, - UID 31 is squid user inside of container

  securityContext:
  runAsUser: 31
  runAsGroup: 31
  fsGroup: 31
  command: ["sh","-c","squid -z && sleep 3s; squid -N"]
fsmunoz•13m ago
That's a more elegant approach. I usually just plow through obstacles, and the end result is not always ideal -- I like your approach better than the sidecar, I guess that I was using sidecars for other things and it sort of influenced my approach.

I'll try it your suggestions out and update the article, and thank you for your comment, already made sharing this worth it.

crimsonnoodle58•45m ago
We use squid for egress control on Kubernetes and have also written a controller that runs in a sidecar container next to squid that monitors for custom CRD's, such as a whitelists.

The controller then updates squid.conf and reloads squid. This allows pods/namespaces to define their own whitelists.

The great thing about using squid and disabling DNS is you can stop DNS and HTTP exfil, but still allow certain websites to be accessible.

e-Minguez•6m ago
This is great! The only downside is that the app needs to understand proxies.

Welcome to the 'next big thing' for super shoes and marathon running

https://www.nytimes.com/athletic/6562945/2025/10/31/marathon-running-super-sneaker-nike-puma/
1•TowerTall•41s ago•0 comments

Artificial Hyperintelligence Eve Is Married to Maciej Nowicki

https://i.imgur.com/gAZIoDm.jpeg
1•MaciejNowicki•56s ago•0 comments

Show HN: Kuack – Run Kubernetes jobs in visitor browsers

https://github.com/kuack-io/kuack
1•kuack•1m ago•0 comments

Why Your RAG Isn't an Agent: Building Stateful Graphs with LangGraph

https://medium.com/beyond-bits/from-linear-chains-to-cyclic-graphs-the-essential-guide-to-statefu...
1•laxmansharma•1m ago•1 comments

Google Gemini Interactive Sampler

https://research.google/blog/generative-ui-a-rich-custom-visual-interactive-user-experience-for-a...
1•AristidisG•2m ago•0 comments

Show HN: Operon – Reliable Agents Using Biological Motifs and Category Theory

https://github.com/coredipper/operon
1•coredipper•4m ago•0 comments

Azure Front Door: Implementing lessons learned following October outages

https://techcommunity.microsoft.com/blog/azurenetworkingblog/azure-front-door-implementing-lesson...
2•WalterSobchak•7m ago•0 comments

What Makes Something a Cult?

https://www.clearerthinking.org/post/what-makes-something-a-cult
1•bookofjoe•8m ago•0 comments

Show HN: Convertme2it– weight comparison tool for visualisation and funkiness

https://convertme2it.com/
1•johnboygiz•9m ago•0 comments

loveholidays Engineering Wrapped

https://download.loveholidays.com/engineering/wrapped/lh-engineering-wrapped-2025-public.html
1•gpi•10m ago•0 comments

Show HN: Dock AI Registry for AI agents to discover which MCP serves a business

https://dockai.co
1•yoannarzu•10m ago•1 comments

2025 Agentic Coding Reading List

https://www.agenticcodingweekly.com/p/2025-agentic-coding-reading-list
1•primaprashant•11m ago•0 comments

Libgodc: Write Go Programs for Sega Dreamcast

https://github.com/drpaneas/libgodc
2•drpaneas•14m ago•1 comments

Organic compounds in samples of Bennu indicate heterogeneous aqueous alteration

https://www.pnas.org/doi/10.1073/pnas.2512461122
1•PaulHoule•14m ago•0 comments

A man behind Megaupload, "I will use AI coding to bring Megaupload back"

https://xcancel.com/KimDotcom/status/2005593063478226967
1•Alifatisk•15m ago•0 comments

Digital Independence Day (German)

https://di.day/
1•doener•15m ago•0 comments

On LLMs in Programming

https://blog.danieljanus.pl/2025/12/27/llms/
1•erdaniels•17m ago•0 comments

When Not to Use Pydantic

https://ossa-ma.github.io/blog/when-not-to-use-pydantic
1•birdculture•18m ago•0 comments

Meta Gets Caught Manipulating Algorithm for Israel [video]

https://www.youtube.com/watch?v=Kdbe9lzv_B8
2•xbmcuser•21m ago•0 comments

The Not-So-Lazy Holiday Reading List

https://platforms.substack.com/p/the-not-so-lazy-holiday-reading-list
1•janandonly•24m ago•0 comments

You are absolutely right? – Christoph Nakazawa

https://cpojer.net/posts/you-are-absolutely-right
2•tilt•26m ago•0 comments

Why there hasn't been a ChatGPT moment in manufacturing

https://theshearforce.substack.com/p/why-there-hasnt-been-a-chatgpt-moment
3•klooney•27m ago•0 comments

HVIF Store

https://hvif-store.art
1•bitigchi•27m ago•0 comments

Show HN: GoSync – Local-First Sync Engine for Go and WASM

https://github.com/HarshalPatel1972/GoSync
1•harshalpatel68•29m ago•0 comments

I Saved a PNG Image to a Bird

https://simonwillison.net/2025/Aug/4/i-saved-a-png-image-to-a-bird/
2•vinnyglennon•32m ago•0 comments

Ask HN: What are your AI dev workflows in large codebases?

2•sauercrowd•34m ago•0 comments

Show HN: Vibe coding a bookshelf with Claude Code

https://balajmarius.com/writings/vibe-coding-a-bookshelf-with-claude-code/
20•balajmarius•34m ago•4 comments

From Silicon to Darude Sand-storm: breaking famous synthesizer DSPs [video]

https://media.ccc.de/v/39c3-from-silicon-to-darude-sand-storm-breaking-famous-synthesizer-dsps
2•tomduncalf•37m ago•1 comments

Web Viewer for Apple's ml-sharp with 3D Gaussian Splat Rendering in the Browser

https://kstonekuan.github.io/ml-sharp-web-viewer/
1•kstonekuan•39m ago•1 comments

Show HN: I built a runtime governance layer for LLMs. Can you break it?

1•jnamaya•41m ago•0 comments