JetBrains CodeCanvas 2024.1 Help

Computing Platform

A computing platform is a platform (e.g., a Kubernetes cluster in AWS EKS or GKE) where dev environments are running. For example, you can run dev environments in the same cluster with the CodeCanvas application but in a different namespace. You can also run dev environments in a separate cluster or even in multiple clusters. In any case, you should explicitly connect the dev environment computing platforms to CodeCanvas.

Connect a computing platform to CodeCanvas

  1. On the sidebar, choose Administration, then Computing Platform.

  2. Click New connection and specify the platform Name and other settings:

    • Namespace – the Kubernetes namespace where the dev environments are running. For example, you can run dev environments in the same cluster with the CodeCanvas application but in a different namespace.

    • Pod template YAML – the YAML file that describes the pod template. Customize this template to make dev environment pods better meet the requirements of your infrastructure. CodeCanvas will automatically add all required labels, annotations, environment variables, and volumes that are necessary for the pods to function correctly. Therefore, all you need is to add your custom configuration to the pod template. For example, the following snippet shows how to add a label, an annotation, and an environment variable to the pod template:

      apiVersion: v1 kind: Pod metadata: labels: codecanvas: true annotations: codecanvas: true spec: containers: - name: worker-main env: - name: CODECANVAS value: true restartPolicy: Never

      Note that in CodeCanvas a pod doesn't run dev environment containers directly. Instead, it runs a worker container that starts the dev environment containers. If you need to pass environment variables or files from the worker container to the dev environment containers, you can use the following special environment variables:

      • WORKER_STEP_CONTAINER_PROPAGATION_ENV_VAR_KEYS for environment variables

      • WORKER_STEP_CONTAINER_PROPAGATION_PATHS for paths to files

      For example, the following configuration will propagate the MY_ENV_VAR_1 and MY_ENV_VAR_2 environment variables from a pod to dev environment containers:

      apiVersion: v1 kind: Pod spec: containers: - name: worker-main env: - name: WORKER_STEP_CONTAINER_PROPAGATION_ENV_VAR_KEYS value: "MY_ENV_VAR_1;MY_ENV_VAR_2"
  3. Click Save. The platform will be added to the list but will be in the Inactive state as it is not yet connected to CodeCanvas.

  4. Open the newly added platform. The settings page will display the connection snippet for the helm upgrade command.

  5. Click Generate token to generate an access token for the connection.

  6. Copy the connection snippet with the access token and run it in the terminal of the Kubernetes cluster where the dev environments are running.

  7. To check the connection status, click Test connection. All checks must return Success.

Freeze or delete a connection

To delete a connection, click Delete on the platform settings page. This will permanently delete the connection and all the dev environments that are running on this platform.

If you want to temporarily stop creating new dev environments on a specific platform, click Freeze connection on the platform settings page. Note that this will also stop all the dev environments that are currently running on this platform.

Last modified: 02 July 2024