apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    # This line will automatically generate a Let's Encrypt TLS certificate which will be stored in the secretName below. See https://cert-manager.io/docs/usage/ingress/
    # This only works for DNS names in public zones like *.renci.org or *.apps.renci.org. See https://wiki.renci.org/index.php/Kubernetes_Cloud/Let%27s_Encrypt_Migration
    cert-manager.io/cluster-issuer: letsencrypt
    # Ensure you don't have any "kubernetes.io/ingress.class" annotations; those are deprecated in favor of IngressClasses, but you want to use the default class anyway.
    # for public URL
    # nginx.ingress.kubernetes.io/whitelist-source-range: "0.0.0.0/0,::/0"
  name: js9service-ingress
spec:
  tls:
  - hosts:
      - js9service.apps.renci.org
    secretName: js9service.apps.renci.org-tls
  rules:
  # This line will automatically create the DNS record using https://github.com/kubernetes-sigs/external-dns/
  # This only works for hostnames within *.apps.renci.org. If you need a DNS name outside that zone, contact ACIS.
  - host: js9service.apps.renci.org
    http:
      paths:
      - pathType: Prefix
        path: "/"
        backend:
          service:
            # The service name and port should match the name and port on your own Kubernetes Service: https://kubernetes.io/docs/concepts/services-networking/service/
            name: js9service
            port:
              number: 8080
      - pathType: Prefix
        path: "/socket.io"
        backend:
          service:
            name: js9helper
            port:
              number: 443
