Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
First, upgrade Kubernetes to version 1.27.x while continuing to use the existing node pool with Ubuntu 18.04. This will update the control plane to the new version, allowing you to confirm that everything is functioning correctly.
Create a new node pool with Ubuntu 22.04. This will allow you to create a new node pool without affecting the existing one. Once the new node pool is created, migrate all workloads. Drain and cordon the old node pool running Ubuntu 18.04 to prevent new pods from being scheduled on it.
Once the upgrade is complete, you can delete the old node pool running Ubuntu 18.04.
Therefore, it is a safe way to create a new cluster first and then deploy existing workloads to the new cluster and see if they are working properly.
If you have any further queries, do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it."