Last modified October 2, 2020

kubectl gs get clusters

We assume that you have the alias kgs set up for the command kubectl gs.

Like with all get commands in kubectl, this command can be used to get details on one item, a cluster in this case, or list several of them.

Usage

Get a list of clusters

Simply execute

kgs get clusters

to list some information on all clusters available to you in the current installation.

Here is some example output:

ID      CREATED                         CONDITION   RELEASE   ORGANIZATION   DESCRIPTION
3i99p   2020-09-29 11:51:52 +0000 UTC   CREATED     12.1.4    giantswarm     ced0ps kong pm

Get specific cluster

When used with a cluster ID as additional argument, the command will show details for a single cluster. Example:

kgs get clusters ab12c

Note: As an alternative to get clusters, get cluster will also work.

Output

The standard tabular output format features these columns:

  • ID: Unique identifier of the cluster.
  • CREATED: Date and time of the Cluster CR creation.
  • CONDITION: Latest condition reported for the cluster. Either of:
    • CREATING: The cluster is currently being created.
    • CREATED: Cluster creation is finished.
    • UPDATING: The cluster is currently being updated, e. g. during an upgrade.
    • UPDATED: The cluster update is finished.
    • DELETING: The cluster is being deleted.
  • RELEASE: Tenant cluster release version of the cluster.
  • ORGANIZATION: Organization owning the cluster.
  • DESCRIPTION: User friendly description for the cluster.

Flags

Here we document the flags that have a particular meaning for the get clusters command. Use kgs get clusters --help for a full list.

--output/-o

kubectl commonly allows to specify the output format for all get subcommands. kgs get clusters is no different.

YAML output

To inspect a cluster’s main custom resource in YAML notation, add the --output yaml flag (or -o yaml in short) to the command.

The following example command would print the main resource for cluster ab12c. On AWS that would be the AWSCluster resource printed. On Azure, it would return the Cluster resource.

kgs get clusters ab12c --output yaml

When applied without a cluster ID argument, the output will be a list of resources. Example:

$ kgs get clusters ab12c --output yaml
apiVersion: v1
kind: List
items:
- apiVersion: infrastructure.giantswarm.io/v1alpha2
  kind: AWSCluster
...