Install in custom infrastructure
Install Platforma into a Kubernetes cluster that the company already has, in any cloud or data center.
Other ways: Install in cloud with Terraform, Install in cloud with installer, Install in Single Server mode.
The cluster must meet the Kubernetes contract. Two paths install Platforma into it: the Terraform modulesTerraform 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. Glossary, which MiLaboratories recommends, and the Helm chart alone. To make a new cluster in AWS or Google Cloud, see Install in cloud with Terraform.
What you get
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
For a KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary cluster that the company already has, MiLaboratories recommends the
cloud-agnostic Terraform modulescloud-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. Glossary. You describe the cluster one time in the input cluster_config,
and the modules do the rest: platforma-tf-services-cluster creates the namespace, installs
KueueKueue — A Kubernetes add-on that holds jobs in a queue until the cluster has free CPU, memory and GPU for them. Glossary and AppWrapperAppWrapper — A Kubernetes add-on that wraps the pods of one job into a single unit, so that Kueue admits and starts them together. Glossary, and creates the jobjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary queues and the RBAC roles; platforma-tf-services
installs the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary. Before they change the cluster, the modules check the inputs and stop at a
wrong value with its path.
- Primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary: an S3-compatible bucket, with the access keys from the Secret
platforma-storage. Platforma also supports Amazon S3 and Google Cloud Storage with the cloud identity of the Backend (see Primary storage). Workspaceworkspace — 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. Glossary: a claim of 1 TiB from the StorageClassplatforma-workspaceof the workspace. The database and the logs get claims from the StorageClassesplatforma-databaseandplatforma-logs. - Sign-insign 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". Glossary: the static list of usersstatic list of users — A sign-in provider that is a file with the logins and the password hashes of the users, in the htpasswd format. The Backend reads it again when it changes. Glossary from the Secret
platforma-users;adminis an administrator. - 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 and TLS: 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 connects to
platforma.example.comthrough the Gateway of the cluster. The listenerplatformaof the Gateway holds the certificate, so TLS ends there. Withgeneric, the Gateway must also have the gRPC health check and the long stream timeouts (see Gateway). - What runs where: the Backend pod runs on the node with the label
platforma.bio/pool=backend. The jobs go through the job queues to the nodes with the labelsplatforma.bio/pool=uiandplatforma.bio/pool=batch, and each job node also has the labelplatforma.bio/node-group=<group>(see Node pools). Withautoscaling.enabledset tofalse, the module reads the nodes of each pool and calculates from them the quotas of the job queues and the largest job.
The modules use the StorageClasses, the Gateway and the bucket that the cluster has, and do not
create them. The license key and the master secret come from the Secrets platforma-license and
platforma-master-secret, the defaults of the modules, so the inputs do not name them.
Tool: platforma-backend
In a cluster that meets the Kubernetes contract, the
Helm chart platforma-backend installs the Backend in one namespace and does not change the
cluster. MiLaboratories recommends the Terraform modules. With the chart alone, the team that runs
the cluster prepares by hand all that the
Kubernetes contract asks, such as Kueue, AppWrapper, the job
queues, the StorageClasses, the entry point and the RBAC roles.
- Primary storage: an S3-compatible bucket, with the access keys from the Secret
platforma-storage. It works in any cluster, with no cloud identitycloud 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. Glossary. Platforma also supports Amazon S3 and Google Cloud Storage with the cloud identity of the Backend (see Primary storage). Workspace: a claim of 1 TiB from the StorageClassplatforma-workspace. The database and the logs get claims from the StorageClassesplatforma-databaseandplatforma-logs. - Sign-in: the static list of users from the Secret
platforma-users;adminis an administrator. - Entry point and TLS: the Desktop App connects to
platforma.example.comthrough the Gateway of the cluster. The listener of the Gateway holds the certificate, so TLS ends there. Withgeneric, the Gateway must also have the gRPC health check and the long stream timeouts (see Gateway). - What runs where: the Backend pod runs on the node with the label
platforma.bio/pool=backend, and the jobs go through the job queues of the cluster to the job nodes.jobs.maxRequestis the allocatable CPU and memory of one batch node of 32 CPUsCPUs — 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. Glossary and 256 GiB: the Backend makes a larger request of a job smaller.
The license key and the master secret come from the Secrets platforma-license and
platforma-master-secret, the defaults of the chart, so the values do not name them.
Size. The size follows the nodes of the cluster. With 8 CPUs and 32 GiB, the Backend serves up to about 30 users who work at the same time. Kubernetes keeps a part of each node for itself, so a node of 8 CPUs and 32 GiB cannot hold this request. Use a larger Backend node, or set the Backend to the CPU and the memory that its node gives to pods (the step “Prepare the cluster”). The biggest jobs of a sample ask for 16 CPUs, so they need batch nodes of 32 CPUs and 256 GiB, one such job on each node. For the time and the cost of the analyses on these nodes, see Size and cost of an analysis.
Before you start
Prepare these items before the first apply:
- The cluster meets the Kubernetes contract: Kubernetes 1.35 or later, the node pools with their labels, the StorageClasses, the Gateway and the bucket. With the Terraform modules, the modules add Kueue, AppWrapper and the job queues; with the Helm chart alone, the team that runs the cluster adds them.
- Rights. A kubeconfig with cluster admin rights to prepare the cluster, and the role
adminin the namespace to install the Backend. See Rights to install. - A host and TLS. The host name that users type in the Desktop App, for example
platforma.example.com. A DNS record from the host to the address of the Gateway. A certificate for the host on the listener of the Gateway. See Domain and TLS. - The bucket of the primary storage and its access keys. See Primary storage.
- The license key. See License.
- Network access from the computer that installs Platforma to
github.com(the modules) andghcr.io(the charts), or a clone and a chart mirror in the corporate network. For all hosts, see Outbound connections. - A clone of platforma-install at a release tag: the modules and the charts. See Where the modules are.
- Tools on the computer that runs the installation:
kubectl(at most one minor version from the version of the cluster),opensslandhtpasswd(the packageapache2-utilsorhttpd-tools). Also Terraform 1.12 or later (or OpenTofu 1.12 or later) for the modules, or Helm 3 for the chart.
When the cluster cannot reach the public registries, make a mirror of each of them before the first apply, and keep the mirrors for as long as Platforma runs: see Registries mirroring.
Steps
MiLaboratories recommends the Terraform modules for a cluster that exists: they prepare the
cluster for Platforma and check the inputs before they change it. With the Helm chart alone, the
team that runs the cluster prepares by hand all that the
Kubernetes contract asks. In the examples, <platforma-install> is the
folder of a clone of the repository platforma-install at the release tag (see
Where the modules are), <release tag> is this
tag, and <kubeconfig context> is the context of the cluster in
~/.kube/config. Select this context before the steps, so that the kubectl commands and the
Terraform providers use the same cluster:
kubectl config use-context <kubeconfig context>The modules come from github.com and get the charts from
oci://ghcr.io/milaboratory/platforma-install. On a machine without internet access, use the clone:
set chart_repository of backend_service and of components.appwrapper to
<platforma-install>/helm/charts.
-
Make the secret values. See Secret values. Also put the access keys of the bucket into two files in the same folder:
Terminal window cd ~/platforma-secretsprintf '%s' '<access key>' > access-key.txtprintf '%s' '<secret key>' > secret-key.txt -
Prepare the cluster.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
Describe the cluster in the input
cluster_configofplatforma-tf-services-cluster, as a JSON file. Set the labels of the node pools, the names of the ServiceAccounts, the StorageClass of the workspace, the bucket and the Gateway of the cluster:cluster/cluster-config.json {"contract_version": 1,"namespaces": ["platforma"],"node_pools": {"ui": {"node_selector": { "platforma.bio/pool": "ui" },"tolerations": [],"node_groups": [{ "name": "ui", "max_size": 2 }]},"batch": {"node_selector": { "platforma.bio/pool": "batch" },"tolerations": [],"node_groups": [{ "name": "batch", "max_size": 4 }]}},"autoscaling": { "enabled": false, "provisioning_request": {} },"cloud_values": {"jobs": { "service_account": { "name": "platforma-jobs" } },"backend": {"service_account": { "name": "platforma-backend" },"allocatable": { "cpu": 7.2, "memory_gib": 26 }},"volumes": { "workspace": { "storage_class": "platforma-workspace" } },"primary_storage": {"s3": {"bucket": "platforma-results","endpoint": "https://s3.example.com","region": "us-east-1","secret": {"access_key": { "name": "platforma-storage", "key": "access-key" },"secret_key": { "name": "platforma-storage", "key": "secret-key" }}}},"network": {"hosts": ["platforma.example.com"],"entry_points": [{"host": "platforma.example.com","gateway": {"name": "platforma-gateway","namespace": "platforma-gateway","section_name": "platforma","implementation": "generic"}}]}}}backend.allocatableis the CPU and the memory that the Backend pod can use on its node: theAllocatablevalues in the output ofkubectl describe node. The Backend pod requests this value. Without it, the pod requests 8 CPUs and 32 GiB, and a node of this size does not have room for it.Apply the root
clusterwith cluster admin rights, from the folder~/platformawith the subfolderscluster,servicesandhandoff. It creates the namespaceplatforma, installs Kueue and AppWrapper, and creates the job queues and the RBAC roles. Do not create the namespace by hand: the apply then fails.cluster/main.tf terraform {required_providers {helm = { source = "hashicorp/helm", version = "~> 3.1" }kubernetes = { source = "hashicorp/kubernetes", version = "~> 3.0" }kubectl = { source = "alekc/kubectl", version = "~> 2.1" }}}provider "kubernetes" {config_path = "~/.kube/config"config_context = "<kubeconfig context>"}provider "helm" {kubernetes = {config_path = "~/.kube/config"config_context = "<kubeconfig context>"}}provider "kubectl" {config_path = "~/.kube/config"config_context = "<kubeconfig context>"}module "services_cluster" {source = "git::https://github.com/milaboratory/platforma-install.git//terraform/cloud-agnostic/platforma-tf-services-cluster?ref=<release tag>"cluster_config = jsondecode(file("cluster-config.json"))}output "infrastructure" { value = module.services_cluster.infrastructure }output "versions" { value = module.services_cluster.versions }Terminal window cd ~/platforma/clusterterraform initterraform applyterraform output -json infrastructure > ../handoff/infrastructure.jsonTo change the node pools, the quotas of the job queues or to add GPU nodes, see Jobs and resources. For an Ingress in place of the Gateway, see Domain and TLS.
Tool: platforma-backend
Prepare what the Kubernetes contract asks, then create the namespace.
Terminal window kubectl create namespace platformaResult:
kubectl get namespace platformashowsActive. -
Create the Secrets, from the files of step 1. These are the names and keys of the examples; the license, the master secret and the users have the default names of the chart and of the modules.
Terminal window cd ~/platforma-secretskubectl -n platforma create secret generic platforma-license --from-file=MI_LICENSE=license.txtkubectl -n platforma create secret generic platforma-master-secret --from-file=master-secret=master-secret.txtkubectl -n platforma create secret generic platforma-users --from-file=htpasswd=users.htpasswdkubectl -n platforma create secret generic platforma-storage --from-file=access-key=access-key.txt --from-file=secret-key=secret-key.txtResult:
kubectl -n platforma get secretslists the four Secrets.For the Secrets of other sign-in providerssign-in provider — A configured way for users to sign in to the Backend: single sign-on (SSO), LDAP or a static list of users. One Backend can have more than one. Glossary, see Authentication. For a bucket that the Backend reads with its cloud identity, with no keys, see Primary storage.
-
Install the Backend.
Tool: platforma-tf-* modules (cloud and cloud-agnostic)
Apply the root
serviceswith the roleadminin the namespace. It reads the hand-off file of the rootcluster, and waits until the Backend is ready.services/main.tf terraform {required_providers {helm = { source = "hashicorp/helm", version = "~> 3.1" }}}provider "helm" {kubernetes = {config_path = "~/.kube/config"config_context = "<kubeconfig context>"}}module "platforma" {source = "git::https://github.com/milaboratory/platforma-install.git//terraform/cloud-agnostic/platforma-tf-services?ref=<release tag>"namespace = "platforma"infrastructure = jsondecode(file("../handoff/infrastructure.json"))backend_service = {auth = {providers = [{name = "local"title = "Local password"htpasswd = { secret = { name = "platforma-users", key = "htpasswd" } }admin_users = ["admin"]},]}}}output "entry_points" { value = module.platforma.entry_points }output "release" { value = module.platforma.release }output "versions" { value = module.platforma.versions }Terminal window cd ~/platforma/servicesterraform initterraform applyTool: platforma-backend
The values of the chart: the ServiceAccounts, the largest job (the allocatable CPU and memory of one batch node of 32 CPUs and 256 GiB), the bucket, the Gateway and one sign-in provider. The Backend pod requests 8 CPUs and 32 GiB (
backend.resources). On a Backend node of this size, setbackend.resourcesto the allocatable CPU and memory of the node, or use a larger node.values.yaml backend:serviceAccount: { name: platforma-backend }jobs:serviceAccount: { name: platforma-jobs }maxRequest:cpu: 31memory: 234GiprimaryStorage:s3:bucket: platforma-resultsendpoint: https://s3.example.comregion: us-east-1secret:accessKey: { name: platforma-storage, key: access-key }secretKey: { name: platforma-storage, key: secret-key }volumes:workspace:storageClass: platforma-workspace # the default: the workspacenetwork:entryPoints:- host: platforma.example.comgateway:name: platforma-gatewaynamespace: platforma-gatewayimplementation: genericauth:providers:- name: localtitle: Local passwordhtpasswd:secret: { name: platforma-users, key: htpasswd }adminUsers: ["admin"]Terminal window helm install platforma oci://ghcr.io/milaboratory/platforma-install/platforma-backend \--version <chart version> -n platforma -f values.yamlThe chart version is
versionin<platforma-install>/helm/charts/platforma-backend/Chart.yaml. On a machine without internet access, install from the folder of the clone:helm install platforma <platforma-install>/helm/charts/platforma-backend -n platforma -f values.yaml.Result:
kubectl -n platforma get podsshows the Backend podRunning.To change the sign-in, see Authentication and Users and roles. For the other settings of the Backend, see Storage, Data libraries, Jobs and resources, Proxy and custom CA and Registries.
-
Check DNS and the certificate.
Terminal window kubectl -n platforma-gateway get gateway platforma-gateway # PROGRAMMED: Truedig +short platforma.example.comopenssl s_client -connect platforma.example.com:443 -servername platforma.example.com \-verify_hostname platforma.example.com -verify_return_error -alpn h2 </dev/null >/dev/null 2>&1 \&& echo "certificate OK"Result: the host resolves to the address of the Gateway, and the last command shows
certificate OK. When it shows nothing, the certificate is not valid for the host name: runopensslagain without>/dev/null 2>&1to see the error. For the certificate and the DNS record, see Domain and TLS. -
Verify the installation. See Verify the installation.
-
Connect the Desktop App to
https://platforma.example.com, and sign in asadminwith the password of the list of users. See Connect clients.