<p>I'm trying to deploy a Docker container that exposes a simple Docker server, a clone of the httpbin.org service in the Google Container Engine (Kubernetes).</p>

<p>This is the Service definition I'm using:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: httpbin
  labels:
    app: httpbin
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 3000
    protocol: TCP
name: http
selector:
  app: httpbin
</code></pre>

<p>The ingress is defined as: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: httpbin-tls
  annotations:
    kubernetes.io/ingress.global-static-ip-name: "http-bin-static-ip"
spec:
  tls:
  - secretName: positive-ssl
  backend:
    serviceName: httpbin
    servicePort: 80
</code></pre>

<p>In the Services/Ingress dashboards I can see two IPs, the one bound directly to the Service (ephemeral) and the Static IP bound to the Ingress. Calling them both directly on port 80 works like a charm.</p>

<p>After that done, I've created an A record for the Static IP and ensured the Load Balancer was OK in the GKE dashboard:</p>

<p><a href="https://i.stack.imgur.com/hWKEO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hWKEO.png" alt="GKE Load Balancers Dashboard"></a></p>

<p>The HTTPS endpoint should be working according to a lot of tutorials and manuals I checked, but it's not! Every call to HTTPS gets redirected (301) to the HTTP port.</p>

<p>The output from the curl -v:</p>

<pre><code>* Rebuilt URL to: https://httpbin-1.mydomain.com/
*   Trying XXX.XX.XX.XX...
* TCP_NODELAY set
* Connected to httpbin-1.mydomain.com (XXX.XX.XX.XX) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: mydomain.com
* Server certificate: COMODO ECC Domain Validation Secure Server CA 2
* Server certificate: COMODO ECC Certification Authority
&gt; GET / HTTP/1.1
&gt; Host: httpbin-1.mydomain.com
&gt; User-Agent: curl/7.51.0
&gt; Accept: */*
&gt; 
&lt; HTTP/1.1 301 Moved Permanently
&lt; Date: Fri, 03 Mar 2017 18:01:23 GMT
&lt; Transfer-Encoding: chunked
&lt; Connection: keep-alive
&lt; Cache-Control: max-age=3600
&lt; Expires: Fri, 03 Mar 2017 19:01:23 GMT
&lt; Location: http://httpbin-1.mydomain.com/
&lt; 
* Curl_http_done: called premature == 0
* Connection #0 to host httpbin-1.mydomain.com left intact
</code></pre>

<p>I did not create any auto redirection of any kind, followed strictly the official manuals (from Kubernetes and GKE) but I'm unable to go beyond this. Even tried to recreate the whole stack from ground up, a new cluster, new load balancers, but got the same results.</p>

<p>What am I missing? Tks!</p>

<p>AFAIK GLB can not do correct forwarding for you. You will have to use a webserver in the service after the ingress to solve that scenario. </p>

<p>Your current behavior seems to be caused by </p>

<p><code>annotations:
    kubernetes.io/ingress.global-static-ip-name: "http-bin-static-ip"</code></p>

<p>Remove that part from your ingress and you should see your https session be terminated at your ingress.</p>
