Oracle Cloud Infrastructure Documentation

'Upgrading' the Image Running on Worker Nodes by Creating a New Node Pool

When a node pool is created, the image to use for worker nodes in the node pool is specified. An image is a template of a virtual hard drive that determines the operating system and other software running on the worker nodes.

To 'upgrade' the image running on worker nodes in a node pool (for example, to upgrade to a new version of Oracle Linux), you replace the original node pool with a new node pool that has new worker nodes running the appropriate image. 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 image on worker nodes by creating a new node pool:

  1. In the Console, open the navigation menu. Under Solutions and Platform, 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 image running on worker nodes.
  4. On the Cluster page, click Add Node Pool to create a new node pool and specify the required image for its worker 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.