Skip to content

Entry point and TLS

explanationinfrastructure-contract-entry-point

Which entry points, TLS, DNS and health checks does Platforma support, so that the clients reach the Backend?

The clients of Platforma, the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary and pl-clipl-cli — The command-line client of Platforma. Administrators use it to manage users and projects on the Backend. Glossary, reach the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary from outside the cluster through an entry point: a load balancer with a DNS name that sends the traffic to the Backend pod. Platforma does not make the load balancer: it expects one, so that the entry pointentry point — The way in to the Backend from outside the cluster, a load balancer or an Ingress with a DNS name. It usually ends TLS and sends the traffic to the Backend pod. Glossary can follow the network rules of your company. The Backend works the same behind each kind of entry point that Platforma supports: a load balancer of a cloud, or a load balancer and a controller in the data center of your company. Each part of the path must carry gRPC with its long streams (see What each entry point must carry).

Platforma supports public and private entry points. A public entry point has addresses on the internet, and the allowed networks of the users limit the access. A private entry point has private addresses only: the users reach it through a VPN or another private connection to the network of the cluster, and the cluster does not need a public network.

Platforma supports two kinds of entry point:

  • Gateway: the Gateway API, four supported implementations.
  • Ingress: an Ingress controller that routes gRPC.

Other ways in, for example a Service of type LoadBalancer or NodePort, are not supported: the Services of the Backend always have the type ClusterIP.

For how to set the host, the entry point and the certificate, see Domain and TLS.

Gateway

A Gateway of the Gateway API is the recommended entry point. Platforma expects:

  • the Gateway API CRDs, version 1.5.0 or later, from the standard channel. The objects of the Backend use only fields of version 1.1.0, but MiLaboratories did not test versions below 1.5.0;
  • a Gateway with a listener for the hosts of Platforma only, which accepts routes from the namespace of the instance;
  • the CRDs of the implementation, when it uses its own objects.

Each implementation needs its own objects next to the route: the route kind, the gRPC health check and the timeouts of the streams. The Backend creates these objects in its namespace for the implementation that the operatoroperator — The person who installs and runs Platforma in your company, for example an IT engineer or a bioinformatician. Glossary names:

  • AWS Load Balancer Controller (aws-load-balancer-controller): an HTTPRoute and a target group configuration with the gRPC health check. The cluster must set the idle timeout of the load balancer to at least 300 s: the default of 60 s cuts the streams of the Desktop App.
  • GKE Gateway (gke-gateway): an HTTPRoute, a gRPC health check policy and a policy of the load balancer that sets a stream timeout of 24 h. Without the policy, the load balancer cuts each stream after 30 s. The Gateway can be public or private (a regional internal load balancer).
  • Azure Application Gateway for Containers (azure-agc): a GRPCRoute and a gRPC health check policy.
  • Any other Gateway (generic): a standard HTTPRoute only, for any Gateway API implementation, also in a cluster on bare metal or another in-house cluster. The Backend does not set the gRPC health check and the stream timeouts for it: the operator sets them, for example with a policy of the Gateway controller.

Ingress

Platforma supports an Ingress as an alternative, for a cluster that already has an Ingress controller and no Gateway. The controller must route gRPC to the Backend. These controllers are known to work, with TLS on the Backend off: AWS Load Balancer Controller (ALB), Contour, HAProxy (haproxytech), Cilium Ingress, Istio, and ingress-nginx. The ingress-nginx project is no longer maintained upstream, and MiLaboratories does not recommend it for new installations.

Azure AGIC and Azure Application Gateway for Containers do not carry gRPC through an Ingress. These controllers are not tested:

  • GKE Ingress (needs TLS on the Backend);
  • F5 NGINX (needs HTTP/2 on in the controller);
  • Traefik v3 (gRPC only through its own route objects);
  • Kong (gRPC only to a Backend with TLS).

The Backend creates the Ingress, but it does not create the custom objects that a controller needs, such as policies: Platforma expects them to exist. When the controller reads the certificate from a Secret, the Secret has the type kubernetes.io/tls and is in the namespace of the instance.

What each entry point must carry

The Desktop App and pl-cli talk to the Backend with gRPC only: bidirectional and server streams over HTTP/2, with trailers. Each part of the path that controls the traffic must carry gRPC: load balancers, gateways, Ingress controllers, proxies and firewalls that inspect HTTP. A part that supports only HTTP/1.1, drops the trailers or cuts the streams breaks Platforma. Each part of the path must allow:

  • one stream for at least 300 s, with up to 300 s between two messages. Clients written in Go hold one stream for up to 12 h;
  • messages of at least 4 MiB, and any total size of the data of one stream;
  • keepalive pings of the client every 30 s;
  • the grpc-encoding headers, which carry the compression.

The entry point sends the traffic to the Backend as HTTP/2 on port 6345.

Several entry points

Platforma supports more than one entry point, for example a public host and an internal host. Each entry point is one host and one way in, a Gateway or an Ingress, with its own annotations, so the entry points can have different settings. All entry points send the traffic to the one Service of the Backend. Without an entry point, the Backend is not reachable from outside the cluster.

TLS

TLS between the clients and the Backend is required. The certificate must be valid for the host that the users connect to. Each client must accept it: a certificate from a public authority, or from a corporate authority that the client trusts. The Desktop App trusts the authorities of the operating system; pl-cli trusts the authorities of Node.js. See What clients trust. The entry point usually terminates TLS.

TLS on the Backend

The connection from the entry point to the Backend pod is plain HTTP/2 (h2c) by default, or TLS. Turn on TLS on the Backend when the entry point requires TLS to the pod, as GKE Ingress does: its health checks then also use TLS. TLS on the Backend is on for all its ports or off for all of them, and the same for all entry points. The certificate is in a Secret of type kubernetes.io/tls in the namespace of the instance.

DNS

Platforma expects a DNS record and a TLS certificate for each host of Platforma. A wildcard covers exactly one label: *.example.com covers platforma.example.com, but not platforma.lab.example.com. The name must resolve from the network of the users: for a private entry point, it resolves to its private addresses. When the operator installs with the Terraform modules, the modules compare the host of each entry point with the list of hosts that have DNS and TLS. They stop the plan when a host is not covered.

Health check

The entry point must send traffic only to a Backend that is ready. The Backend serves the standard gRPC health check grpc.health.v1.Health/Check on port 6345, and the objects that the Backend creates for the AWS, GKE and Azure Gateways use it. A load balancer that cannot send a gRPC health check can use GET /health on port 9090 instead: it gives 200 when the Backend is ready and 503 when it is not, and it does not need authentication. With TLS on the Backend, both checks use TLS.

Next