doctl Verified current stable Not installed? Kubernetes

Doctl / Upgrade Kubernetes Cluster

Upgrade Kubernetes Cluster

Upgrades a specified Kubernetes cluster to a target version.

$
Terminal
doctl k c upgrade <cluster_name>

When To Use

During a scheduled maintenance period or when a critical vulnerability is identified in the current version.

Pro Tip

Check the changelog for compatibility issues between versions; some upgrades may require additional configuration changes.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl k c upgrade <cluster_name>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Upgrading Kubernetes cluster 'my-cluster'...

+---------------------+---------------------+
| Current Version     | 1.21.5              |
| Upgrade Version     | 1.22.0              |
| Status              | In Progress         |
+---------------------+---------------------+

Upgrade initiated. Please wait for completion...

Anatomy of Output

Understanding the result

Upgrading cluster: my-cluster Progress Indicator

Indicates the cluster that is currently being upgraded.

Successfully upgraded to version 1.22.0 Upgrade Status

Confirmation of successful version upgrade.

Estimated time: 5 minutes Time Estimate

Approximate time to complete the upgrade.

Troubleshooting

Common pitfalls

Error: Upgrade failed due to incompatible configuration.

Solution: Review the compatibility documentation for changes between versions.

Error: Cluster {{cluster_name}} not found.

Solution: Ensure the correct cluster name is used.

Error: Insufficient permissions to upgrade the cluster.

Solution: Ensure the account has the necessary privileges to perform upgrades.

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

How To Run

Execution path

  1. Step 1

    Run `doctl kubernetes cluster upgrade my-cluster` to start the upgrade process.

  2. Step 2

    Monitor the upgrade status using `doctl kubernetes cluster get my-cluster`.

Alternative Approaches

Comparable commands in other tools

Alternative kubernetes tools for the same job.