<p>I want to expose a HTTP service running in Google Container Engine over <strong>HTTPS only</strong> load balancer.</p>

<p>How to define in ingress object that I want <code>HTTPS</code> only load balancer instead of default HTTP?</p>

<p>Or is there a way to permanently drop <code>HTTP</code> protocol from created load balancer? When I add <code>HTTPS</code> protocol and then drop <code>HTTP</code> protocol, <code>HTTP</code> is recreated after few minutes by the platform.</p>

<p>Ingress:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: myapp-ingress
spec:
  backend:
    serviceName: myapp-service
    servicePort: 8080
</code></pre>

<p>In order to have HTTPs service exposed only, you can block traffic on port 80 as mentioned on this <a href="https://github.com/kubernetes/contrib/tree/master/ingress/controllers/gce#blocking-http" rel="nofollow noreferrer">link</a>:</p>

<blockquote>
  <p>You can block traffic on :80 through an annotation. You might want to do this if all your clients are only going to hit the loadbalancer through https and you don't want to waste the extra GCE forwarding rule, eg:</p>
</blockquote>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: test
  annotations:
    kubernetes.io/ingress.allow-http: "false"
spec:
  tls:
  # This assumes tls-secret exists.
  # To generate it run the make in this directory.
  - secretName: tls-secret
  backend:
    serviceName: echoheaders-https
    servicePort: 80
</code></pre>
