Access Your Cluster from VSCode Extension
To access your cluster from your VSCode extension, follow these steps:
Prerequisites
Make sure you have kubectl installed on your system. The Kubernetes extension requires kubectl to communicate with your cluster. (TIP: You probably don't need to scroll far, you'll find instructions right at the top for common platforms: Linux, macOS, Windows)
Install VSCode Extension
On VSCode (or VS Code-based IDE like Cursor), install the Kubernetes Extension.
Open Kubernetes Extension Menu
Open the Kubernetes Extension menu by clicking the Kubernetes icon in the sidebar or pressing Ctrl+Shift+P
and searching for "Kubernetes: Focus on Clusters View".
Open Your Kubeconfig
Kubeconfig not found
If you see an alert saying Kubeconfig not found at 'C:\Users\...'. Add a new one?
, click "Add" and select your previously downloaded Kubeconfig file.
In the Kubernetes extension panel:
- Click the "..." button in the clusters view
- Select "Set Kubeconfig" and choose your previously downloaded Kubeconfig file
Your cluster should now be accessible through the Kubernetes extension panel.
Verify Connection
You can verify your connection by expanding your cluster in the extension panel to view nodes, pods, and other resources.
Troubleshooting
Extension not detecting cluster
If the extension doesn't show your cluster:
- Verify your kubeconfig file is valid
- Check that kubectl can access your cluster:
kubectl get nodes
- Restart VSCode after installing the extension