godo.Kubernetes.Upgrade()

Generated on 5 Nov 2026 from godo version v1.236.0

Usage

client.Kubernetes.Upgrade(ctx context.Context, clusterID string, upgrade *godo.KubernetesClusterUpgradeRequest) (*godo.Response, error)

Description

Upgrade upgrades a Kubernetes cluster to a new version. Valid upgrade versions for a given cluster can be retrieved with GetUpgrades.

This method sends a POST request to /v2/kubernetes/clusters/{}/upgrade.

Parameters

clusterID string required
upgrade *godo.KubernetesClusterUpgradeRequest required

Fields of godo.KubernetesClusterUpgradeRequest

KubernetesClusterUpgradeRequest represents a request to upgrade a Kubernetes cluster.

VersionSlug string

Omitted from JSON when empty. JSON key: version

Returns

*godo.Response

The HTTP response, with pagination Links, Meta, and Rate limit information.

error

Non-nil when the request fails. API errors are returned as *godo.ErrorResponse.

Fields of godo.Response

Response is a DigitalOcean response. This wraps the standard http.Response returned from DigitalOcean.

Response *http.Response
Links *godo.Links

Links that were returned with the response. These are parsed from
request body and not the header.

Meta *godo.Meta

Meta describes generic information about the response.

Monitor string

Monitoring URI

Rate godo.Rate

Request Sample

Show Request Sample
package main

import (
	"context"
	"log"
	"os"

	"github.com/digitalocean/godo"
)

func main() {
	client := godo.NewFromToken(os.Getenv("DIGITALOCEAN_TOKEN"))
	ctx := context.TODO()

	_, err := client.Kubernetes.Upgrade(ctx, "<your-cluster-id>", &godo.KubernetesClusterUpgradeRequest{})
	if err != nil {
		log.Fatal(err)
	}
}

More Information

See POST /v2/kubernetes/clusters/{}/upgrade in the API reference for additional detail on responses, headers, parameters, and more.

See the Go package documentation for the source of this method.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.