Interview Prep/Kubernetes/Services, Ingress and DNS

You need to expose a non-HTTP TCP service such as Postgres or Kafka externally. What do you do?

IntermediateScenarioServices, Ingress and DNS
Answer

Situation read → Ingress only handles HTTP, but a partner needs TCP access.

What I'd do →

  1. Create a type: LoadBalancer Service (NLB on AWS) on the TCP port
  2. Restrict with loadBalancerSourceRanges and security groups
  3. Use TLS at the app layer
  4. Or use ingress-nginx TCP services ConfigMap, or a Gateway API TCPRoute
  5. Prefer PrivateLink or VPN for partners rather than the open internet

Why → L4 passes bytes through, and needs one LB or one port per service.

Interview tip → Mention the security angle: never expose a database publicly.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Services, Ingress and DNS