Created
October 4, 2018 15:35
-
-
Save agirlnamedsophia/6abe9b8ae7982dd5eaa6f5305c8fcddb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: datadog-agent | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- services | |
- events | |
- endpoints | |
- pods | |
- nodes | |
- componentstatuses | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- "" | |
resources: | |
- configmaps | |
resourceNames: | |
- datadogtoken # Kubernetes event collection state | |
- datadog-leader-election # Leader election token | |
verbs: | |
- get | |
- update | |
- apiGroups: # To create the leader election token | |
- "" | |
resources: | |
- configmaps | |
verbs: | |
- create | |
- nonResourceURLs: | |
- "/version" | |
- "/healthz" | |
verbs: | |
- get | |
- apiGroups: # Kubelet connectivity | |
- "" | |
resources: | |
- nodes/metrics | |
- nodes/spec | |
- nodes/proxy | |
verbs: | |
- get | |
--- | |
# You need to use that account for your dd-agent DaemonSet | |
kind: ServiceAccount | |
apiVersion: v1 | |
metadata: | |
name: datadog-agent | |
namespace: default | |
--- | |
# Your admin user needs the same permissions to be able to grant them | |
# Easiest way is to bind your user to the cluster-admin role | |
# See https://cloud.google.com/container-engine/docs/role-based-access-control#setting_up_role-based_access_control | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: datadog-agent | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: datadog-agent | |
subjects: | |
- kind: ServiceAccount | |
name: datadog-agent | |
namespace: default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment