Alaya NeW Cloud

VS Code Dev Containers

Use the VS Code Dev Containers + Kubernetes extensions to attach directly to a Pod in VKS — no SSH required

Overview

The VS Code Dev Containers extension lets developers work inside a container. Combined with the Kubernetes extension, you can attach directly to Pods in VKS for development and debugging — no SSH plumbing.

Prerequisites

  • Dev Containers and Kubernetes extensions installed
  • The cluster is reachable

Install the extensions

Open VS Code, go to Extensions, search and install Dev Containers and Kubernetes:

Install VS Code extensions

Connect to the cluster

Create a container in VKS first. Once the Kubernetes extension is installed, a Kubernetes tab appears in the left sidebar; clicking it lists configured clusters and their resources:

Cluster resources

If nothing shows up, click the ... next to CLUSTERS and pick "Set kubeConfig" to reconfigure:

Set kubeConfig

Attach to a container in the cluster

  1. Expand the namespace list, pick the target namespace, right-click → "Use Namespace".

    Use namespace

  2. Expand Pods under Workloads, pick the target Pod, right-click → "Attach Visual Studio Code", wait for the connection.

    Attach to container

  3. On success, VS Code shows a remote-container badge in the lower-left corner. Click "Open Folder" in the upper-right to pick a directory inside the container.

  4. The new window loads the container's code — start developing.

    Connection complete

Caveats

Important: The container in this example does not declare persistent storage. Any change inside the container is lost on redeploy. If you need to keep changes, declare a PVC and mount it. Some services (like Flask) won't pick up code changes automatically — you'll need to redeploy.

Last updated on

Was this page helpful?

On this page