Oracle Cloud Infrastructure Documentation

'Upgrading' the version of Kubernetes running on worker nodes by creating a new node pool

To 'upgrade' the version of Kubernetes running on worker nodes in a node pool, you replace the original node pool with a new node pool that has new worker nodes running the appropriate Kubernetes version. Having 'drained' existing worker nodes in the original node pool to prevent new pods starting and to delete existing pods, you can then delete the original node pool.

To 'upgrade' the version of Kubernetes on worker nodes by creating a new node pool:

  1. In the Console, open the navigation menu. Under Solutions, Platform and Edge, go to Developer Services and click Container Clusters.
  2. Choose a Compartment you have permission to work in.
  3. On the Cluster List page, click the name of the cluster where you want to change the Kubernetes version running on worker nodes.
  4. On the Cluster page, click Add Node Pool to create a new node pool and specify the required version of Kubernetes for its worker nodes.

    The version of Kubernetes you specify must be compatible with the version that is running on the master nodes.

  5. If there are labels attached to worker nodes in the original node pool and those labels are used by selectors (for example, to determine the nodes on which to run pods), then use the kubectl label nodes command to attach the same labels to the new worker nodes in the new node pool. See Assigning Pods to Nodes in the Kubernetes documentation.
  6. For each worker node in the original node pool, prevent new pods from starting and delete existing pods by entering kubectl drain <node_name> for each worker node.

    For more information:

    Recommended: Leverage pod disruption budgets as appropriate for your application to ensure that there's a sufficient number of replica pods running throughout the drain operation.

    After all the worker nodes have been drained from the original node pool and pods are running on worker nodes in the new node pool, you can delete the original node pool.

  7. On the Cluster page, display the Node Pools tab and select Delete Node Pool from the Actions menu.

    The original node pool and all its worker nodes are deleted.