doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / List Kubernetes Clusters

List Kubernetes Clusters

Doctl command syntax to list kubernetes clusters. Copyable examples, output expectations, and common mistakes.

$
Terminal
doctl k c ls

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
ID              Name                Region          Version
-----------------------------------------------------
abc123          my-cluster-1       nyc1            1.21.5
def456          my-cluster-2       sfo1            1.22.0
ghi789          my-cluster-3       lon1            1.23.1

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
k
k|kubernetes
The value supplied for k|kubernetes.
c
c|cluster
The value supplied for c|cluster.
ls
ls|list
The value supplied for ls|list.

How To Run

Execution path

  1. Step 1

    Open your terminal.

  2. Step 2

    Run the command: doctl kubernetes cluster ls.

  3. Step 3

    Review the list of clusters displayed.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.