Updating Worker Nodes by Creating a New Node Pool
You can modify the properties of new worker nodes that start in an existing node pool (see Modifying Node Pool and Worker Node Properties). However, in some situations, you might want to update properties of all the worker nodes in a node pool simultaneously, rather than just the properties of new worker nodes that start in the node pool. For example, to upgrade all worker nodes to a new version of Oracle Linux.
In this case, you can create a new node pool with worker nodes that have the required properties, and shift work from the original node pool to the new node pool. 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 update the properties of all worker nodes in a node pool by creating a new node pool:
- In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Kubernetes Clusters.
- Choose a Compartment you have permission to work in.
- On the Cluster List page, click the name of the cluster where you want to update worker node properties.
On the Cluster page, display the Node Pools tab, and then click Add Node Pool to create a new node pool and specify the required properties for its worker nodes.
- 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 nodescommand to attach the same labels to the new worker nodes in the new node pool. See Assigning Pods to Nodes in the Kubernetes documentation.
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:
- about using kubectl, see Accessing a Cluster Using Kubectl
- about the
draincommand, see drain in the Kubernetes documentation
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.
On the Cluster page, display the Node Pools tab, and then select Delete Node Pool from the Actions menu beside the original node pool.
The original node pool and all its worker nodes are deleted.