Cluster Management

Cluster management refers to querying information about the K8S cluster itself.

  1. Display endpoint information about the master and services in the cluster.

kubectl cluster-info
  1. Display the Kubernetes version running on the client and server.

kubectl version
  1. Get the configuration of the cluster.

kubectl config view
  1. Get a list of users.

kubectl config view -o jsonpath='{.users[*].name}'
  1. Display the current context.

kubectl config current-context
  1. Display a list of contexts.

kubectl config get-contexts
  1. Set the default context.

kubectl config use-context <cluster name>
  1. List the API resources that are available.

kubectl api-resources
  1. List the API versions that are available.

kubectl api-versions

Last updated