doctl Verified current stable Not installed? Kubernetes

Doctl / Check For Upgrades

Check For Upgrades

Checks for available upgrades for a specific Kubernetes cluster.

$
Terminal
doctl kubernetes cluster get-upgrades <cluster_name>

When To Use

When preparing for a planned maintenance window to update the cluster.

Pro Tip

Use `--format=json` to get a machine-readable output which can be parsed for automation.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl kubernetes cluster get-upgrades <cluster_name>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl kubernetes cluster get-upgrades my-cluster

Available Upgrades:
+----------------+----------------+----------------+----------------+
| Current Version| Upgrade Version | Release Date    | Status         |
+----------------+----------------+----------------+----------------+
| 1.21.5        | 1.22.0        | 2023-09-15     | Available       |
| 1.21.5        | 1.23.0        | 2023-10-01     | Available       |
+----------------+----------------+----------------+----------------+

Anatomy of Output

Understanding the result

Current Version: 1.21.7 Current Cluster Version

Shows the currently installed version of the Kubernetes cluster.

Available Upgrades: 1.22.0 Available Upgrades

Indicates the version(s) available for upgrade.

Upgrade Status: Ready Upgrade Status

Shows if the cluster is ready for the upgrade.

Troubleshooting

Common pitfalls

Error: Cluster not found: {{cluster_name}}.

Solution: Check if the cluster name is correct and exists.

Error: Unauthorized access to cluster upgrade information.

Solution: Verify that your API token has the necessary scopes.

Error: Unable to connect to the cluster's API server.

Solution: Ensure network connectivity and validate the cluster endpoint.

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.
<cluster_name>
cluster name
The value supplied for cluster name.

How To Run

Execution path

  1. Step 1

    Run `doctl kubernetes cluster get-upgrades {{cluster_name}}` to check available upgrades.

  2. Step 2

    Review the output for current and upgrade versions along with their statuses.

Alternative Approaches

Comparable commands in other tools

Alternative kubernetes tools for the same job.