From 241b3f73bed150241f26c3810a131e0cd9a43772 Mon Sep 17 00:00:00 2001 From: Mike Shoup Date: Tue, 3 Mar 2020 19:45:17 -0700 Subject: [PATCH] Add prometheus service account --- workloads/kube-system/prometheus-sa.yml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 workloads/kube-system/prometheus-sa.yml diff --git a/workloads/kube-system/prometheus-sa.yml b/workloads/kube-system/prometheus-sa.yml new file mode 100644 index 0000000..5d6283c --- /dev/null +++ b/workloads/kube-system/prometheus-sa.yml @@ -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