Skip to content

Ingress

Danger

Kubernetes SIG Network and the Security Response Committee have announced the upcoming retirement of Ingress NGINX, the Ingress controller previously used in our Kubernetes infrastructure. Best-effort maintenance will continue until March 2026. We have migrated to Traefik controller and contacted users whose NGINX Ingresses need modifications to work with Traefik.

More information about Traefik here..

One of the two ways of publishing applications to the public internet is using the Ingress Kubernetes object . This allows forwarding traffic to Kubernetes via UTHPC managed proxy servers, controlling and enforcing best practices, monitoring and security.

UTHPC team provides this interface through HTTP proxy cluster called proxy.hpc.ut.ee. If you need to publish an app/software, please contact UTHPC support together with the name/port of your services, and the domain you would like to use.

Considerations for using Ingress

The benefit of using Ingress is that security, best practices and monitoring is managed by the UTHPC infrastructure team. For example, in this case, TLS certificates are managed by them.

But this cannot happen without downsides - having to initially work with UTHPC team to setup the routes, DNS records and TLS certificates.

Also, this proxy solution only works for HTTP and HTTPS traffic, other protocols cannot be forwarded using this technology. Please use the LoadBalancer Service for that.

There's also the possibility of requesting and using public IP addresses for direct connectivity to your services with LoadBalancer Service type, which is documented here.

Setting up ingress traffic for a domain

Please refer to our HAProxy documentation for setting up the ingress for Kubernetes through our proxy servers.

Once this and the previous steps have been completed, you can start using this domain in Kubernetes, by publishing your service using an Ingress object.

Ingress Controllers

The Ingress object works with the help of an Ingress Controller. UTHPC currently provides two Ingress Controllers: Traefik and Pomerium.

Traefik

Traefik is the default controller and is best used for regular HTTP access to applications from the public internet.

HAProxy uses the PROXY protocol to send the client IP to Traefik, after which multiple default HTTP headers are automatically added to the request by Traefik and our HAProxy. More info about the default headers can be found in the official Traefik documentation and our HAProxy documentation.

By default, Traefik closes idle connections after 10 minutes and HAProxy closes client ones after 90 seconds. You can find more info about it in the HAProxy documentation.

Setting up the Ingress using the Traefik Ingress Controller:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  namespace: <namespace>
  annotations:
    cert-manager.io/cluster-issuer: vault-hpc-issuer # (1)
spec:
  ingressClassName: traefik
  rules:
  - host: "<domain>" # (2)
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: application-service
            port:
              number: 80
  tls: 
  - hosts:
    - <domain> # (2)
    secretName: <domain> # (2)
  1. Use this issuer to provide network level security between UTHPC proxy servers and the Kubernetes ingress controller.
  2. This should be your domain name. The domain is used in first-come-first-serve fashion. Using the domain name as secretName is recommended, but in case of multiple TLS hosts, you can also change that.

Pomerium

The Pomerium Ingress Controller should be used when you want to restrict access to your domain and want to set up user authentication for University of Tartu users.

Setting up the Ingress using the Pomerium Ingress controller:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: application-ingress
  namespace: <namespace>
  annotations:
    cert-manager.io/cluster-issuer: vault-hpc-issuer
    ingress.pomerium.io/allow_websockets: 'true'
    ingress.pomerium.io/pass_identity_headers: 'true'
    ingress.pomerium.io/timeout: 5m
    ingress.pomerium.io/allow_any_authenticated_user: "true"
spec:
  ingressClassName: pomerium-hpc # (1)
  rules:
    - host: "<domain>" # (2)
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: application-service
                port:
                  number: 80 # (3)
  tls:
    - hosts:
        - "<domain>"
      secretName: tls-"<domain>"
  1. Use this ingress Class when you want to have authentication for your domain.
  2. This should be your domain name. The domain is used in first-come-first-serve fashion.
  3. This is the port number your service exposes.

The previous example gives access to all University of Tartu users.

You can also only give access to certain users by removing the ingress.pomerium.io/allow_any_authenticated_user: "true" annotation and adding this:

ingress.pomerium.io/policy: |
  allow:
    or:
      - user:
          is: user1@example.com

Other examples of policies can be found in the official Pomerium documentation.