K8s Explorer
A read-only Kubernetes / OpenShift explorer for VS Code. It aims to be as simple as
Portainer for Kubernetes and borrows Argo CD's ideas: health per object, a workload
expands to its pods, YAML without managed fields, logs of a whole application.
It runs your own CLI (oc, kubectl or microk8s kubectl). Clusters are defined in
one plain-text file, similar to ~/.ssh/config.
Layout
| Where |
What |
| Side bar Namespaces |
Namespace → Events (newest first) · Applications · Volumes · Config & Secrets · Networking · More Resources → kind → objects. Workloads expand to their pods, CronJobs to their Jobs. |
| Editor area |
Dashboards and tables. Double-click a namespace, group, kind or object. |
| Bottom panel K8s Explorer (next to Terminal) |
YAML, Describe and Logs, one numbered tab each. Pin a tab (pin icon on hover) to keep it first and open: a pinned tab has no close button and stays when you switch clusters. |
- Single click expands or collapses an item.
- Double-click opens its dashboard in the editor area.
- Hover icons and the context menu on an object: Show Logs, Show YAML, Describe, Open Dashboard, Copy Name.
- In a dashboard, click a name to open that object, or use the Logs · YAML · Describe links on each row.
Export Ingress Hosts (context menu of a namespace, Networking or Ingresses; or the
... menu of the view for all shown namespaces) writes hosts file lines such as
100.64.1.24 app.example.com # ns/app into the bottom panel, ready to copy into
/etc/hosts. Ingress addresses that are host names (e.g. an OpenShift router) are
resolved on your machine. A 127.0.0.1 address (MicroK8s ingress addon) is written as
the API server host.
Log tabs stream with -f. The toolbar has a text filter (matches are highlighted),
Only matching to hide other lines, container selection, Previous,
Timestamps, Follow and Wrap. Workload logs (Deployment, StatefulSet,
DaemonSet, Job) cover all of their pods, each line prefixed with its pod and container.
Getting started
Open the K8s Explorer view and click the gear (Edit Cluster Config). A commented
template is created at ~/.k8s-explorer/config.
Add a cluster, for example:
Cluster enigma
Tool oc
Server https://api.example.com:6443
User myuser
InsecureSkipTlsVerify yes
Namespaces team-*
Save. The tree loads. Without Password you are asked once, and the password is kept
in VS Code Secret Storage.
See CONFIGURATION.md for all keywords and settings.
Read-only
The extension only runs get, describe, logs, top, whoami, config view (to read
the API server address) and login (for User/Password clusters). Any other verb is refused in code before a process starts.
Secret values are masked in the YAML view. Every command it runs is written to the
K8s Explorer output channel, with passwords and tokens hidden.
Development
npm install
npm run build # esbuild bundle -> dist/extension.js
npm test # tsc -> out/, then node --test
npm run lint
make package # .vsix
Press F5 to start an Extension Development Host.