set up authorization for blackbox-exporter

This commit is contained in:
PÁLFALVI Tamás
2020-12-26 13:14:40 +01:00
parent 66aca04688
commit dcd99f7d68
5 changed files with 72 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: blackbox-exporter
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create

View File

@@ -0,0 +1,12 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: blackbox-exporter
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: blackbox-exporter
subjects:
- kind: ServiceAccount
name: blackbox-exporter
namespace: monitoring

View File

@@ -8,7 +8,8 @@ metadata:
namespace: monitoring
spec:
endpoints:
- interval: 30s
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
interval: 30s
path: /metrics
port: http
scheme: https