# Kubernetes contract

What does Platforma expect from a Kubernetes cluster, and which setups does it support?

The Kubernetes contract (The list of all that a Kubernetes cluster must give so that Platforma runs in it.) has two parts:

1. **The shape of the Terraform inputs and outputs.** This part applies only when you install Platforma with the Terraform modules (The Terraform code that MiLaboratories provides to install Platforma. The cloud-specific Terraform modules make the cluster and its cloud parts in AWS or Google Cloud; the cloud-agnostic Terraform modules install Platforma into the cluster.). In the modules, the contract is concrete: the inputs and the outputs describe the cluster that exists. See [How the modules split the work](/infrastructure-contract-modules/).
2. **What Platforma expects from the infrastructure it runs on**: the names of the most common resources, how traffic reaches Platforma (the entry 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.)), storage, identities, job (One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster.) queues and so on. This part applies to every installation of Platforma in a Kubernetes (A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster.) cluster: with the Terraform modules or with the Helm chart.

With the contract, the team that runs the cluster knows before the installation whether the cluster meets these expectations, and what it must add first.

Platforma supports a cluster in a cloud and a cluster in the infrastructure of your company: a Kubernetes cluster on bare metal or another in-house Kubernetes cluster. For Platforma, this does not make a difference: the same list is true for all of them. The cloud-agnostic Terraform modules (The Terraform modules platforma-tf-services-cluster and platforma-tf-services. They do not depend on the infrastructure and install Platforma into any cluster that meets the Kubernetes contract, in a cloud or in the company's own infrastructure.) also work in each of them.

## What Platforma expects from the cluster

- **Kubernetes 1.35 or later**, with one namespace for each Platforma instance, pods that are not root, and a synchronized clock (NTP) on the node of the Backend (The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs.). See [Identity, Secrets and outbound access](/infrastructure-contract-identity/).
- **Two levels of rights**: cluster admin rights one time, for the part of Platforma that is common to the whole cluster, and then only the role `admin` in the namespace to install and update the Backend. See [How the modules split the work](/infrastructure-contract-modules/).
- **Job queues**: Kueue (A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them.) 0.16.1 or later, and AppWrapper (A Kubernetes add-on that wraps the pods of one job into a single unit, so that Kueue admits and starts them together.) 1.2.3 or later, in the build that MiLaboratories patches and updates from time to time. The Backend sends each job through them. See [Nodes, job queues and GPU](/infrastructure-contract-jobs/).
- **Nodes**: a node for the Backend that gives the Backend pod at least 7 CPUs (The compute units of a node or of the server, as Kubernetes and the operating system count them. A job asks for a number of CPUs. The cloud quotas call them vCPUs.) and 24 GiB of memory. The jobs need amd64 node pools: one for UI tasks, one for batch jobs, and optionally one for GPU jobs. An autoscaler for the job pools is optional: use it when the cluster adds nodes for jobs. Platforma also works with a fixed list of nodes.
- **The workspace (The storage where the Backend and all jobs keep the working files of running jobs. The Backend and the jobs use it at the same time. In Kubernetes, it is a network file system; in Single Server mode, it is a folder on the server.)**: a file system that the Backend and all jobs mount at the same time, with POSIX semantics. See [Storage](/infrastructure-contract-storage/).
- **Block volumes for the database and the logs** of the Backend. See [Storage](/infrastructure-contract-storage/).
- **A bucket for the results** (the primary storage (The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files.)): Platforma supports Amazon S3, Google Cloud Storage, and any storage with an S3-compatible interface, for example in the data center of your company. The storage must support presigned URLs, and the computers of the users must reach it: they upload and download the files directly. The Backend gets access with a cloud identity (The identity that the cloud gives to the Platforma pod (IAM roles for service accounts on AWS, Workload Identity on Google Cloud). With it, Platforma needs no access keys.) or with static access keys from a Secret.
- **An entry point with TLS**: a DNS name, and a Gateway or an Ingress that sends gRPC (HTTP/2) to the Backend, with a certificate that the computers of the users accept. Platforma supports public and private entry points. See [Entry point and TLS](/infrastructure-contract-entry-point/).
- **Identities and Secrets**: an identity for the Backend and for the jobs. Platforma supports a cloud identity, or access keys where there is no cloud identity. The Secrets of the license, the master secret and the sign-in (To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in".) are made before the installation. See [Identity, Secrets and outbound access](/infrastructure-contract-identity/).
- **Outbound access** to the license service of MiLaboratories, which a mirror cannot replace, and to the registries of charts, images, Blocks (A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools.) and assets, or to their mirrors in the company.

Each object that Platforma expects has a default name, so a cluster that uses the defaults needs few values. See [Default names and how to change them](/infrastructure-contract-names/).

For the rights that each part of the installation needs in AWS and Google Cloud, see [Permissions](/plan-permissions/).

## Next

- [How the modules split the work](/infrastructure-contract-modules/)
- [Install in custom infrastructure](/install-custom-infrastructure/)

Source: https://docs.platforma.bio/infrastructure-contract/
