In a rolling upgrade, a new node is created, existing workloads are migrated to the new node, and then the old node is deleted. Figure 1 shows the migration process.
kubectl taint node [node] key=value:[effect]
In the preceding command, [node] indicates the IP address of the node where the workload to be migrated is located. The value of [effect] can be NoSchedule, PreferNoSchedule, or NoExecute. In this example, set this parameter to NoSchedule.
To reset a taint, run the kubectl taint node [node] key:[effect]- command to remove the taint.
In the preceding command, [node] indicates the IP address of the node where the workload to be migrated is located.
During workload migration, if node affinity is configured for the workload, the workload keeps displaying a message indicating that the workload is not ready. In this case, click the workload name to go to the workload details page. On the Scheduling Policies tab page, delete the affinity configuration of the original node and configure the affinity and anti-affinity policies of the new node. For details, see Scheduling Policies (Affinity/Anti-affinity).
After the workload is migrated, you can view that the workload is migrated to the node created in 1 on the Pods tab page of the workload details page.
After the workload is successfully migrated and runs properly, delete the original node.
To reset the taint, delete the configured one.
During workload migration, if node affinity is configured for the workload, the workload keeps displaying a message indicating that the workload is not ready. In this case, click the workload name to go to the workload details page. On the Scheduling Policies tab page, delete the affinity configuration of the original node and configure the affinity and anti-affinity policies of the new node. For details, see Scheduling Policies (Affinity/Anti-affinity).
After the workload is migrated, you can view that the workload is migrated to the node created in 1 on the Pods tab page of the workload details page.
After the workload is successfully migrated and runs properly, delete the original node.