<p>This is my ingress file , what I need is how to add https redirection settings here in ingress file , I did it using service file and it works but after to reduce costs I decided to use SINGLE ingress file which manage multiple services with SINGLE AWS CLASSIC load balancer. </p>

<pre><code>   apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      generation: 4
      name: brain-xx
      namespace: xx
    spec:
      rules:
      - host: app.xx.com
        http:
          paths:
          - backend:
              serviceName: xx-frontend-service
              servicePort: 443
            path: /
    status:
      loadBalancer:
        ingress:
        - ip: xx.xx.xx.xx
</code></pre>

R A
<p>I have managed to create <code>http</code> to <code>https</code> redirection on GKE. Let me know if this solution will work for your case on AWS: </p>

<p><strong>Steps to reproduce</strong></p>

<ul>
<li>Apply Ingress definitions</li>
<li>Configure basic HTTP ingress resource</li>
<li>Create SSL certificate </li>
<li>Replace old Ingress resource with HTTPS enabled one. </li>
</ul>

<h2>Apply Ingress definitions</h2>

<p>Follow this <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">Ingress link </a> to check if there are any needed prerequisites before installing NGINX Ingress controller on your AWS infrastructure and install it.  </p>

<h3>Configure basic HTTP ingress resource and test it</h3>

<p>Example below is Ingress configuration with HTTP traffic only. 
It will act as starting point: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-http
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  rules:
  - host: xx.yy.zz
    http:
      paths:
      - path: /
        backend:
          serviceName: hello-service
          servicePort: hello-port
      - path: /v2/ 
        backend: 
          serviceName: goodbye-service 
          servicePort: goodbye-port
</code></pre>

<p><strong>Please change this file to reflect configuration appropriate to your case.</strong></p>

<h3>Create SSL certificate</h3>

<p>For this to work without browser's security warnings you will need valid SSL certificate and a domain name. </p>

<p>To create this certificate you can use for example: <a href="https://www.linode.com/docs/security/ssl/install-lets-encrypt-to-create-ssl-certificates/" rel="nofollow noreferrer">Linode create Let's Encrypt SSL certificates</a>.</p>

<p>Let's Encrypt will create files which will be used later. </p>

<h3>Configure HTTPS ingress resource and test it</h3>

<p>By default Nginx Ingress will create a self-signed certificate if he's not provided one. To provide him one you will need to add it as a secret to your Kubernetes cluster. </p>

<p>As I said earlier the files (<code>cert.pem privkey.pem</code>) that Let's Encrypt created will be added to Kubernetes to configure HTTPS. </p>

<p>Below command will use this files to create secret for Ingress:</p>

<p><code>$ kubectl create secret tls ssl-certificate --cert cert.pem --key privkey.pem</code></p>

<p>This Ingress configuration support HTTPS as well as redirects all the traffic to it: </p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-https
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
  tls:
  - secretName: ssl-certificate
  rules:
  - host: xx.yy.zz 
    http:
      paths:
      - path: /
        backend:
          serviceName: hello-service
          servicePort: hello-port
      - path: /v2/ 
        backend: 
          serviceName: goodbye-service 
          servicePort: goodbye-port 
</code></pre>

<p><strong>Please change this file to reflect configuration appropriate to your case.</strong></p>

<p>Take a look at this fragment which will enable HTTPS and redirect all the traffic to it: </p>

<pre><code>    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
  tls:
  - secretName: ssl-certificate
</code></pre>

<p>Apply this configuration and check if it worked for you. </p>

<p>Below is part of curl output which shows that connecting to <code>http://xx.yy.zz</code> gives redirection to <code>https://xx.yy.zz</code></p>

<pre><code>&lt; HTTP/1.1 308 Permanent Redirect
&lt; Server: openresty/1.15.8.2
&lt; Date: Fri, 20 Dec 2019 15:06:57 GMT
&lt; Content-Type: text/html
&lt; Content-Length: 177
&lt; Connection: keep-alive
&lt; Location: https://xx.yy.zz/
</code></pre>
