Create a Kubernetes compute environment
Create a Kubernetes compute environment on an existing cluster. For everything you need in place first, see the checklist.
You need the following:
- A cluster prepared for Seqera. See Prepare a Kubernetes cluster.
- Kubernetes credentials in your workspace. See Kubernetes credentials.
Create the compute environment
-
In a workspace, select Compute Environments, then select Add compute environment.
-
Enter a descriptive name for this environment, for example, K8s cluster.
-
Select Kubernetes as the target platform.
-
From the Credentials drop-down, select your Kubernetes credentials. To add credentials, see Kubernetes credentials.
-
Enter the Control plane URL. To get it, run this command:
kubectl cluster-infoYou can also find it in your
~/.kube/configfile, in theserverfield for your cluster. -
Specify the SSL certificate to authenticate your connection.
Find the certificate data in your
~/.kube/configfile, in thecertificate-authority-datafield for your cluster. -
Specify the Namespace created in the cluster preparation instructions, which is
tower-nfby default. -
Specify the Head service account created in the cluster preparation instructions, which is
tower-launcher-saby default. -
Specify the Storage claim created in the cluster preparation instructions. Nextflow pipelines use it as a scratch file system. The storage claim is named
tower-scratchin each of the provided examples. -
Apply Resource labels to the cloud resources consumed by this compute environment. Workspace default resource labels are prefilled.
-
Optional: Expand Staging options and Environment variables to add pre- and post-run scripts, Nextflow configuration, or environment variables. See Common compute environment options.
-
Configure any advanced options, as needed.
-
Select Add.
Advanced options
Kubernetes compute environments have advanced options for storage and work directory paths, resource allocation, and pod customization.
- The Storage mount path is the file system path where the storage claim is mounted (default:
/scratch). - The Work directory is the file system path that Nextflow pipelines use as a working directory. It must be the storage mount path (default) or a subdirectory of it.
- The Compute service account is the service account that Nextflow uses to submit tasks (default: the
defaultaccount in the given namespace). - The Pod cleanup policy determines when Seqera deletes the run's Nextflow head pod. On success (the default) deletes it when the run succeeds, Always deletes it regardless of outcome, and Never keeps it. This policy does not delete task pods. See Kubernetes pods remain after a run ends.
- Use Custom head pod specs to provide custom options for the Nextflow workflow pod, such as
nodeSelectororaffinity. For example:
spec:
nodeSelector:
disktype: ssd
- Use Custom service pod specs to provide custom options for the compute environment pod. See the preceding example.
- Use Head job CPUs and Head job memory to specify the hardware resources allocated to the Nextflow workflow pod. Head job memory is set in MiB, with a minimum of 3584 MiB. If you leave it empty, the pod has no memory request.
Next steps
To run pipelines in your Kubernetes compute environment, see Launch pipelines.