9 Upgrade Kubernetes

Upgrade the Kubernetes cluster to use the latest available Kubernetes release.

Upgrade the Kubernetes cluster to the next available minor Kubernetes version. For example, if the cluster is running Kubernetes Release 1.29, upgrade to Kubernetes Release 1.30. Then repeat the upgrade steps to upgrade to the next minor Kubernetes release, 1.31, and repeat until you're running the latest available version. For information on the latest available Kubernetes release, see Oracle Cloud Native Environment: Release Notes. For more information on upgrading Kubernetes minor releases, see Oracle Cloud Native Environment: Kubernetes Clusters.

  1. Set the target Kubernetes version.

    Use ocne cluster stage command to stage the target Kubernetes version. The syntax to use is:

    ocne cluster stage 
    [{-c|--config} path] 
    [{-r|--os-registry} registry]
    [{-t|--transport} transport]
    {-v|--version} version

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne cluster stage --version 1.30
  2. Confirm an update is available for the cluster nodes.

    Use the ocne cluster info command to confirm the nodes are staged with an updated OCK image. Use the syntax:

    ocne cluster info
    [{-N|--nodes}] nodename, ...
    [{-s|--skip-nodes }]

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne cluster info

    When an OCK image is available, staged, and ready to install, the output of this command shows the Update Available field to be true for a node.

  3. Update the control plane nodes.

    Update the control plane nodes, one node at a time, with the staged OCK image.

    Use the ocne node update command to update each node. Use the syntax:

    ocne node update 
    [{-d|--delete-emptydir-data}]
    [{-c|--disable-eviction}]
    {-N|--node} name
    [{-p|--pre-update-mode} mode]
    [{-t|--timeout} minutes] 

    For more information on the syntax options, see Oracle Cloud Native Environment: CLI.

    For example:

    ocne node update --node mynode

    Replace mynode with the name of the control plane node.

    Tip:

    After each node is updated, use the ocne cluster info command to check the update is complete. Node updates are asynchronous. The update is complete only when the output of this command reports an update is no longer available for a node.

  4. Update the worker nodes.

    Use the ocne node update command to update each worker node.

  5. Confirm Kubernetes has been upgraded.

    Use the kubectl get nodes command to confirm all nodes have been upgraded and are listed with the updated Kubernetes version.

    kubectl get nodes