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.
With the Kubernetes Explorer, you can access information about your clusters, nodes, workloads, and more, as well as set an active 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.
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.
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'.
Additionally, you can force a refresh of the entire explorer using the Kubernetes Explorer's refresh button.
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.
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 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.
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.
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.
Add a Google Kubernetes Engine cluster: Add an existing GKE cluster or create a new one by clicking on the Add GKE Cluster button 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.
Set as active context: Set specified cluster as active such that your configured
kubectlcontext will access this cluster by default.
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 active.
Set as active context: Set a namespace as active such that your configured
kubectlcontext will access this namespace by default.
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 an active context.
- 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
- 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. 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.
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: