<p>I'm trying to create an AWS ELB through a kubernetes Service of type LoadBalancer and I can't figure out the combination of annotations needed to achieve the result I need.</p>

<p>This is the closest I can get:
<a href="https://i.stack.imgur.com/qQV0c.png" rel="nofollow noreferrer">AWS ELB generated when deploying the yaml below</a></p>

<p>Using this service definition:</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: my_app
  namespace: my_namespace
  labels:
    dns: route53
  annotations:
    domainName: my_app.my.domain.com
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:iam::accountId:server-certificate/CertificateName"
    service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
spec:
  type: LoadBalancer
  selector:
    app: my_app
    version: my_version
  ports:
    - protocol: TCP
      port: 80
      targetPort: non_secure_port_name
      name: http
    - protocol: TCP
      port: 443
      targetPort: secure_port_name
      name: https
</code></pre>

<p>The problem is that I'd need the instance protocol for the https port to be https as well, <a href="https://i.stack.imgur.com/av4Fg.png" rel="nofollow noreferrer">like this</a></p>

<p>By editing the ELB manually, everything works like a charm but I'd like to be able to achieve the configuration in the 2nd picture through the .yaml configuration of my Kubernetes Service so no manual tweaks are needed for my services to work as expected when deployed.</p>

<p>Is it possible? What annotation or particular configuration am I missing?</p>

<p>Here's the incantation for terminating TLS at ELB using the AWS cert</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
    service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:foo
    service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
  labels:
    k8s-addon: ingress-nginx.addons.k8s.io
  name: ingress-nginx
spec:
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: http
  - name: https
    port: 443
    protocol: TCP
    targetPort: http
  selector:
    app: ingress-nginx
  type: LoadBalancer
</code></pre>

<p>If you want to force SSL you do that at the ingress resource definition with <code>ingress.kubernetes.io/ssl-redirect</code> annotation</p>
