The Kubernetes Explorer pane lets you access information about your clusters, nodes, workloads, and more, right from your IDE. You can also set a current context, stream and view logs, open an interactive terminal, and look up resource descriptions with the Kubernetes Explorer.
Accessing the Kubernetes Explorer
For easier management of Kubernetes resources, you can use the Kubernetes Explorer, accessible from the side panel on the right. Alternatively, it can be accessed using Tools > Cloud Code > Kubernetes > View Cluster Explorer.
While Cloud Code uses the default kubeconfig file, located under the '$HOME/.kube' directory, for retrieving Kubernetes resources, you can choose to use alternate kubeconfig files. Refer to Working with additional kubeconfig files for details on how to manage your kubeconfigs.
The Kubernetes Explorer is powered by
kubectl. As long as you've configured
kubectl context to access your clusters, you can use the
Kubernetes Explorer to browse all your available namespaces, resources, and
nodes for your clusters, regardless of them being in the active
or inactive context.
The available general Kubernetes Explorer actions, accessible via their icons in the Explorer, are:
- Creating a new Kubernetes application from a sample
- Refreshing the Explorer
- Opening the Cloud Code Kubernetes documentation in a web browser
Copying resource name
You can copy any Kubernetes resource name to the clipboard (including container and cluster names).
The Kubernetes Explorer watches for changes and automatically refreshes to reflect updates. To force a refresh of any Kubernetes resource to fetch its latest information, right-click the resource and choose Refresh.
You can force a refresh of the entire explorer using the Kubernetes Explorer's refresh button.
To display the details of any non-cluster resource, choose Describe. This presents resource information in the Kubernetes Explorer console panel.
To view resource details, you can also click any resource. If it has attached metadata, the metadata is available in the Resource Details panel in the Kubernetes Explorer.
Viewing remote YAML
You can view the YAML of a resource in your cluster, right from the Kubernetes Explorer. Navigate to a resource in the Kubernetes Explorer, such as a pod, right-click the resource name, and then select View Remote YAML.
This opens the YAML file corresponding to your specified resource in a new editor tab.
For pods, containers, deployments, services, and replica sets, you can stream and view logs from these resources into the Kubernetes Explorer console to monitor their progress.
Launching a terminal
For pods and containers, you can open an interactive terminal.
The Kubernetes Explorer displays clusters, namespaces, nodes, workloads (such as deployments, replicasets, pods and containers), services and ingresses, configurations (such as secrets and config maps) and storage (such as volumes). Using the Kubernetes Explorer, you can perform unique actions on some of these resources.
Add a Google Kubernetes Engine cluster: Add an existing Standard or Autopilot GKE cluster or create a new one by clicking the Add GKE Cluster button within the Kubernetes Explorer.
This brings up the Add GKE Cluster dialog where you can choose the project and cluster you'd like to use. You can also create a new cluster and return to this dialog.
Once done, click OK and access your chosen cluster and its underlying resources through the Kubernetes Explorer.
Set as current context: Set specified cluster as active such that your configured
kubectlcontext accesses this cluster by default.
If this action is successful, the explorer refreshes automatically and you'll see the Kubernetes symbol next to the appropriate cluster.
Additionally, if a cluster has multiple contexts configured, you'll be able to choose one of the available contexts to set as the current context.
Set as current context: Set a namespace as active such that your configured
kubectlcontext accesses this namespace by default.
If this action is successful, the explorer refreshes automatically and you'll see an asterisk next to the namespace to signify that it's part of the current context.
Note that a Kubernetes context is a shortcut which gives you quick access to a namespace in your cluster. Contexts are normally created automatically when you start a minikube or GKE cluster. If you don't see the Set as current context option for a given namespace and you'd like to create a context for it, use the
kubectl config set-contextcommand in your terminal to set a context with your preferred cluster, user, and namespace.
- Stream Logs: Stream logs from a pod into the Kubernetes Explorer Console.
Get Terminal: Get terminal for a pod in the Kubernetes Explorer Console.
Additionally, running pods have colored status marks next to their labels:
- Red: Pod is in a failed state
- Yellow: Pod is starting or terminating
- Green: Pod is healthy and running
- Stream Logs: Stream logs from a container into the Kubernetes Explorer console.
Get Terminal: Get a terminal for a container in the Kubernetes Explorer console.
Stream Logs: Stream logs from a deployment into the Kubernetes Explorer console.
Live deployments have colored status marks next to their labels and counts of current/total replicas:
- Yellow: Deployment does not have minimum availability or have image problems.
- Green: Deployment is healthy and had minimum availability.
Nodes of your cluster have colored status marks next to their names:
- Yellow: Node has a resource problem such as memory or disk availability.
- Green: Node is healthy.
Custom Resource Definitions (CRDs)
The Kubernetes Explorer lists all Custom Resource Definitions (CRDs) installed and available on your cluster: