1
0
Fork 0
mirror of https://gitlab.com/shouptech/flux.git synced 2026-02-03 14:49:44 +00:00

Add prometheus service account

This commit is contained in:
Emma 2020-03-03 19:45:17 -07:00
parent 27983a958d
commit 241b3f73be
No known key found for this signature in database
GPG key ID: 68434BFE85360755

View file

@ -0,0 +1,58 @@
# This file is used to create a prometheus service account
# and role bindings.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: prometheus
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: prometheus
rules:
- apiGroups:
- ""
resources:
- nodes
- nodes/metrics
- services
- endpoints
- pods
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: kube-system
---
apiVersion: v1
kind: Secret
metadata:
name: prometheus-secret
namespace: kube-system
annotations:
kubernetes.io/service-account.name: prometheus
type: kubernetes.io/service-account-token