- 已编辑
kube-controller-manager kube-schedule 日志没有问题,但不能显示数据
kube-controller-manager kube-schedule 日志没有问题,但不能显示数据
看看prometheus所使用的service account(prometheus-k8s)是否正确,该sa绑定的clusterRole(kubesphere-prometheus-k8s)所设置的权限是否正确,是否包含"/metrics"权限
kevendeng 不知道在这里了,是否包含"/metrics"权限
kubectl describe sa prometheus-k8s -n kubesphere-monitoring-system
Name: prometheus-k8s
Namespace: kubesphere-monitoring-system
Labels: <none>
Annotations: Image pull secrets: <none>
Mountable secrets: prometheus-k8s-token-gkxkl
Tokens: prometheus-k8s-token-gkxkl
Events: <none>
kubectl describe clusterrolebinding kubesphere-prometheus-k8s
Name: kubesphere-prometheus-k8s
Labels: <none>
Annotations: Role:
Kind: ClusterRole
Name: kubesphere-prometheus-k8s
Subjects:
Kind Name Namespace
ServiceAccount prometheus-k8s kubesphere-monitoring-system
kubectl get clusterrole kubesphere-prometheus-k8s -n kubesphere-monitoring-system -o yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{“apiVersion”:“rbac.authorization.k8s.io/v1”,“kind”:“ClusterRole”,“metadata”:{“annotations”:{},“name”:“kubesphere-prometheus-k8s”},“rules”:[{“apiGroups”:[""],“resources”:[“nodes/metrics”,“nodes”,“services”,“endpoints”,“pods”],“verbs”:[“get”,“list”,“watch”]},{“nonResourceURLs”:[“/metrics”],“verbs”:[“get”]}]}
creationTimestamp: “2021-07-06T08:23:44Z”
managedFields: