Skip to content

feat: add perses rbac support #777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ generate-prom-operator-crds: $(CONTROLLER_GEN)
.PHONY: generate-perses-op-crds
generate-perses-op-crds: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) crd \
paths=github.com/perses/perses-operator/api/... \
paths=github.com/rhobs/perses-operator/api/... \
output:dir=. \
output:crd:dir=./deploy/perses/crds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ metadata:
categories: Monitoring
certified: "false"
containerImage: observability-operator:1.2.0
createdAt: "2025-06-24T10:23:06Z"
createdAt: "2025-06-24T11:30:26Z"
description: A Go based Kubernetes operator to setup and manage highly available
Monitoring Stack using Prometheus, Alertmanager and Thanos Querier.
operatorframework.io/cluster-monitoring: "true"
Expand Down Expand Up @@ -929,7 +929,7 @@ spec:
- --images=alertmanager=quay.io/prometheus/alertmanager:v0.26.0
- --images=prometheus=quay.io/prometheus/prometheus:v2.49.1
- --images=thanos=quay.io/thanos/thanos:v0.33.0
- --images=perses=quay.io/persesdev/perses:v0.50.3
- --images=perses=quay.io/openshift-observability-ui/perses:v0.51.1-go-1.23
env:
- name: NAMESPACE
valueFrom:
Expand Down Expand Up @@ -1006,7 +1006,7 @@ spec:
operator: Exists
weight: 1
containers:
- image: quay.io/persesdev/perses-operator:v0.1.12
- image: quay.io/openshift-observability-ui/perses-operator:v0.2-go-1.23
livenessProbe:
httpGet:
path: /healthz
Expand Down
798 changes: 557 additions & 241 deletions bundle/manifests/perses.dev_perses.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions bundle/manifests/perses.dev_persesdashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
kind: PersesDashboard
listKind: PersesDashboardList
plural: persesdashboards
shortNames:
- perdb
singular: persesdashboard
scope: Namespaced
versions:
Expand Down
108 changes: 104 additions & 4 deletions bundle/manifests/perses.dev_persesdatasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ spec:
kind: PersesDatasource
listKind: PersesDatasourceList
plural: persesdatasources
shortNames:
- perds
singular: persesdatasource
scope: Namespaced
versions:
Expand Down Expand Up @@ -41,6 +43,96 @@ spec:
properties:
client:
properties:
basicAuth:
description: BasicAuth basic auth config for perses client
properties:
name:
description: Name of basic auth k8s resource (when type is
secret or configmap)
type: string
namespace:
description: Namsespace of certificate k8s resource (when
type is secret or configmap)
type: string
password_path:
description: Path to password
type: string
type:
description: Type source type of secret
enum:
- secret
- configmap
- file
type: string
username:
description: Username for basic auth
type: string
required:
- password_path
- type
- username
type: object
kubernetesAuth:
description: KubernetesAuth configuration for perses client
properties:
enable:
description: Enable kubernetes auth for perses client
type: boolean
required:
- enable
type: object
oauth:
description: OAuth configuration for perses client
properties:
authStyle:
description: |-
AuthStyle optionally specifies how the endpoint wants the
client ID & client secret sent. The zero value means to
auto-detect.
type: integer
clientIDPath:
description: Path to client id
type: string
clientSecretPath:
description: Path to client secret
type: string
endpointParams:
additionalProperties:
items:
type: string
type: array
description: EndpointParams specifies additional parameters
for requests to the token endpoint.
type: object
name:
description: Name of basic auth k8s resource (when type is
secret or configmap)
type: string
namespace:
description: Namsespace of certificate k8s resource (when
type is secret or configmap)
type: string
scopes:
description: Scope specifies optional requested permissions.
items:
type: string
type: array
tokenURL:
description: |-
TokenURL is the resource server's token endpoint
URL. This is a constant specific to each server.
type: string
type:
description: Type source type of secret
enum:
- secret
- configmap
- file
type: string
required:
- tokenURL
- type
type: object
tls:
description: TLS the equivalent to the tls_config for perses client
properties:
Expand All @@ -51,14 +143,18 @@ spec:
description: Path to Certificate
type: string
name:
description: Name of certificate k8s resource (when type
description: Name of basic auth k8s resource (when type
is secret or configmap)
type: string
namespace:
description: Namsespace of certificate k8s resource (when
type is secret or configmap)
type: string
privateKeyPath:
description: Path to Private key certificate
type: string
type:
description: Type source type of certificate
description: Type source type of secret
enum:
- secret
- configmap
Expand All @@ -81,14 +177,18 @@ spec:
description: Path to Certificate
type: string
name:
description: Name of certificate k8s resource (when type
description: Name of basic auth k8s resource (when type
is secret or configmap)
type: string
namespace:
description: Namsespace of certificate k8s resource (when
type is secret or configmap)
type: string
privateKeyPath:
description: Path to Private key certificate
type: string
type:
description: Type source type of certificate
description: Type source type of secret
enum:
- secret
- configmap
Expand Down
5 changes: 5 additions & 0 deletions bundle/manifests/perses_v1_serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ServiceAccount
metadata:
creationTimestamp: null
name: perses
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: perses-operator
app.kubernetes.io/instance: persesdashboard-editor-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: perses-operator
name: persesdashboard-editor-role
rules:
- apiGroups:
- perses.dev
resources:
- persesdashboards
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- perses.dev
resources:
- persesdashboards/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: perses-operator
app.kubernetes.io/instance: persesdashboard-viewer-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: perses-operator
name: persesdashboard-viewer-role
rules:
- apiGroups:
- perses.dev
resources:
- persesdashboards
verbs:
- get
- list
- watch
- apiGroups:
- perses.dev
resources:
- persesdashboards/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: perses-operator
app.kubernetes.io/instance: persesdatasource-editor-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: perses-operator
name: persesdatasource-editor-role
rules:
- apiGroups:
- perses.dev
resources:
- persesdatasources
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- perses.dev
resources:
- persesdatasources/status
verbs:
- get
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: perses-operator
app.kubernetes.io/instance: persesdatasource-viewer-role
app.kubernetes.io/name: clusterrole
app.kubernetes.io/part-of: perses-operator
name: persesdatasource-viewer-role
rules:
- apiGroups:
- perses.dev
resources:
- persesdatasources
verbs:
- get
- list
- watch
- apiGroups:
- perses.dev
resources:
- persesdatasources/status
verbs:
- get
2 changes: 1 addition & 1 deletion cmd/operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var defaultImages = map[string]string{
"health-analyzer": "quay.io/openshiftanalytics/cluster-health-analyzer:v0.5.0",
"ui-monitoring-pf5": "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.4.2",
"ui-monitoring": "quay.io/openshift-observability-ui/monitoring-console-plugin:v0.5.1",
"perses": "quay.io/openshift-observability-ui/perses:v0.51.1",
"perses": "quay.io/openshift-observability-ui/perses:v0.51.1-go-1.23",
}

func imagesUsed() []string {
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ patches:
- patch: |-
- op: add
path: /spec/template/spec/containers/0/args/-
value: --images=perses=quay.io/persesdev/perses:v0.50.3
value: --images=perses=quay.io/openshift-observability-ui/perses:v0.51.1-go-1.23
target:
group: apps
kind: Deployment
Expand Down
Loading
Loading