gcloud_alpha_container_clusters_upgrade (1)
NAME
- gcloud alpha container clusters upgrade - upgrade the Kubernetes version of an existing container cluster
SYNOPSIS
-
gcloud alpha container clusters upgrade NAME [--async] [--cluster-version=CLUSTER_VERSION] [--concurrent-node-count=CONCURRENT_NODE_COUNT] [--image-type=IMAGE_TYPE] [--master] [--node-pool=NODE_POOL] [--region=REGION | --zone=ZONE, -z ZONE] [--security-profile=SECURITY_PROFILE --security-profile-runtime-rules] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) Upgrades the Kubernetes version of an existing container cluster.
If desired cluster version is omitted, node upgrades default to the current master version and master upgrades default to the default cluster version, which can be found in the server config.
By running this command, all of the cluster's nodes will be deleted and recreated one at a time. While persistent Kubernetes resources, such as pods backed by replication controllers, will be rescheduled onto new nodes, a small cluster may experience a few minutes where there are insufficient nodes available to run all of the scheduled Kubernetes resources.
Please ensure that any data you wish to keep is stored on a persistent disk before upgrading the cluster. Ephemeral Kubernetes resources--in particular, pods without replication controllers--will be lost, while persistent Kubernetes resources will get rescheduled.
POSITIONAL ARGUMENTS
-
- NAME
-
The name of the cluster to upgrade.
FLAGS
-
- --async
-
Don't wait for the operation to complete.
- --cluster-version=CLUSTER_VERSION
-
The Kubernetes release version to which to upgrade the cluster's nodes.
If desired cluster version is omitted, node upgrades default to the current master version and master upgrades default to the default cluster version, which can be found in the server config.
You can find the list of allowed versions for upgrades by running:
- $ gcloud container get-server-config
- --concurrent-node-count=CONCURRENT_NODE_COUNT
-
The number of nodes to upgrade concurrently. Valid values are [1, 20]. It is a
recommended best practice to set this value to no higher than 3% of your cluster
size.'
- --image-type=IMAGE_TYPE
-
The image type to use for the cluster/node pool. Defaults to server-specified.
Image Type specifies the base OS that the nodes in the cluster/node pool will run on. If an image type is specified, that will be assigned to the cluster/node pool and all future upgrades will use the specified image type. If it is not specified the server will pick the default image type.
The default image type and the list of valid image types are available using the following command.
- $ gcloud container get-server-config
- --master
-
Upgrade the cluster's master to the latest version of Kubernetes supported on
Kubernetes Engine. Nodes cannot be upgraded at the same time as the master.
- --node-pool=NODE_POOL
-
The node pool to upgrade.
-
At most one of these may be specified:
-
- --region=REGION
-
Compute region (e.g. us-central1) for the cluster.
- --zone=ZONE, -z ZONE
-
Compute zone (e.g. us-central1-a) for the cluster. Overrides the default
compute/zone property value for this command invocation.
-
-
Flags for Security Profile:
-
- --security-profile=SECURITY_PROFILE
-
Name and version of the security profile to be applied to the cluster. If not
specified, the current security profile settings are preserved. If the current
security profile is not supported in the new cluster version, this option must
be explicitly specified with a supported security profile, otherwise the
operation will fail.
Example:
-
$ gcloud alpha container clusters upgrade example-cluster \
--security-profile=default-1.0-gke.1
-
$ gcloud alpha container clusters upgrade example-cluster \
- --security-profile-runtime-rules
-
Apply runtime rules in the specified security profile to the cluster. When
enabled, a security profile controller and webhook are deployed on the cluster
to enforce the runtime rules. If --no-security-profile-runtime-rules is
specified to disable this feature, only bootstrapping rules are applied, and no
security profile controller or webhook are installed.
-
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
Upgrade the nodes of <cluster> to the Kubernetes version of the cluster's master.
- $ gcloud alpha container clusters upgrade <cluster>
Upgrade the nodes of <cluster> to Kubernetes version x.y.z:
-
$ gcloud alpha container clusters upgrade <cluster> \
--cluster-version "x.y.z"
Upgrade the master of <cluster> to the default cluster version:
- $ gcloud alpha container clusters upgrade <cluster> --master"
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support These variants are also available:
- $ gcloud container clusters upgrade $ gcloud beta container clusters upgrade