JetBrains CodeCanvas 2024.2 Help

Computing Platforms

A computing platform is a platform (e.g., a Kubernetes cluster in AWS EKS, GKE, and so on) 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, before users can create dev environments, you should explicitly connect your computing platforms to CodeCanvas.

Connect a computing platform to CodeCanvas

  1. Select Administration in the header navigation, then in the sidebar menu, select Computing Platforms.

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

    • Kubernetes 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 for the worker pod. Customize this template to make worker 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 a worker pod is not a dev environment itself. It is a management container that starts nested 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"

      This template is applied to all worker pods in the computing platform. If you need separate configurations for different instance types, you can specify Pod template YAML on the instance type level.

  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 on the platform settings page. Note that this will not affect the existing dev environments.

Migrate from one platform to another

When upgrading your infrastructure, you may need to migrate from one computing platform to another. You can't migrate the existing dev environments, but you can transfer configuration data, namely, instance types that use the deprecated platform and dev environment templates based on these instance types.

In the instructions below, we will call the platform that you want to stop using deprecated and the new platform new.

  1. Freeze the deprecated platform: Open the platform settings in Administration | Computing Platforms and click Freeze.

  2. Rename the instance types that use the deprecated platform:

    1. In the platform settings, click Show list next to Instance types.

      Links to related resources

    2. Click Select all to select all instance types.

    3. Click Rename and in the dialog that opens, specify either a prefix or a suffix for the instance type names. For example, you can add the [deprecated] prefix.

      Rename instance types

    4. Click Rename.

  3. Rename the dev environment templates that use the deprecated instance types:

    1. In the platform settings, click Show list next to Templates.

    2. Click Select all to select all templates.

    3. Click Rename and in the dialog that opens, specify either a prefix or a suffix for the template names. For example, you can add the [deprecated] prefix.

    4. Click Rename.

  4. Use the [deprecated] instance types to create new ones:

    1. Select Administration in the header navigation, then in the sidebar menu, select Instance Types.

    2. For each [deprecated] instance type: Open the instance type settings and click Copy. In the dialog, specify a new name for the instance type and select the new Computing platform. Click Create.

  5. Use the [deprecated] templates to create new ones:

    1. Select Administration in the header navigation, then in the sidebar menu, select Templates.

    2. For each [deprecated] template: Click Copy. In the dialog, specify a new name for the template and select the new Instance type. Finish creating the template.

Last modified: 17 September 2024