First I would recommend deploying the Rancher Backup Operator (backs up the Rancher stuff in the local cluster as json files then tars them up and sends them off to s3) as we want to make sure we can rollback if the upgrade has problems.
Next we need to plan out the versions. We do this by reviewing the Support Matrix.
Currently you are out of the supported k8s range for Rancher v2.5.12 (v1.17.17 - v1.20.14) so you first need to upgrade Rancher to v2.6.14 (v1.20 - v1.24). Then you can upgrade your EKS cluster from v1.21 → v1.22 → v1.23 → v1.24.
Of course Rancher 2.6 is EOL so we then want you to go to Rancher v2.7.14 (v1.23 - v1.27) followed by upgrading EKS v1.24 → v1.25 → v1.26 → v1.27
Finally we would recommend going to Rancher v2.8.5 then upgrade EKS to v1.28. At that point you are running the latest recommended versions. Also, if you have downstream clusters. You should be upgrading them after upgrading the upstream cluster (local). Of course you should be taking backups before and after each upgrade and allowing some burn-in time between upgrades.
Also, before upgrading your downstream clusters, you should review your applications for compatibility. I personally use GitHub - kubepug/kubepug: Kubernetes PreUpGrade (Checker).