Skip to content

Commit

Permalink
make small adjustments to clusterrole
Browse files Browse the repository at this point in the history
  • Loading branch information
celenechang committed Jan 10, 2025
1 parent db00883 commit c2ffbd6
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 31 deletions.
33 changes: 16 additions & 17 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ rules:
resources:
- componentstatuses
- deployments
- limitranges
- namespaces
- persistentvolumeclaims
- persistentvolumes
- replicationcontrollers
- resourcequotas
verbs:
- get
- list
Expand All @@ -37,17 +42,6 @@ rules:
- patch
- update
- watch
- apiGroups:
- ""
resources:
- limitranges
- persistentvolumeclaims
- persistentvolumes
- replicationcontrollers
- resourcequotas
verbs:
- list
- watch
- apiGroups:
- ""
resources:
Expand All @@ -66,6 +60,12 @@ rules:
- nodes/stats
verbs:
- get
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- '*'
resources:
Expand Down Expand Up @@ -142,12 +142,8 @@ rules:
verbs:
- create
- get
- apiGroups:
- authorization.k8s.io
resources:
- pods/exec
verbs:
- create
- list
- watch
- apiGroups:
- authorization.k8s.io
resources:
Expand Down Expand Up @@ -200,6 +196,7 @@ rules:
resources:
- certificatesigningrequests
verbs:
- get
- list
- watch
- apiGroups:
Expand Down Expand Up @@ -273,6 +270,7 @@ rules:
verbs:
- create
- delete
- get
- list
- watch
- apiGroups:
Expand Down Expand Up @@ -356,5 +354,6 @@ rules:
- storageclasses
- volumeattachments
verbs:
- get
- list
- watch
28 changes: 14 additions & 14 deletions internal/controller/datadogagent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,24 @@ type DatadogAgentReconciler struct {
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=roles,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=rolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=pods/exec,verbs=create
// +kubebuilder:rbac:groups="",resources=pods/exec,verbs=create

// Configure Admission Controller
// +kubebuilder:rbac:groups=admissionregistration.k8s.io,resources=validatingwebhookconfigurations;mutatingwebhookconfigurations,verbs=*
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get
// +kubebuilder:rbac:groups=apps,resources=replicasets,verbs=get
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get
// +kubebuilder:rbac:groups=authentication.k8s.io,resources=tokenreviews,verbs=create;get
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=create;get
// +kubebuilder:rbac:groups=authentication.k8s.io,resources=tokenreviews,verbs=get;create;list;watch
// +kubebuilder:rbac:groups=authorization.k8s.io,resources=subjectaccessreviews,verbs=get;create
// +kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=get
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get

// Configure External Metrics server
// +kubebuilder:rbac:groups=apiregistration.k8s.io,resources=apiservices,verbs=*
// +kubebuilder:rbac:groups=datadoghq.com,resources=watermarkpodautoscalers,verbs=get;list;watch
// +kubebuilder:rbac:groups=external.metrics.k8s.io,resources=*,verbs=get;list;watch
// +kubebuilder:rbac:groups=datadoghq.com,resources=datadogmetrics,verbs=list;watch;create;delete
// +kubebuilder:rbac:groups=datadoghq.com,resources=datadogmetrics,verbs=get;list;watch;create;delete
// +kubebuilder:rbac:groups=datadoghq.com,resources=datadogmetrics/status,verbs=update

// Configure Autoscaling product
Expand Down Expand Up @@ -129,15 +129,15 @@ type DatadogAgentReconciler struct {
// +kubebuilder:rbac:groups="",resources=nodes,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=deployments,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=limitranges,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=limitranges,verbs=get;list;watch
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch
// +kubebuilder:rbac:groups=apps,resources=replicasets,verbs=get;list;watch
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=get;list;watch
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=get;list;watch
// +kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumes,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumes,verbs=get;list;watch
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles,verbs=list;watch
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=rolebindings,verbs=list;watch
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=list;watch
Expand All @@ -149,28 +149,28 @@ type DatadogAgentReconciler struct {
// Kubernetes_state_core
// +kubebuilder:rbac:groups="",resources=configmaps,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=endpoints,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=limitranges,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=limitranges,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=nodes,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumes,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumeclaims,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=persistentvolumes,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=pods,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=resourcequotas,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=resourcequotas,verbs=get;list;watch
// +kubebuilder:rbac:groups="",resources=secrets,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=services,verbs=list;watch
// +kubebuilder:rbac:groups=apps,resources=daemonsets,verbs=list;watch
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=list;watch
// +kubebuilder:rbac:groups=apps,resources=replicasets,verbs=list;watch
// +kubebuilder:rbac:groups=apps,resources=replicationcontrollers,verbs=list;watch
// +kubebuilder:rbac:groups=apps;extensions,resources=daemonsets;deployments;replicasets,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=replicationcontrollers,verbs=list;watch
// +kubebuilder:rbac:groups="",resources=replicationcontrollers,verbs=get;list;watch
// +kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=list;watch
// +kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=list;watch
// +kubebuilder:rbac:groups=batch,resources=cronjobs,verbs=list;watch
// +kubebuilder:rbac:groups=batch,resources=jobs,verbs=list;watch
// +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests,verbs=list;watch
// +kubebuilder:rbac:groups=certificates.k8s.io,resources=certificatesigningrequests,verbs=get;list;watch
// +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=list;watch
// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses;volumeattachments,verbs=list;watch
// +kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses;volumeattachments,verbs=get;list;watch
// +kubebuilder:rbac:groups=autoscaling.k8s.io,resources=verticalpodautoscalers,verbs=list;watch
// +kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=list;watch
// +kubebuilder:rbac:groups=extensions,resources=customresourcedefinitions,verbs=list;watch
Expand Down

0 comments on commit c2ffbd6

Please sign in to comment.