Skip to content

VSCode Extension

The KSail VSCode extension brings cluster management into your editor. It integrates with the VS Code Kubernetes extension to surface KSail clusters in the Cloud Explorer and Cluster Explorer, provides interactive wizards for cluster operations, a command palette with keyboard shortcuts, and a built-in MCP server for AI assistants.

See the Installation Guide β€” VSCode Extension for Marketplace and VSIX installation steps.

Prerequisites:

  • KSail CLI installed and available in PATH
  • Docker running (for local cluster operations)
  • VS Code Kubernetes Tools extension (installed automatically as a dependency)
  • K9s (optional β€” for Connect to Cluster command)

KSail clusters appear as top-level entries under KSail in the Kubernetes extension’s Clouds view. Each cluster shows its name, provider, and status icon. Right-click a cluster for context-sensitive actions:

  • All clusters: Info, Start, Stop, Connect, Update, Switch, Backup, Restore, Delete
  • From the KSail cloud node context menu: Create Cluster

In the Kubernetes extension’s Cluster Explorer, KSail-managed contexts are annotated with (KSail) and a status label (Running / Stopped / Unknown). Right-click a KSail context for the same cluster lifecycle actions.

Selecting Create Cluster β†’ KSail in the Kubernetes extension opens an HTML-based wizard. Configuration options (distribution, provider, CNI, GitOps engine) are fetched at runtime from the KSail MCP schema so they stay in sync with the installed CLI version. Built-in fallback values are used when the MCP server is unreachable.

The Init and Create commands launch multi-step wizards with:

  • Distribution selection: Vanilla, K3s, Talos, VCluster
  • Provider selection: Docker, Hetzner, Omni
  • Component configuration (CNI, CSI, GitOps engine, etc.)
  • Output path selection for generated files

The extension exposes KSail as an MCP server for AI assistants in VSCode (e.g., GitHub Copilot). No separate configuration is needed β€” the extension handles server lifecycle automatically. See MCP Server for details on available tools.

Access all commands via the Command Palette (Cmd+Shift+P / Ctrl+Shift+P):

CommandDescriptionShortcut
KSail: Init ClusterInitialize a new ksail.yaml configurationCmd+Shift+K I
KSail: Create ClusterCreate and start a clusterCmd+Shift+K C
KSail: Update ClusterUpdate a running clusterβ€”
KSail: Start ClusterStart an existing clusterβ€”
KSail: Stop ClusterStop a running clusterβ€”
KSail: Switch ClusterSwitch the active kubeconfig contextβ€”
KSail: Backup ClusterBackup cluster resourcesβ€”
KSail: Restore ClusterRestore cluster resources from a backupβ€”
KSail: Delete ClusterDelete the clusterCmd+Shift+K D
KSail: Connect to Cluster (K9s)Open K9s terminal UIβ€”
KSail: Show KSail InfoShow cluster info via KSail CLIβ€”
KSail: Refresh ClustersRefresh the Cloud Explorer and Cluster Explorer views (and clear cached status)β€”
KSail: Show OutputOpen the KSail output channelβ€”

Configure in VSCode settings (Cmd+, / Ctrl+,) or settings.json:

SettingDescriptionDefault
ksail.binaryPathPath to the KSail binaryksail
Terminal window
cd vsce
npm ci
npm run compile
Terminal window
npx @vscode/vsce package --no-dependencies
  1. Open the vsce folder in VSCode
  2. Press F5 to launch the Extension Development Host
  3. Test commands from the Command Palette
vsce/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ extension.ts # Entry point, command registration
β”‚ β”œβ”€β”€ commands/
β”‚ β”‚ β”œβ”€β”€ index.ts # Command handlers (command registry)
β”‚ β”‚ └── prompts.ts # Interactive wizard implementations
β”‚ β”œβ”€β”€ ksail/
β”‚ β”‚ β”œβ”€β”€ clusters.ts # KSail CLI wrapper functions
β”‚ β”‚ β”œβ”€β”€ binary.ts # KSail binary discovery and execution
β”‚ β”‚ β”œβ”€β”€ kubectl.ts # kubectl wrapper for cluster status queries
β”‚ β”‚ └── index.ts # Module exports
β”‚ β”œβ”€β”€ kubernetes/
β”‚ β”‚ β”œβ”€β”€ cloudProvider.ts # Cloud Explorer tree provider
β”‚ β”‚ β”œβ”€β”€ clusterExplorerContributor.ts # Annotates KSail contexts in Cluster Explorer
β”‚ β”‚ β”œβ”€β”€ clusterProvider.ts # Create Cluster wizard (HTML-based)
β”‚ β”‚ β”œβ”€β”€ contextNames.ts # Shared helpers for parsing kubeconfig context names
β”‚ β”‚ └── index.ts # Module exports
β”‚ └── mcp/
β”‚ β”œβ”€β”€ serverProvider.ts # MCP server definition provider
β”‚ β”œβ”€β”€ schemaClient.ts # MCP schema client for KSail
β”‚ └── index.ts # Module exports
β”œβ”€β”€ dist/ # Compiled output
└── package.json # Extension manifest