Skip to content

1. Prometheus-Operator监控kube-controller-manager失败

问题描述

k8s版本1.25.3,kube-controller-manager使用https监听端口10257。监控Target页面显示DOWN,错误提示server returned HTTP status 403 Forbidden,点击metrics url 提示:

解决方法:

在 kube-controller-manager 的启动参数增加下面两个参数

bash
--authentication-kubeconfig=/etc/kubernetes/controller-manager.kubeconfig
--authorization-kubeconfig=/etc/kubernetes/controller-manager.kubeconfig
--authentication-kubeconfig=/etc/kubernetes/controller-manager.kubeconfig
--authorization-kubeconfig=/etc/kubernetes/controller-manager.kubeconfig

由于是kubeadm 部署,所以会自动重启服务

  • 二进制方式
systemctl daemon-reload
systemctl restart kube-controller-manager.service
systemctl daemon-reload
systemctl restart kube-controller-manager.service