⇢ kube-prometheus-stack 내의 ClusterRole (정확히 말하자면 templates 내의 clusterrole) 을 사용하면 바로 401 과 403 에러가 발생되었습니다.
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: prometheus
labels:
k8s-app: prometheus
rules:
- apiGroups: [""] # "" indicates the core API group
resources:
- namespaces
- endpoints
- services
- nodes
- pods
verbs:
- get
- watch
- list
- nonResourceURLs:
- /metrics
- /api/*
verbs:
- get
resources 에서 nodes/proxy 를 추가하라.
rules:
- apiGroups: [""]
resources:
- namespaces
- endpoints
- services
- nodes
- nodes/proxy <===
- pods
많은 부분이 Success 로 확인되었으나 k8s-prometheus-stack-kube-kubelet 에서 403 이 발생되었습니다.
resources 에서 nodes/metrics 추가
rules:
- apiGroups: [""]
resources:
- namespaces
- endpoints
- services
- nodes
- nodes/proxy <=== 추가 1
- nodes/metrics <=== 추가 2
- pods
위를 적용 후 재배포 또는 재시작하면, 프로메테우스에서 징그러운 빨간색 에러는 사라짐!!
왜 상용 Monitoring/Obserability System을 사용하는지 알겠음!!! 으흑