#
#  Author: Hari Sekhon
#  Date: 2021-05-19 13:24:51 +0100 (Wed, 19 May 2021)
#
#  vim:ts=2:sts=2:sw=2:et
#
#  https://github.com/harisekhon/Kubernetes-configs
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn
#  and optionally send me feedback to help improve or steer this or other code I publish
#
#  https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
#            S e l e n i u m   G r i d   R o u t e r   I n g r e s s
# ============================================================================ #

---
#apiVersion: extensions/v1beta1  # old
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: selenium-router
  namespace: selenium
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "true"
    # XXX: Edit to make available externally or apply common ingress.nginx.patch.yaml with shared IP list eg. Cloudflare
    nginx.ingress.kubernetes.io/whitelist-source-range: |
      10.0.0.0/8,
      172.16.0.0/16,
      192.168.0.0/16
spec:
  tls:
    # XXX: Edit
    - hosts:
        - selenium.DOMAIN.COM
      secretName: selenium-router-tls
  rules:
    # XXX: Edit
    - host: selenium.DOMAIN.COM
      http:
        paths:
          - path: /
            pathType: Prefix  # for new networking.k8s.io/v1
            backend:
              #serviceName: selenium-router
              #servicePort: 4444
              service:
                name: selenium-router
                port:
                  number: 4444
