github主页:https://github.com/jurycu
目前,cadvsor已经集成到了kubelet中,通过官方的serviceMonitor做服务发现:https://github.com/prometheus-operator/kube-prometheus/blob/main/manifests/kubernetes-serviceMonitorKubelet.yaml
可是,有时候直接apply,之后,报403权限问题,通过排查,是因为prometheus权限的问题,需要创建rbac绑定到cluster-admin
#..> adding following RBAC
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: prometheus-cluster-admin
namespace: monitoring
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: prometheus-k8s
namespace: monitoring