---
kind: Service
apiVersion: v1
metadata:
  name: ingress-nginx
  namespace: ingress-nginx
  labels:
    app: ingress-nginx

    # NOTE(opadron): Do *NOT* add these labels; for *some* reason, they cause
    #
    #   - The nginx ingress controller to add a firewall rule to each node in
    #     the cluster that blocks all traffic on the port that AWS ELB pings as
    #     part of its health check on the cluster's instances, causing...
    #
    #   - All the AWS ELB health checks to fail, causing...
    #
    #   - The ELB running on top of the cluster to stop accepting traffic,
    #     causing...
    #
    #   - (Almost) everything running on the cluster to stop accepting traffic.
    #
    # app.kubernetes.io/name: ingress-nginx
    # app.kubernetes.io/part-of: ingress-nginx

  annotations:
    service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: '*'
    service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'

spec:
  type: LoadBalancer
  selector:
    app: ingress-nginx

    # NOTE(opadron): See above warning.
    # app.kubernetes.io/name: ingress-nginx
    # app.kubernetes.io/part-of: ingress-nginx

  ports:
  - name: http
    port: 80
    targetPort: http
  - name: https
    port: 443
    targetPort: https
    #   - name: ssh
    #     port: 22
    #     targetPort: 22
    #     protocol: TCP
