Discover Kubernetes Cluster Versions

KubernetesBeginner
Practice Now

Introduction

In this challenge, you will need to verify the Kubernetes environment's version details as a junior DevOps engineer. This is to ensure system compatibility and prepare for a critical infrastructure upgrade. You will be required to retrieve the Kubernetes cluster version information, display the version details in JSON format, and verify the compatibility between client and server versions using the kubectl version command.

Retrieve Kubernetes Version

As a junior DevOps engineer, you need to verify the Kubernetes environment's version details to ensure system compatibility and prepare for a critical infrastructure upgrade.

Tasks

  • Retrieve the Kubernetes cluster version information
  • Display the version details in JSON format
  • Verify the compatibility between client and server versions

Requirements

  • Use the kubectl version command
  • Output the version information in JSON format
  • Ensure you are working in the ~/project directory
  • Use Minikube as the local Kubernetes cluster

Examples

Example JSON output:

{
  "clientVersion": {
    "major": "1",
    "minor": "26",
    "gitVersion": "v1.26.0"
  },
  "serverVersion": {
    "major": "1",
    "minor": "26",
    "gitVersion": "v1.26.0"
  }
}

Hints

  • Remember the --output=json flag for JSON formatting
  • Check the Kubernetes documentation for version command options
  • Verify the cluster is running before executing version commands

Summary

In summary, this challenge requires you to verify the Kubernetes cluster version details, including both the client and server versions, and ensure compatibility between them. You will need to use the kubectl version command with the --output=json flag to retrieve the version information in JSON format. The goal is to prepare for a critical infrastructure upgrade by confirming the Kubernetes environment's version compatibility.

✨ Check Solution and Practice