LinuxCommandLibrary

kubectl-api-versions

List Kubernetes API versions

TLDR

Print the supported API versions on the server, in the form of "group/version"

$ kubectl api-versions
copy

SYNOPSIS

kubectl api-versions [options]

PARAMETERS

-h, --help
    Provides help information about the kubectl api-versions command, detailing its usage and available options.

DESCRIPTION

The kubectl api-versions command displays a comprehensive list of all API groups and their supported versions that are available on the currently configured Kubernetes cluster. This command is particularly useful for cluster administrators and developers to quickly ascertain which API versions are active and can be used for various resources. It helps in understanding the cluster's capabilities and ensuring compatibility when creating or managing resources. The output is presented in the format of "group/version".

CAVEATS

This command requires an active connection to a Kubernetes cluster via the kubectl configuration. If no cluster is configured or reachable, the command will fail with a connection error. The output reflects the API versions supported by the kube-apiserver component of the cluster, not necessarily all possible Kubernetes API versions that have ever existed.

USAGE CONTEXT

This command is frequently used when troubleshooting resource creation failures related to unsupported API versions, or when developing new applications that need to ensure compatibility with a specific cluster's API surface. It provides a foundational understanding of the cluster's API maturity and the features it supports.

HISTORY

The api-versions subcommand is a core utility within kubectl, provided to give users immediate insight into the cluster's API capabilities. Its simple interface makes it a quick diagnostic tool, allowing users to verify API availability without needing to query specific resource types. It has been a stable part of kubectl for a significant period, reflecting the consistent need to inspect the server's API surface.

SEE ALSO

kubectl api-resources(1), kubectl get(1), kubectl version(1)

Copied to clipboard