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 21, 2024
1 parent 204ef6f commit 512006a
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 3 deletions.
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
16 changes: 16 additions & 0 deletions deploy/dependencies/korrel8r/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: korrel8r-view
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- get
- list
11 changes: 11 additions & 0 deletions deploy/dependencies/korrel8r/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: korrel8r-view
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: korrel8r-view
subjects:
- kind: ServiceAccount
name: korrel8r-sa
4 changes: 4 additions & 0 deletions deploy/dependencies/korrel8r/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: korrel8r-sa
5 changes: 4 additions & 1 deletion 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,6 +37,10 @@ resources:
- admission-webhook/alertmanager-config-validating-webhook.yaml
- admission-webhook/prometheus-rule-validating-webhook.yaml

# Korrel8r Clusterrole Deployment
- korrel8r/clusterrole.yaml
- korrel8r/serviceaccount.yaml
- korrel8r/clusterrolebinding.yaml

namespace: operators
namePrefix: obo-
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/uiplugin/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func newKorrel8rDeployment(name string, namespace string, info UIPluginInfo) *ap
Labels: componentLabels(name),
},
Spec: corev1.PodSpec{
ServiceAccountName: info.Name + serviceAccountSuffix,
ServiceAccountName: "obo-" + name + serviceAccountSuffix,
Containers: []corev1.Container{
{
Name: name,
Expand Down

0 comments on commit 512006a

Please sign in to comment.