Skip to content

Commit

Permalink
fix: add Clusterrole to allow Korrel8r to view Logs and Metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Shweta Padubidri <[email protected]>
  • Loading branch information
shwetaap committed Jun 28, 2024
1 parent 351ead5 commit d0c3ff8
Show file tree
Hide file tree
Showing 6 changed files with 326 additions and 4 deletions.
95 changes: 95 additions & 0 deletions bundle/manifests/observability-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,25 @@ spec:
- use
serviceAccountName: obo-prometheus-operator-admission-webhook
- rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- events
- namespaces
- nodes
- persistentvolumeclaims
- persistentvolumes
- pods
- replicationcontrollers
- secrets
- serviceaccounts
- services
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -304,6 +323,17 @@ spec:
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
Expand All @@ -315,6 +345,23 @@ spec:
- patch
- update
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- config.openshift.io
resources:
Expand Down Expand Up @@ -364,6 +411,34 @@ spec:
- infrastructure
verbs:
- get
- apiGroups:
- loki.grafana.com
resources:
- application
- audit
- infrastructure
- network
verbs:
- get
- apiGroups:
- monitoring.coreos.com
resourceNames:
- main
resources:
- alertmanagers/api
verbs:
- get
- list
- apiGroups:
- monitoring.coreos.com
resourceNames:
- k8s
resources:
- prometheuses/api
verbs:
- create
- get
- update
- apiGroups:
- monitoring.rhobs
resources:
Expand Down Expand Up @@ -438,6 +513,15 @@ spec:
- get
- patch
- update
- apiGroups:
- networking.k8s.io
resources:
- ingresses
- networkpolicies
verbs:
- get
- list
- watch
- apiGroups:
- observability.openshift.io
resources:
Expand Down Expand Up @@ -481,6 +565,7 @@ spec:
verbs:
- create
- delete
- get
- list
- patch
- update
Expand All @@ -495,6 +580,7 @@ spec:
verbs:
- create
- delete
- get
- list
- patch
- update
Expand All @@ -520,6 +606,15 @@ spec:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- tempo.grafana.com
resources:
Expand Down
2 changes: 1 addition & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var defaultImages = map[string]string{
"ui-troubleshooting-panel": "quay.io/openshift-observability-ui/troubleshooting-panel-console-plugin:v0.1.0",
"ui-distributed-tracing": "quay.io/openshift-observability-ui/distributed-tracing-console-plugin:v0.1.0",
"ui-logging": "quay.io/openshift-logging/logging-view-plugin:6.0.0",
"korrel8r": "quay.io/korrel8r/korrel8r:0.6.5",
"korrel8r": "quay.io/korrel8r/korrel8r:0.6.6",
}

func imagesUsed() []string {
Expand Down
2 changes: 0 additions & 2 deletions deploy/dependencies/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ resources:
- https://raw.githubusercontent.com/rhobs/obo-prometheus-operator/v0.74.0-rhobs1/example/rbac/prometheus-operator/prometheus-operator-service.yaml



# Admission Webhook Deployment
- https://raw.githubusercontent.com/rhobs/obo-prometheus-operator/v0.74.0-rhobs1/example/admission-webhook/deployment.yaml
- https://raw.githubusercontent.com/rhobs/obo-prometheus-operator/v0.74.0-rhobs1/example/admission-webhook/service-account.yaml
Expand All @@ -38,7 +37,6 @@ resources:
- admission-webhook/alertmanager-config-validating-webhook.yaml
- admission-webhook/prometheus-rule-validating-webhook.yaml


namespace: operators
namePrefix: obo-
commonLabels:
Expand Down
95 changes: 95 additions & 0 deletions deploy/operator/observability-operator-cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ kind: ClusterRole
metadata:
name: observability-operator
rules:
- apiGroups:
- ""
resources:
- configmaps
- endpoints
- events
- namespaces
- nodes
- persistentvolumeclaims
- persistentvolumes
- pods
- replicationcontrollers
- secrets
- serviceaccounts
- services
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
Expand Down Expand Up @@ -41,6 +60,17 @@ rules:
- patch
- update
- watch
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
- statefulsets
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
Expand All @@ -52,6 +82,23 @@ rules:
- patch
- update
- watch
- apiGroups:
- autoscaling
resources:
- horizontalpodautoscalers
verbs:
- get
- list
- watch
- apiGroups:
- batch
resources:
- cronjobs
- jobs
verbs:
- get
- list
- watch
- apiGroups:
- config.openshift.io
resources:
Expand Down Expand Up @@ -101,6 +148,34 @@ rules:
- infrastructure
verbs:
- get
- apiGroups:
- loki.grafana.com
resources:
- application
- audit
- infrastructure
- network
verbs:
- get
- apiGroups:
- monitoring.coreos.com
resourceNames:
- main
resources:
- alertmanagers/api
verbs:
- get
- list
- apiGroups:
- monitoring.coreos.com
resourceNames:
- k8s
resources:
- prometheuses/api
verbs:
- create
- get
- update
- apiGroups:
- monitoring.rhobs
resources:
Expand Down Expand Up @@ -175,6 +250,15 @@ rules:
- get
- patch
- update
- apiGroups:
- networking.k8s.io
resources:
- ingresses
- networkpolicies
verbs:
- get
- list
- watch
- apiGroups:
- observability.openshift.io
resources:
Expand Down Expand Up @@ -218,6 +302,7 @@ rules:
verbs:
- create
- delete
- get
- list
- patch
- update
Expand All @@ -232,6 +317,7 @@ rules:
verbs:
- create
- delete
- get
- list
- patch
- update
Expand All @@ -257,6 +343,15 @@ rules:
- securitycontextconstraints
verbs:
- use
- apiGroups:
- storage.k8s.io
resources:
- storageclasses
- volumeattachments
verbs:
- get
- list
- watch
- apiGroups:
- tempo.grafana.com
resources:
Expand Down
14 changes: 14 additions & 0 deletions pkg/controllers/uiplugin/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ const (
// RBAC for logging view plugin
// +kubebuilder:rbac:groups=loki.grafana.com,resources=application;infrastructure;audit,verbs=get

// RBAC for korrel8r
//+kubebuilder:rbac:groups=apps,resources=daemonsets;deployments;replicasets;statefulsets,verbs=get;list;watch
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=roles;rolebindings;clusterroles;clusterrolebindings,verbs=get;list;watch
//+kubebuilder:rbac:groups="",resources=configmaps;endpoints;events;namespaces;nodes;persistentvolumeclaims;persistentvolumes;pods;replicationcontrollers;secrets;serviceaccounts;services,verbs=get;list;watch
//+kubebuilder:rbac:groups=batch,resources=cronjobs;jobs,verbs=get;list;watch
//+kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=get;list;watch
//+kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=get;list;watch
//+kubebuilder:rbac:groups=storage.k8s.io,resources=storageclasses;volumeattachments,verbs=get;list;watch
//+kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies;ingresses,verbs=get;list;watch
//+kubebuilder:rbac:groups=loki.grafana.com,resources=application;infrastructure;audit;network,verbs=get
//+kubebuilder:rbac:groups=monitoring.coreos.com,resources=prometheuses/api,resourceNames=k8s,verbs=get;create;update
//+kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagers/api,resourceNames=main,verbs=get;list

// RegisterWithManager registers the controller with Manager
func RegisterWithManager(mgr ctrl.Manager, opts Options) error {
logger := ctrl.Log.WithName("observability-ui")

Expand Down
Loading

0 comments on commit d0c3ff8

Please sign in to comment.