Updating a Cluster
You can update some parameters of your Kubernetes clusters.
Updating a Cluster Using OKS CLI
You cannot update the |
To update the parameters of one of your clusters, use the cluster update command following this syntax:
$ oks-cli cluster update \
--project-name NAME_OF_PROJECT \
--cluster-name NAME_OF_CLUSTER \
--description "DESCRIPTION_OF_CLUSTER" \
--admin "1.2.3.4/32" \
--output json \
--version KUBERNETES_VERSION
This command contains the following options that you need to specify:
-
cluster-name
: The name of the cluster that you want to update. -
(optional)
admin
: The IPs to be whitelisted, in CIDR notation and 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)
control-plane
: The desired control plane sizing. For more information, see Control Planes. -
(optional)
description
: The updated description for the cluster. -
(optional)
disable-admission-plugins
: The list of admission plugins from the default list that you want to disable. -
(optional)
disable-api-termination
: The ability to delete the project through the API. Iftrue
, project deletion is disabled. Iffalse
, it is enabled. -
(optional)
enable-admission-plugins
: The list of additional admission plugins you want to enable on the cluster. For more information about the admissions plugins, see the Kubernetes documentation. -
(optional)
filename
: The name of the definition file from which you want to update the cluster. -
(optional)
output
: The output format for the response (json
|yaml
). By default, the response format is JSON. -
(optional)
project-name
: The name of the project containing the cluster. -
(optional)
quirk
: Advanced keys and parameters to pass to the control panel of the project. This option is required for feature requests. -
(optional)
tags
: The updated tags that you want to apply to cluster nodes. -
(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.
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.
{
"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 control plane:
-
Use the cluster upgrade command to upgrade the control plane of the cluster:
Request sample$ oks-cli cluster upgrade \ --output json
This command contains the following options that you need to specify:
-
cluster-name
: The name of the cluster. -
(optional)
project-name
: The name of the project containing the cluster. -
(optional)
output
: The output format for the response (json
|yaml
). By default, the response format is JSON.
-
-
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