Cluster Information

Prints Cluster Information

Cluster Info


It may be necessary to learn about the Kubernetes cluster itself, rather than just the workloads running in it. This can be useful for debugging unexpected behavior.


The kubectl version prints the client and server versions. Note that the client version may not be present for clients built locally from source.

kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.5", GitCommit:"f01a2bf98249a4db383560443a59bed0c13575df", GitTreeState:"clean", BuildDate:"2018-03-19T19:38:17Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11+", GitVersion:"v1.11.6-gke.2", GitCommit:"04ad69a117f331df6272a343b5d8f9e2aee5ab0c", GitTreeState:"clean", BuildDate:"2019-01-04T16:19:46Z", GoVersion:"go1.10.3b4", Compiler:"gc", Platform:"linux/amd64"}

Control Plane and Addons

The kubectl cluster-info prints information about the control plane and add-ons.

kubectl cluster-info
  Kubernetes master is running at
  GLBCDefaultBackend is running at
  Heapster is running at
  KubeDNS is running at
  Metrics-server is running at


The kubectl top node and kubectl top pod print information about the top nodes and pods.

kubectl top node
  NAME                                 CPU(cores)   CPU%      MEMORY(bytes)   MEMORY%   
  gke-dev-default-pool-e1e7bf6a-cc8b   37m          1%        571Mi           10%       
  gke-dev-default-pool-e1e7bf6a-f0xh   103m         5%        1106Mi          19%       
  gke-dev-default-pool-e1e7bf6a-jfq5   139m         7%        1252Mi          22%       
  gke-dev-default-pool-e1e7bf6a-x37l   112m         5%        982Mi           17%  


The kubectl api-versions and kubectl api-resources print information about the available Kubernetes APIs. This information is read from the Discovery Service.

Print the Resource Types available in the cluster.

kubectl api-resources
NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND
bindings                                                                      true         Binding
componentstatuses                 cs                                          false        ComponentStatus
configmaps                        cm                                          true         ConfigMap
endpoints                         ep                                          true         Endpoints
events                            ev                                          true         Event
limitranges                       limits                                      true         LimitRange
namespaces                        ns                                          false        Namespace

Print the API versions available in the cluster.

kubectl api-versions

The kubectl explain command can be used to print metadata about specific Resource types. This is useful for learning about the type.

kubectl explain deployment --api-version apps/v1
KIND:     Deployment
VERSION:  apps/v1

     Deployment enables declarative updates for Pods and ReplicaSets.

   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:

   metadata	<Object>
     Standard object metadata.

   spec	<Object>
     Specification of the desired behavior of the Deployment.

   status	<Object>
     Most recently observed status of the Deployment.

Last modified September 30, 2020: SIG CLI docs - guide changes (d705a6d)