Kubernetes Client and Server Version

KubernetesKubernetesBeginner
Practice Now

Introduction

Kubernetes is a popular container orchestration tool that enables developers to deploy, scale, and manage containerized applications. In this lab, you will learn how to print the client and server version information on Kubernetes. This information can be useful for troubleshooting and understanding which version of Kubernetes is running.

Prerequisites

  • A running Kubernetes cluster
  • Access to a terminal with kubectl installed

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL kubernetes(("`Kubernetes`")) -.-> kubernetes/ConfigurationandVersioningGroup(["`Configuration and Versioning`"]) kubernetes/ConfigurationandVersioningGroup -.-> kubernetes/version("`Version`") subgraph Lab Skills kubernetes/version -.-> lab-9197{{"`Kubernetes Client and Server Version`"}} end

Print the Server Version Information

To print the server version information, execute the following command:

kubectl version

This will output the server version information, including the Kubernetes version, Git commit hash, and build date, as well as the Kubernetes API serverversion, controller manager version, and scheduler version.

lab-kubernetes-client-and-server-version-2

Print the Client Version Information

To print the client version information, execute the following command:

kubectl version --client

This will output the client version information, including the Kubernetes version, Git commit hash, and build date.

lab-kubernetes-client-and-server-version-1

Print the Server Version Information With JSON Output

To print the server version information with JSON output, execute the following command:

kubectl version --output=json

This will output the server version information in JSON format.

lab-kubernetes-client-and-server-version-3

Print the Server Version Information in YAML Format

To print the server version information in YAML format, execute the following command:

kubectl version --output=yaml

This will output the server version information in YAML format.

lab-kubernetes-client-and-server-version-4

Summary

In this lab, you learned how to print the client and server version information on Kubernetes. You also learned how to output the server version information in JSON and YAML formats. This information can be useful for troubleshooting and understanding which version of Kubernetes is running.

Other Kubernetes Tutorials you may like