You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Rancher在VMware vSphere创建Kubernetes集群失败求助

Rancher Webhook 无可用端点问题的解决方法

这个错误是因为rancher-webhook服务没有可用的后端端点,通常是webhook的Pod未正常启动导致的,以下是具体解决步骤:

1. 检查Webhook组件状态

  • 查看cattle-system命名空间下的Pod状态,确认rancher-webhook Pod的运行状态:
    kubectl get pods -n cattle-system
    
    如果Pod处于CrashLoopBackOff、Error或Pending状态,说明Pod启动异常。
  • 查看rancher-webhook服务对应的端点,确认是否有后端Pod关联:
    kubectl get endpoints rancher-webhook -n cattle-system
    
    若输出的ENDPOINTS列为空,说明没有可用的Pod提供服务。

2. 排查并修复Pod启动异常

资源不足导致OOM

  • 查看Pod的事件日志,确认是否存在内存/CPU耗尽的情况:
    kubectl describe pod <rancher-webhook-pod-name> -n cattle-system
    
    如果Events中出现OOMKilled记录,需要调整Webhook的资源请求和限制:
    kubectl edit deployment rancher-webhook -n cattle-system
    
    在spec.template.spec.containers.resources中增加requests和limits的CPU/内存配置。

证书配置错误

  • 查看Pod日志,检查是否有证书相关报错:
    kubectl logs <rancher-webhook-pod-name> -n cattle-system
    
    若存在证书无效、过期的信息,可删除现有证书并重启Webhook,Rancher会自动重新生成证书:
    kubectl delete secret rancher-webhook-certs -n cattle-system
    kubectl rollout restart deployment rancher-webhook -n cattle-system
    

网络策略限制

如果集群中配置了网络策略,确认是否限制了cattle-system命名空间的入站流量,临时禁用相关网络策略测试是否恢复正常。

3. 临时绕过Webhook(紧急场景)

若需紧急创建集群,可临时删除该Webhook配置(注意:此操作会关闭Secret的 mutation 功能,存在安全风险,问题解决后需恢复):

kubectl delete mutatingwebhookconfiguration rancher.cattle.io.secrets

4. 重新部署Webhook组件

如果以上方法无效,尝试重新部署Webhook:

  • 删除现有Deployment:
    kubectl delete deployment rancher-webhook -n cattle-system
    
  • 重启Rancher容器(Docker安装场景),触发Rancher重新创建Webhook组件:
    docker restart <rancher-container-id>
    

内容的提问来源于stack exchange,提问作者Jack

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 17:05:03