133. Rancher 2.12.x 升级失败:检测到 RKE1 NodeTemplate 资源
After upgrading to Rancher v2.12+, therancher-pre-upgradejob fails with the error "Rancher v2.12+ does not support RKE1." The logs from this job indicate that RKE1-related resources, such asNodeTemplate, were detected. This prevents the upgrade from completing successfully.
升级到 Rancher v2.12+ 后,Rancher 预升级作业失败,错误为“Rancher v2.12+ 不支持 RKE1。”该作业的日志显示检测到与 RKE1 相关的资源,如NodeTemplate。这会阻止升级成功完成。
The detected RKE1-related resources(like Node Template) must be either migrated to RKE2/K3s or deleted to resolve the issue.
检测到的 RKE1 相关资源(如 Node Template)必须迁移到 RKE2/K3 或删除以解决该问题。
Step 1: Verify the RKE1-Related Resources
步骤 1:验证 RKE1 相关资源
First, confirm that the rancher-pre-upgrade job is indeed detecting NodeTemplate resources by checking its logs.
首先,通过检查 rancher-pre-upgrade 作业的日志,确认 Rancher-pre-upgrade 作业确实检测到 NodeTemplate 资源。
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code> kubectl logs rancher-pre-upgrade-x4p64 -n cattle-system The log output will confirm the presence of the NodeTemplate, as seen in the example below: ... Found 1 NodeTemplate resource(s): NAMESPACE NAME DISPLAY NAME ---------------- -------- -------------- cattle-global-nt nt-6t9wh nutanix-ubuntu ===== SUMMARY ===== NodeTemplate: 1 Total resources detected: 1 Error: Rancher v2.12+ does not support RKE1. Detected RKE1-related resources (listed above). Please migrate these clusters to RKE2 or K3s, or delete the related resources. More info: <a>Step 2: Delete the NodeTemplate Resource
步骤 2:删除 NodeTemplate 资源
Use kubectl to delete the detected NodeTemplate resource. You will need to use the name of the template from the logs.
使用 kubectl 删除检测到的 NodeTemplate 资源。你需要使用日志中的模板名称。
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code>kubectl delete nodetemplate nt-6t9wh -n cattle-global-nt</code></span></span></span>
Note: The name and namespace of your NodeTemplate may differ from the example. Ensure you use the exact NAME (e.g., nt-6t9wh) and NAMESPACE (cattle-global-nt) from your logs.
注意:你的 NodeTemplate 的名称和命名空间可能与示例不同。确保使用日志中准确的 NAME(例如 nt-6t9wh)和 NAMESPACE(cattle-global-nt)。
Step 3: Re-run the Pre-Upgrade Job by upgrading the Rancher.
第三步:通过升级牧场主重新运行预升级任务。
After deleting the NodeTemplate, re-run the rancher-pre-upgrade job to ensure all RKE1-related resources are gone, and the check now pass
删除 NodeTemplate 后,重新运行 rancher-pre-upgrade 作业,确保所有与 RKE1 相关的资源都消失,检查通过了
<span style="color:#000000"><span style="background-color:#ffffff"><span style="background-color:#efefef"><code># Delete the old failed job first kubectl delete job rancher-pre-upgrade -n cattle-system # Scaledown Rancher deployment pods to zero kubectl -n cattle-system scale deployment rancher --replicas=0 # Re-run the upgrade command # (e.g., your helm upgrade command for Rancher) helm upgrade --install rancher rancher-stable/rancher \ --namespace cattle-system \ --set hostname=<your-hostname> \ # ... other settings # once it's successful, scale up Rancher pods kubectl -n cattle-system scale deployment rancher --replicas=3 </code></span></span></span>
The new rancher-pre-upgrade job will now complete successfully, and the Rancher v2.12+ upgrade can proceedBefore the upgrade, Nutanix drivers are enabled, and a Node Template is created using Nutanix drivers. Rancher v2.12 and later versions have officially ended support for RKE1 clusters. During the upgrade process, a check is performed for any remaining RKE1-related resources, such asNodeTemplateorClusterTemplate, to ensure no legacy RKE1 clusters are being managed. The presence of these resources causes the upgrade to fail.
升级前,启用了 Nutanix 驱动,并用 Nutanix 驱动创建节点模板。Rancher v2.12 及以后版本已正式停止对 RKE1 集群的支持。升级过程中,会检查是否有剩余的 RKE1 相关资源,如NodeTemplate或ClusterTemplate,以确保没有遗留 RKE1 集群被管理。这些资源的存在会导致升级失败。
when upgrading to v2.12.x there must be no RKE1-related objects left - customers are responsible for cleaning them up, and we're providing instructions on how to locate these objects (script is referenced there).
升级到 v2.12.x 时,必须没有任何与 RKE1 相关的对象——客户负责清理这些对象,我们会提供如何定位这些对象的说明 ( 脚本在引用中)。
Rancher v2.11.5, RKE2v1.32
牧场主 v2.11.5, RKE2v1.32
访问Rancher-K8S解决方案博主,企业合作伙伴 :
https://blog.csdn.net/lidw2009
