Google Kubernetes Engine Enable HTTPS for Service type
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
On GKE, a plain Kubernetes Service does not magically become an HTTPS load balancer just because you expose port 443. If you want Google-managed TLS termination and HTTP(S) load balancing, the usual solution is an Ingress or Gateway that points to a Service. If you only need raw TLS traffic forwarded to pods that already speak HTTPS, a LoadBalancer Service can expose port 443 directly.
Understand What A Service Actually Does
A Kubernetes Service primarily gives stable networking to a set of pods. On GKE, type: LoadBalancer provisions an external load balancer, but by itself it is still a layer 4 style exposure mechanism.
That means:
- it can forward TCP traffic to your pods
- it does not automatically manage certificates for you
- it does not automatically provide the full Google HTTP(S) load balancing feature set
This is why many "enable HTTPS on a Service" questions are really asking for Ingress behavior.
Option 1: Expose An App That Already Serves HTTPS
If your application terminates TLS itself, you can expose port 443 through a LoadBalancer Service.
If the pod listens on 8443 with its own certificate, the service can forward external 443 traffic straight through.
A matching deployment might look like this:
This works, but certificate management and HTTPS behavior live inside your application or sidecar, not in GKE's higher-level HTTP(S) stack.
Option 2: Use Ingress For Managed HTTPS
If you want Google-managed HTTPS termination, URL routing, and certificate integration, use Ingress with a backend Service.
Service:
Ingress:
Then attach TLS through a Google-managed certificate or your own certificate configuration, depending on the GKE feature set you are using.
In this architecture:
- the Service remains the backend target
- the Ingress handles the HTTPS-facing frontend behavior
This is the usual production-grade answer for browser-facing web apps on GKE.
Why Exposing Port 443 Alone Is Not Enough
A lot of confusion comes from assuming this is enough:
That only maps an external port number. It does not create TLS by itself. HTTPS requires certificate handling and TLS negotiation somewhere.
If your pod is not speaking HTTPS and no higher-level load balancer is terminating TLS, traffic on port 443 is just misconfigured TCP.
Port numbers do not create encryption. TLS configuration does.
Choose Based On Where TLS Should Terminate
Ask this question first:
- should TLS terminate at the pod or at Google's load balancer layer
Use a LoadBalancer Service when:
- your app already serves HTTPS itself
- you want TCP forwarding to the pod
- you are not relying on Google HTTP(S) routing features
Use Ingress or Gateway when:
- you want managed certificate handling
- you want host or path routing
- you want Google HTTP(S) load balancing features
That distinction removes most of the ambiguity from this topic.
Common Pitfalls
The biggest mistake is assuming that exposing port 443 on a Service automatically enables HTTPS. It does not.
Another mistake is using a plain LoadBalancer Service when the real requirement is managed TLS termination, redirects, or host-based routing. Those are Ingress or Gateway concerns.
People also forget that if the pod terminates TLS itself, certificate rotation and secret handling become application-side operational work.
Finally, do not mix backend HTTP and frontend HTTPS assumptions carelessly. Be explicit about where encryption starts and ends.
Summary
- A plain GKE Service can expose TCP on port 443, but that alone does not create managed HTTPS.
- If your app already serves TLS, a
LoadBalancerService can forward HTTPS traffic to it. - For Google-managed HTTPS termination, use Ingress or Gateway in front of the Service.
- Port 443 is only a port number; HTTPS requires real TLS configuration and certificates.
- Decide first where TLS should terminate, then choose Service-only or Ingress-based exposure accordingly.
Related reading
- Google Kubernetes Engine How to define one Ingress for multiple namespaces?
- Grant Kubernetes service account privileges to get pods from all namespaces
- Grep for specific text from kubernetes multiple pods
- HashiCorp Vault 403 Permission Denied issue with Kubernetes Auth
- Google Storage gs wrapper file input/out for Cloud ML?
- GPU based algorithm on AWS Lambda
- Google Maps Android API v2 - Interactive InfoWindow like in original android google maps
- Got failed to sufficiently increase receive buffer size error for cloudflared

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.