How to expose kubernetes service on prem using 443/80
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
On-prem Kubernetes clusters do not automatically get a cloud load balancer for ports 80 and 443, so exposing services requires an explicit edge design. In practice, the cleanest approach is usually an ingress controller listening on 80 and 443, plus either MetalLB or an external reverse proxy or firewall rule that forwards traffic into the cluster.
Separate the Problem into Layers
There are two different jobs to solve:
- expose an internal application inside the cluster
- expose the cluster edge on standard web ports
A Service object alone only solves internal or node-level networking. To serve public HTTP or HTTPS on 80 and 443, you typically add an ingress controller in front of the application.
Backend Service for the App
Start with a normal internal Service for the workload.
ClusterIP is appropriate because the service does not need to be exposed directly to the outside world. The ingress controller will talk to it inside the cluster.
Add an Ingress Resource
The ingress defines which hostnames and paths should route to that service.
If you want HTTPS termination at the ingress layer, add TLS:
This still does not expose 80 and 443 to the outside network by itself. It defines routing once traffic reaches the ingress controller.
Give the Ingress Controller an On-Prem Address
In cloud environments, LoadBalancer services are often automatic. On-prem, you need something that can provide or forward a reachable IP.
One common option is MetalLB. It lets LoadBalancer services work on bare metal or local networks by assigning addresses from a configured pool.
A typical ingress controller service with MetalLB looks like this:
If MetalLB assigns an address such as 192.168.1.240, external traffic to that IP on 80 and 443 reaches the ingress controller.
Alternative: External Reverse Proxy or Firewall NAT
If you do not want MetalLB, an external reverse proxy or firewall can forward traffic from 80 and 443 to a NodePort or directly to ingress-controller nodes.
That pattern often looks like this:
- ingress controller runs in the cluster
- ingress service is exposed as
NodePort - firewall or load balancer forwards public
80and443to those node ports
Example ingress controller service:
An edge firewall can then map external 80 to 30080 and external 443 to 30443 on one or more cluster nodes.
DNS and TLS Still Matter
Even when networking is correct, the service is not truly usable until DNS and certificates match the public entry point.
Typical checklist:
- point DNS at the external IP or proxy
- ensure port
80and or443are open on the firewall - install the correct TLS secret if HTTPS is terminated in Kubernetes
- verify the ingress hostname matches what clients will request
Without these pieces, the cluster may be reachable but still fail at the application level.
Common Pitfalls
The most common mistake is exposing the application Service directly and expecting standard public 80 and 443 behavior without an ingress or other edge component. Another is using LoadBalancer on-prem without MetalLB or an equivalent network implementation, which leaves the service pending forever. Teams also often forget that DNS, certificates, and firewall rules are part of service exposure, not optional extras. A final issue is treating NodePort as a full internet-facing solution when it is usually only one piece of a larger edge-routing design.
Summary
- On-prem Kubernetes needs an explicit edge design to expose services on
80and443. - A common pattern is
ClusterIPbackend service plus ingress controller plus MetalLB or external forwarding. - '
Ingresshandles host and path routing, not public reachability by itself.' - MetalLB can provide on-prem
LoadBalancerbehavior for ingress controller services. - DNS, TLS, and firewall rules must all line up with the network exposure plan.
Related reading
- How to expose multiple kubernetes services trough single azure load balancer?
- How to expose multiple port using a load balancer services in Kubernetes
- How to extract the helm values.yaml of my existing helm deployment Name prime-gitlab
- How to find out the ip address of the nodePort
- How to find the url of a service in kubernetes?
- How to fix Helm installation failed complaning about a nil pointer evaluating interface on fullnameOverride
- How to fix issue of 'Unable to connect to the server EOF' Kubernetes - Kubectl
- How to fix The kubelet is unhealthy due to a misconfiguration of the node in some way required cgroups disabled error

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.