Skip to content

Commit

Permalink
Add recommened roles for Elastic Agent on Kubernetes (#8188)
Browse files Browse the repository at this point in the history
  • Loading branch information
pebrc authored Nov 22, 2024
1 parent a3e7892 commit 8cbc0ee
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/e2e/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rules:
- list
- delete
- create
- watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
Expand Down Expand Up @@ -184,6 +185,7 @@ rules:
- "batch"
resources:
- jobs
- cronjobs
verbs:
- "get"
- "list"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ rules:
- statefulsets
- deployments
- replicasets
- daemonsets
verbs:
- "get"
- "list"
Expand All @@ -281,10 +282,23 @@ rules:
- nodes/stats
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups:
- "batch"
resources:
- jobs
- cronjobs
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- "get"
- "list"
Expand Down
14 changes: 14 additions & 0 deletions config/recipes/elastic-agent/fleet-kubernetes-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ rules:
- statefulsets
- deployments
- replicasets
- daemonsets
verbs:
- "get"
- "list"
Expand All @@ -211,10 +212,23 @@ rules:
- nodes/stats
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups:
- "batch"
resources:
- jobs
- cronjobs
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- "get"
- "list"
Expand Down
20 changes: 20 additions & 0 deletions config/recipes/elastic-agent/kubernetes-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,33 @@ rules:
- get
- list
- watch
- apiGroups:
- "apps"
resources:
- statefulsets
- deployments
- replicasets
- daemonsets
verbs:
- "get"
- "list"
- "watch"
- apiGroups: ["batch"]
resources:
- jobs
- cronjobs
verbs:
- get
- list
- watch
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- "get"
- "list"
- "watch"
---
apiVersion: v1
kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ tests:
- statefulsets
- deployments
- replicasets
- daemonsets
- equal:
path: rules[4].verbs
value:
Expand All @@ -101,14 +102,15 @@ tests:
value:
- get
- equal:
path: rules[6].apiGroups[0]
path: rules[7].apiGroups[0]
value: batch
- equal:
path: rules[6].resources
path: rules[7].resources
value:
- jobs
- cronjobs
- equal:
path: rules[6].verbs
path: rules[7].verbs
value:
- get
- list
Expand Down
14 changes: 14 additions & 0 deletions deploy/eck-stack/charts/eck-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ clusterRole:
- statefulsets
- deployments
- replicasets
- daemonsets
verbs:
- "get"
- "list"
Expand All @@ -173,11 +174,24 @@ clusterRole:
- nodes/stats
verbs:
- get
- nonResourceURLs:
- "/metrics"
verbs:
- get
- apiGroups:
- "batch"
resources:
- jobs
- cronjobs
verbs:
- "get"
- "list"
- "watch"
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- "get"
- "list"
- "watch"

0 comments on commit 8cbc0ee

Please sign in to comment.