Skip to main content

Create a Kubernetes compute environment

Create a Kubernetes compute environment on an existing cluster. For everything you need in place first, see the checklist.

Prerequisites

You need the following:

Create the compute environment​

  1. In a workspace, select Compute Environments, then select Add compute environment.

  2. Enter a descriptive name for this environment, for example, K8s cluster.

  3. Select Kubernetes as the target platform.

  4. From the Credentials drop-down, select your Kubernetes credentials. To add credentials, see Kubernetes credentials.

  5. Enter the Control plane URL. To get it, run this command:

    kubectl cluster-info

    You can also find it in your ~/.kube/config file, in the server field for your cluster.

  6. Specify the SSL certificate to authenticate your connection.

    Find the certificate data in your ~/.kube/config file, in the certificate-authority-data field for your cluster.

  7. Specify the Namespace created in the cluster preparation instructions, which is tower-nf by default.

  8. Specify the Head service account created in the cluster preparation instructions, which is tower-launcher-sa by default.

  9. 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-scratch in each of the provided examples.

  10. Apply Resource labels to the cloud resources consumed by this compute environment. Workspace default resource labels are prefilled.

  11. Optional: Expand Staging options and Environment variables to add pre- and post-run scripts, Nextflow configuration, or environment variables. See Common compute environment options.

  12. Configure any advanced options, as needed.

  13. 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 default account 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 nodeSelector or affinity. 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.