Skip to content

Instantly share code, notes, and snippets.

@prohazko2
Created September 17, 2020 11:47
Show Gist options
  • Save prohazko2/1ce9926c30a786fabb6899c8e63f935e to your computer and use it in GitHub Desktop.
Save prohazko2/1ce9926c30a786fabb6899c8e63f935e to your computer and use it in GitHub Desktop.
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: monitoring
namespace: kube-system
secrets:
- name: monitoring-secret-token
---
apiVersion: v1
kind: Secret
metadata:
name: monitoring-secret-token
namespace: kube-system
annotations:
kubernetes.io/service-account.name: monitoring
type: kubernetes.io/service-account-token
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: monitoring-clusterrole
namespace: kube-system
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- pods
verbs: ["get", "list"]
- nonResourceURLs: ["/metrics", "/metrics/*", "/healthz", "/healthz/*"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: monitoring-clusterrole-binding
namespace: kube-system
roleRef:
kind: ClusterRole
name: monitoring-clusterrole
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: monitoring
namespace: kube-system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment