Kubernetes is a popular container orchestration framework. It enables you to scale and manage large clusters of containers to deploy your applications efficiently to a large number users. Kubectl is a command-line tool that is used to manage your Kubernetes cluster.
In this guide, you will learn how to check the version of your Kubernetes resources using
Using kubectl version
kubectl provides a very simple command for viewing version details:
However, there are a number of ways you can use this command. Also, there are a few other things you might be looking for when viewing the version of your Kubernetes resources. Let’s take a look at them one by one.
Running kubectl version
You can view the cluster version using this command. Cluster version, here, refers to the version of the API server of your cluster. If you run the above command, you will receive a similar output:
The command returns two version details with quite verbose output.
The server version refers to the version of your Kubernetes API server. The client version refers to the version of your kubectl CLI.
Viewing shorter versions
You can switch to a cleaner version using the following command:
Now, you will receive a similar output:
Viewing the client version only
You can also view only the client version by running the following command:
This will return only the
kubectl CLI version to the output.
This is useful in situations when your CLI is not connected to an active Kubernetes API server. You can still access the CLI version without getting an error.
If you are looking for the version details of your nodes, you need to run the following command:
In the output that will be generated, you will see the version of the kubelet of each node listed against it:
For a more generalistic approach, you can append
-o yaml to most commands to get a more detailed output, possibly containing version details that you are looking for. For instance, you can also view the version details of the kubelets of each node by running
kubectl get nodes -o yaml and searching through the output for “kubelet”.
Kubernetes is, without a doubt, one of the most complex open-source projects. In this guide, you learned how to view the version details for a wide variety of resources and entities in Kubernetes.
If you're looking for a code-first internal tooling platform that makes it easy for engineers to transform scripts, queries, APIs, and more into powerful internal UIs and workflows, then check out Airplane. Airplane offers Tasks, which are single or multi-step functions that anyone on your team can use, and Views, which allow users to build custom UIs within minutes.