Skip to content

Commit

Permalink
operator: Fixes Ruler RBAC to allow it to send alerts to UWM AM (graf…
Browse files Browse the repository at this point in the history
…ana#11620)

Updated RBAC now match the new updated requirements by UWM Alertmanager introduced on:
openshift/cluster-monitoring-operator#2099
  • Loading branch information
JoaoBraveCoding authored and rhnasc committed Apr 12, 2024
1 parent 1126ad1 commit d988500
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:0.5.0
createdAt: "2023-12-12T09:22:19Z"
createdAt: "2024-01-10T18:25:00Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
features.operators.openshift.io/disconnected: "true"
Expand Down Expand Up @@ -1591,6 +1591,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: docker.io/grafana/loki-operator:0.5.0
createdAt: "2023-12-12T09:22:17Z"
createdAt: "2024-01-10T18:24:59Z"
description: The Community Loki Operator provides Kubernetes native deployment
and management of Loki and related logging components.
operators.operatorframework.io/builder: operator-sdk-unknown
Expand Down Expand Up @@ -1571,6 +1571,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ metadata:
categories: OpenShift Optional, Logging & Tracing
certified: "false"
containerImage: quay.io/openshift-logging/loki-operator:0.1.0
createdAt: "2023-12-12T09:22:21Z"
createdAt: "2024-01-10T18:25:02Z"
description: |
The Loki Operator for OCP provides a means for configuring and managing a Loki stack for cluster logging.
## Prerequisites and Requirements
Expand Down Expand Up @@ -1576,6 +1576,12 @@ spec:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
6 changes: 6 additions & 0 deletions operator/config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ rules:
- alertmanagers
verbs:
- patch
- apiGroups:
- monitoring.coreos.com
resources:
- alertmanagers/api
verbs:
- create
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down
1 change: 1 addition & 0 deletions operator/controllers/loki/lokistack_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type LokiStackReconciler struct {
// +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings;clusterroles;roles;rolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=servicemonitors;prometheusrules,verbs=get;list;watch;create;update;delete
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagers,verbs=patch
// +kubebuilder:rbac:groups=monitoring.coreos.com,resources=alertmanagers/api,verbs=create
// +kubebuilder:rbac:urls=/api/v2/alerts,verbs=create
// +kubebuilder:rbac:groups=coordination.k8s.io,resources=leases,verbs=get;create;update
// +kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=get;list;watch;create;update
Expand Down
11 changes: 11 additions & 0 deletions operator/internal/manifests/openshift/rbac.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ func BuildRulerClusterRole(opts Options) *rbacv1.ClusterRole {
"create",
},
},
{
APIGroups: []string{
"monitoring.coreos.com",
},
Resources: []string{
"alertmanagers/api",
},
Verbs: []string{
"create",
},
},
},
}
}
Expand Down

0 comments on commit d988500

Please sign in to comment.