Updating a Cluster

You can update some parameters of your Kubernetes clusters.

Updating a Cluster Using OKS CLI

You cannot update the parenting project and profile parameters of the cluster.

To update the parameters of one of your clusters, use the cluster update command following this syntax:

Request sample
$ oks-cli cluster update \
  --project-name NAME_OF_PROJECT \
  --cluster-name NAME_OF_CLUSTER \
  --description "DESCRIPTION_OF_CLUSTER" \
  --admin "1.2.3.4/32" \
  --version KUBERNETES_VERSION

This command contains the following options that you need to specify:

  • cluster-name: The name of the cluster, with a maximum length of 40 alphanumeric characters and dashes (-). This name must not start or end with a dash, and it must be unique within the project.

  • (optional) project-name: The name of the project in which the cluster you want to update is located.

  • (optional) description: The updated description for the cluster.

  • (optional) admin: The CIDRs to be whitelisted, separated by commas. This range of one or multiple IPs is empty by default, and should be specified in order to manage the cluster after creation.

  • (optional) version: The Kubernetes version to use for the cluster. For more information about the supported versions, see About OKS > Kubernetes Versions Support. The latest patch for the specified version is automatically used.

  • (optional) output: The output format for the response (json| yaml). By default, the response format is JSON.

The cluster update command returns the following elements:

  • project_id: The unique identifier of the project in which the cluster you updated is located.

  • id: The unique identifier of the cluster you updated.

  • name: The name of the cluster you updated.

  • description: The updated description of the cluster.

Result sample
{
    "project_id": "2f4gc161-7b4c-4464-8f45-4f6daf4a09c8",
    "id": "bcd8c536-36f4-422c-838f-189c23dd6253",
    "name": "NAME_OF_CLUSTER",
    "description": "DESCRIPTION_OF_CLUSTER",
...
}

Upgrading the Kubernetes Version

To upgrade the Kubernetes version, first run the cluster update command, then apply the upgrade to the cluster’s planes:

  1. Use the cluster upgrade command to upgrade the control plane of the cluster:

    Request sample
    $ oks-cli cluster upgrade
  2. Renew the node pools to upgrade the cluster’s worker nodes.

    For each existing node pool, you will need to create a new one and then delete the old node pool. For more information, see Managing Your Worker Nodes.

Related Pages

Corresponding API Methods