enable k8s scraping by annotation servicemonitors are too hard
This commit is contained in:
parent
fd41ce8cc2
commit
9088fad25e
3 changed files with 25 additions and 0 deletions
6
k8s/operators/kube-prometheus/cluster-role-patch.yaml
Normal file
6
k8s/operators/kube-prometheus/cluster-role-patch.yaml
Normal file
|
@ -0,0 +1,6 @@
|
|||
- op: add
|
||||
path: /rules/-
|
||||
value:
|
||||
apiGroups: [""]
|
||||
resources: [pods]
|
||||
verbs: [list, get, watch]
|
|
@ -24,3 +24,13 @@ patches:
|
|||
target:
|
||||
kind: NetworkPolicy
|
||||
name: alertmanager-main
|
||||
|
||||
- path: prometheus-patch.yaml
|
||||
target:
|
||||
kind: Prometheus
|
||||
name: k8s
|
||||
|
||||
- path: cluster-role-patch.yaml
|
||||
target:
|
||||
kind: ClusterRole
|
||||
name: prometheus-k8s
|
||||
|
|
9
k8s/operators/kube-prometheus/prometheus-patch.yaml
Normal file
9
k8s/operators/kube-prometheus/prometheus-patch.yaml
Normal file
|
@ -0,0 +1,9 @@
|
|||
- op: add
|
||||
path: /spec/additionalScrapeConfigs
|
||||
value:
|
||||
key: scrape-configs.yaml
|
||||
name: additional-scrape-configs
|
||||
optional: true
|
||||
- op: add
|
||||
path: /spec/secrets
|
||||
value: [scrape-secrets]
|
Loading…
Reference in a new issue