DigitalOcean Kubernetes for VS Code (Unofficial)
⚠️ DISCLAIMER: This is an unofficial, community-developed extension and is NOT affiliated with, endorsed by, or supported by DigitalOcean, LLC. DigitalOcean and the DigitalOcean logo are trademarks of DigitalOcean, LLC.
Manage your DigitalOcean Kubernetes (DOKS) clusters directly from Visual Studio Code. This extension provides a seamless integration with DigitalOcean's Kubernetes service, allowing you to create, manage, and interact with your clusters without leaving your editor.
Features
Cluster Management
- View all clusters - See all your DOKS clusters in a tree view
- Create clusters - Create new Kubernetes clusters with guided configuration
- Delete clusters - Safely delete clusters with confirmation
- View cluster details - Rich information panel showing cluster configuration
- Open in browser - Quick access to DigitalOcean console
Node Pool Management
- View node pools - See all node pools and their nodes
- Scale node pools - Easily adjust the number of nodes
- View node status - Real-time node status information
Kubeconfig Management
- Download kubeconfig - Get cluster credentials with configurable expiry
- Merge or separate - Choose to merge with existing kubeconfig or save separately
- Set current context - Quickly switch between clusters
Kubernetes Resources
- Namespaces - View all namespaces
- Pods - List pods, view logs, exec into containers
- Deployments - View deployment status and replicas
- Services - See service types and endpoints
- ConfigMaps - View configuration data
- Secrets - List secrets (values hidden)
- Pod logs - Stream or fetch pod logs
- Exec into pods - Open a terminal session in a container
- Port forwarding - Forward ports from pods/services to localhost
- Apply manifests - Deploy YAML files directly to your cluster
Requirements
- VS Code 1.85.0 or higher
- kubectl installed and in PATH (for resource management features)
- DigitalOcean account with API access
- DigitalOcean API token with read/write access
Installation
- Open VS Code
- Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "DigitalOcean Kubernetes"
- Click Install
Or install from the command line:
code --install-extension digitalocean-kubernetes
Getting Started
1. Get a DigitalOcean API Token
- Log in to DigitalOcean
- Navigate to API → Tokens
- Click Generate New Token
- Give it a name and select Read/Write scope
- Copy the token (you won't see it again!)
2. Authenticate in VS Code
- Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Run DigitalOcean K8s: Authenticate with DigitalOcean
- Paste your API token when prompted
- Your token is stored securely in VS Code's secret storage
3. Start Using the Extension
- Click the DigitalOcean icon in the Activity Bar
- View your clusters in the Clusters panel
- Select a cluster to view its resources in the Resources panel
Configuration
Open VS Code settings and search for "DigitalOcean" to configure:
| Setting |
Description |
Default |
digitalocean-k8s.kubeconfigPath |
Custom path for kubeconfig files |
~/.kube/ |
digitalocean-k8s.autoRefreshInterval |
Auto-refresh interval in seconds (0 to disable) |
30 |
digitalocean-k8s.defaultRegion |
Default region for new clusters |
nyc1 |
digitalocean-k8s.showNodePools |
Show node pools in cluster tree |
true |
Commands
All commands are available in the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
Authentication
DigitalOcean K8s: Authenticate with DigitalOcean
DigitalOcean K8s: Logout
Cluster Management
DigitalOcean K8s: Refresh Clusters
DigitalOcean K8s: Create Cluster
DigitalOcean K8s: Delete Cluster
DigitalOcean K8s: Download Kubeconfig
DigitalOcean K8s: Set as Current Context
DigitalOcean K8s: View Cluster Info
DigitalOcean K8s: Open in DigitalOcean Console
DigitalOcean K8s: Scale Node Pool
Resource Management
DigitalOcean K8s: Refresh Resources
DigitalOcean K8s: View Pod Logs
DigitalOcean K8s: Delete Pod
DigitalOcean K8s: Exec into Pod
DigitalOcean K8s: Port Forward
DigitalOcean K8s: Apply Manifest to Cluster
Usage Examples
Creating a New Cluster
- Click the + icon in the Clusters panel header
- Enter a cluster name (lowercase letters, numbers, hyphens)
- Select a region
- Choose the Kubernetes version
- Select node size
- Enter the number of nodes
- Choose whether to enable High Availability
- Wait for the cluster to be provisioned
Viewing Pod Logs
- Select a cluster and set it as current context
- Expand Pods in the Resources panel
- Right-click a pod and select View Pod Logs
- Choose the number of lines to fetch
- Optionally stream live logs
Port Forwarding
- Right-click a pod or service in the Resources panel
- Select Port Forward
- Enter the remote port to forward
- Enter the local port (or use the same as remote)
- The port forward will be active until you stop it
Applying Manifests
- Open a YAML file containing Kubernetes resources
- Right-click in the editor
- Select Apply Manifest to Cluster
- Choose the target namespace
- The manifest will be applied to your current cluster
Troubleshooting
kubectl not found
If you see a warning about kubectl not being installed:
- Install kubectl following the official guide
- Ensure kubectl is in your system PATH
- Restart VS Code
Authentication Issues
If authentication fails:
- Verify your API token has read/write access
- Check that the token hasn't expired
- Try logging out and re-authenticating
- Ensure you have network access to api.digitalocean.com
Cluster Connection Issues
If you can't connect to a cluster:
- Download a fresh kubeconfig
- Verify the cluster is in "running" state
- Check your network/firewall settings
- Ensure kubectl is properly configured
Security
- API tokens are stored securely using VS Code's built-in secret storage
- Kubeconfig files are created with restricted permissions (600)
- Tokens can have configurable expiration times
- No sensitive data is logged or transmitted except to DigitalOcean APIs
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
License
MIT License - see LICENSE for details.
Support