<p>I'm using the GKE Ingress controller. The ingress is configured to terminate TLS, the underlying service is listening on port 80.</p>
<p>I don't need to serve my frontend externally on port 80 and would prefer that the LB created by the controller keep that port closed. I can't figure out if that's even possible, or what to change in the ingress resource definition.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: foo-ingress
  namespace: foo
spec:
  tls:
  - hosts:
    - foo.example.com
    secretName: foo-example-com-cert
  rules:
  - host: foo.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: foo-service
            port:
              number: 80
</code></pre>

Ovesh
<p>You can <a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress-xlb#disabling_http" rel="nofollow noreferrer">disable HTTP on your cluster</a> and then set <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#https_redirect" rel="nofollow noreferrer">HTTP-to-HTTPS redirect</a> by creating an additional load balancer on the same IP address.</p>
<pre><code>apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
metadata:
  name: ssl-redirect
spec:
  redirectToHttps:
    enabled: true

# add below to ingress
# metadata:
#   annotations:
#     networking.gke.io/v1beta1.FrontendConfig: ssl-redirect
</code></pre>
<p><strong>Note</strong> - While disabling you'll need to recreate your cluster for this change to be applied on the load balancer.</p>
<p>You can also refer to this <a href="https://github.com/kubernetes/ingress-gce/issues/290" rel="nofollow noreferrer">Github</a> link for more information.</p>
