98. 未使用的机器配置(rke-machine-config.cattle.io)在 Rancher v2.10+ 中会自动清理
Environment 环境SUSE Rancher Prime v2.10.x till v2.11.xSUSE Rancher Prime v2.10.x 到 v2.11.xRKE2VMware vSphereAWS EC2Situation 地理位置After upgrading to Rancher v2.10, VmwarevsphereConfigs created via Terraform (rancher2_machine_config_v2) are automatically deleted after one day if they are not associated with any downstream cluster. This occurs when a machine config is not bound in the Terraform code. There is no alert or notification prior to deletion.升级到 Rancher v2.10 后通过 Terraform rancher2_machine_config_v2 创建的 VmwarevsphereConfig 如果没有关联到任何下游集群通常一天后会自动删除。当机器配置未被绑定在 Terraform 代码中时就会发生这种情况。删除前没有任何警报或通知。A similar scenario occurs when a Machine Pool is configured through the UI but left without nodes for an extended period. In such cases, Rancher automatically deletes some underlying resources (e.g., vmwarevsphereconfig, amazonec2configs). This causes the pool to become uneditable in the UI and blocks the creation of new pools.类似的情况是当机器池通过界面配置但长时间没有节点时。在这种情况下Rancher 会自动删除一些底层资源例如 vmwarevsphereconfig、amazonec2configs。这会导致该池在界面中变得无法编辑并阻止新池的创建。Resolution 结局The deletion of unbound machine configs is an expected behavior in Rancher v2.10. A cronjob, which runs every 24 hours, deletes machine configs that have no owner references and are older than 1 hour.在 Rancher v2.10 中删除未绑定的机器配置是正常行为。cronjob 每 24 小时运行一次会删除没有所有者引用且超过 1 小时的机器配置。The cronjob responsible for cleaning up unused machine configs is:负责清理未使用机器配置的 cronjob 是span stylecolor:#000000span stylebackground-color:#ffffffspan stylebackground-color:#efefefcodekubectl get cronjob -n fleet-default NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE rke2-machineconfig-cleanup-cronjob 5 0 * * * False 0 5h53m 67d/code/span/span/spanHowever, it will become a problem when an existing pool is scaled down to zero, as it prevents updates to the pool or the creation of new machine pools.然而当现有的池被缩减到零时这会成为问题因为这会阻止对池的更新或新的机器池的创建。Staring Rancher v2.12.1 this behavior has been changed. Machine configs inrke-machine-config.cattle.ioare added back withownerReferenceswhen the cluster is edited to modify the node pool.Staring Rancher v2.12.1 这种行为已经改变。rke-machine-config.cattle.io中的机器配置会在编辑集群修改节点池时用ownerReferences重新添加。As a workaround in older versions, this issue can be mitigated by suspending the cleanup cronjob.在旧版本中这个问题可以通过暂停清理程序来缓解。The suspension will remain effective until Rancher is restarted and can be applied via:暂停将持续有效直到 Rancher 重新启动并可通过以下方式实施Rancher → Explore Local cluster → More Resources → Batch → Cronjobs → Select fleet-default namespace → SuspendRancher → 探索“本地”集群 →更多资源 →批量 → Cronjobs → 选择“fleet-default”命名空间→暂停Caution:Suspending the cronjob may leave orphaned configurations in the cluster for an extended period.注意暂停 cronjob 可能会在集群中留下孤儿配置较长时间。Cause 病因The automatic deletion of orphaned machine configs was introduced in Rancher v2.10 as a resource optimization measure. A cronjob was deployed to clean up machine configs that lack owner references and are older than one hour.自动删除孤立机器配置的功能是在 Rancher v2.10 中引入的作为资源优化措施。部署了一个 cronjob 来清理那些没有所有者引用且超过一小时的机器配置。访问Rancher-K8S解决方案博主企业合作伙伴 https://blog.csdn.net/lidw2009
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2472120.html
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!