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 →
- Create a
type: LoadBalancerService (NLB on AWS) on the TCP port - Restrict with
loadBalancerSourceRangesand security groups - Use TLS at the app layer
- Or use ingress-nginx TCP services ConfigMap, or a Gateway API TCPRoute
- 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.
More on Services, Ingress and DNS
A Service has no endpoints. How do you find out why?BeginnerWhen do you use ClusterIP, NodePort, LoadBalancer and ExternalName?BeginnerTraffic to a Service works from some pods but times out from others. How do you debug it?AdvancedYou want to expose three HTTP services under one hostname with different paths. How?Intermediateingress-nginx returns 404 for a new host. What do you check?Intermediateingress-nginx returns 502 or 503 intermittently. What are the likely reasons?Intermediate