Using 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.

Kubernetes Explorer panel open using the tab on the right side taskbar

With the Kubernetes Explorer, you can access information about your clusters, nodes, workloads, and more, as well as set an current context, stream and view logs, open an interactive terminal, and look up resource descriptions.

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.

Basic actions

The Kubernetes Explorer is powered by kubectl. As long as you've configured your 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.

Copying resource name

You can copy any Kubernetes resource name to the clipboard (including container and cluster names). Copying a resource name using its right-click menu

Refreshing resources

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'. Refreshing a pod using its right-click accessible refresh menu

Additionally, you can force a refresh of the entire explorer using the Kubernetes Explorer's refresh button.

Refresh button for Kubernetes Explorer

Describing resources

You can run a kubectl describe on any (non-cluster) resource to display its details by choosing Describe. This will present resource information in the Kubernetes Explorer Console panel.

Describe option available when right-clicking an appropriate resource within the Kubernetes Explorer panel and choosing Describe

To view resource details, you can also click on any resource. If it has attached metadata, this will be available in the Resource Details Panel within the Kubernetes Explorer.

Viewing resource metadata within the Resource Details panel available in the second half of 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, and select 'View Remote YAML'.

This opens the YAML file corresponding to your specified resource in a new editor tab.

Viewing the YAML of a pod by right-clicking its label in the Kubernetes Explorer and choosing 'View Remote YAML'

Streaming logs

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.

Streaming logs from a pod using its right-click menu to output logs into the Kubernetes Explorer Console

Launching a terminal

For pods and containers, you can open an interactive terminal.

Using the right click menu on a pod to access an interactive terminal in the Kubernetes Explorer Console

Resource specific actions

The Kubernetes Explorer displays clusters, namespaces, nodes, workloads (such as deployments, replicasets, pods and containers), services and ingresses, configurations (secrets, config maps, etc.) and storage (volumes etc.). Using the Kubernetes Explorer, you can perform unique actions on some of these resources.

Clusters

  • 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 Add cluster plus icon within the Kubernetes Explorer.

    This brings up the Add GKE Cluster dialog where you can choose the project and the respective cluster you'd like to use. You can also create a new cluster and return back to this dialog.

    Once done, click OK and access your chosen cluster and its underlying resources through the Kubernetes Explorer.

    Adding a GKE cluster with Kubernetes Explorer dialog with fields for project and cluster names

  • Set as current context: Set specified cluster as active such that your configured kubectl context will access this cluster by default.

    Setting a cluster as the current context with Kubernetes Explorer

    If this action is successful, the explorer will refresh 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.

    Choosing and setting an active cluster from a list of multiple contexts with Kubernetes Explorer

Namespaces

  • Set as current context: Set a namespace as active such that your configured kubectl context will access this namespace by default.

    Setting a namespace as current using the right-click menu

    If this action is successful, the explorer will refresh automatically and you'll see an asterisk next to the namespace to signify that it's part of the current context.

Pods

  • 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 will 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

    Pod status is healthy as observed by the green check mark next to the pod label

Containers

  • 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.

    Streaming logs from a container using its right-click menu to output logs into the Kubernetes Explorer Console

Deployments

  • Stream Logs: Stream logs from a deployment into the Kubernetes Explorer Console. Additionally, live deployments will have colored status marks next to their labels, as well as counts of current / total replicas:

    • Yellow: Deployment does not have minimum availability or have image problems.
    • Green: Deployment is healthy and had minimum availability.

    Deployment status is healthy as observed by the green check mark next to the deployment label

Nodes

Nodes of your cluster will 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 will list all Custom Resource Definitions (CRDs) installed and available on your cluster:

List of custom resource definitions in the explorer

Getting Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.