Skip to content

Commit e147977

Browse files
committed
Add support for query RBAC to tempomonolithic
Signed-off-by: Pavol Loffay <[email protected]>
1 parent c8ae0b5 commit e147977

21 files changed

+506
-12
lines changed

.chloggen/rbac-monolithic.yaml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enahancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. tempostack, tempomonolithic, github action)
5+
component: tempomonolithic
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Add support for query RBAC
9+
10+
# One or more tracking issues related to the change
11+
issues: []
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext: |
17+
This feature allows users to apply query RBAC in the multitenancy mode.
18+
The RBAC allows filtering span/resource/scope attributes and events based on the namespaces which a user querying the data can access.
19+
For instance, a user can only see attributes from namespaces it can access.
20+
21+
```yaml
22+
spec:
23+
query:
24+
rbac:
25+
enabled: true
26+
```

api/tempo/v1alpha1/tempomonolithic_types.go

+17
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,26 @@ type TempoMonolithicSpec struct {
6868
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Extra Configuration",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
6969
ExtraConfig *ExtraConfigSpec `json:"extraConfig,omitempty"`
7070

71+
// Query defines query configuration.
72+
//
73+
// +kubebuilder:validation:Optional
74+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query Configuration",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
75+
Query MonolithicQuerySpec `json:"query,omitempty"`
76+
7177
MonolithicSchedulerSpec `json:",inline"`
7278
}
7379

80+
// MonolithicQuerySpec defines the query configuration.
81+
type MonolithicQuerySpec struct {
82+
// RBAC defines query RBAC options.
83+
// This option can be used only with multi-tenancy.
84+
//
85+
// +optional
86+
// +kubebuilder:validation:Optional
87+
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query RBAC Settings"
88+
RBAC RBACSpec `json:"rbac,omitempty"`
89+
}
90+
7491
// MonolithicStorageSpec defines the storage for the Tempo deployment.
7592
type MonolithicStorageSpec struct {
7693
// Traces defines the storage configuration for traces.

api/tempo/v1alpha1/tempostack_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ type TempoGatewaySpec struct {
592592
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Gateway Ingress Settings"
593593
Ingress IngressSpec `json:"ingress,omitempty"`
594594

595-
// RBAC defines RBAC options.
595+
// RBAC defines query RBAC options.
596596
//
597597
// +optional
598598
// +kubebuilder:validation:Optional

api/tempo/v1alpha1/zz_generated.deepcopy.go

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/community/manifests/tempo-operator.clusterserviceversion.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ metadata:
7474
capabilities: Deep Insights
7575
categories: Logging & Tracing,Monitoring
7676
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.15.1
77-
createdAt: "2025-02-17T13:21:50Z"
77+
createdAt: "2025-02-20T16:35:44Z"
7878
description: Create and manage deployments of Tempo, a high-scale distributed
7979
tracing backend.
8080
operatorframework.io/cluster-monitoring: "true"
@@ -459,6 +459,14 @@ spec:
459459
- description: ServiceMonitors defines the ServiceMonitor configuration.
460460
displayName: Service Monitors
461461
path: observability.metrics.serviceMonitors
462+
- description: |-
463+
RBAC defines query RBAC options.
464+
This option can be used only with multi-tenancy.
465+
displayName: Query RBAC Settings
466+
path: rbac
467+
- description: Enabled defines if the query RBAC should be enabled.
468+
displayName: Query RBAC Enabled
469+
path: rbac.enabled
462470
- description: ServiceAccount defines the Service Account to use for all Tempo
463471
components.
464472
displayName: Service Account
@@ -995,7 +1003,7 @@ spec:
9951003
all pods of this component.
9961004
displayName: PodSecurityContext
9971005
path: template.gateway.podSecurityContext
998-
- description: RBAC defines RBAC options.
1006+
- description: RBAC defines query RBAC options.
9991007
displayName: Query RBAC Settings
10001008
path: template.gateway.rbac
10011009
- description: Enabled defines if the query RBAC should be enabled.

bundle/community/manifests/tempo.grafana.com_tempomonolithics.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,15 @@ spec:
15311531
type: object
15321532
type: object
15331533
type: object
1534+
rbac:
1535+
description: |-
1536+
RBAC defines query RBAC options.
1537+
This option can be used only with multi-tenancy.
1538+
properties:
1539+
enabled:
1540+
description: Enabled defines if the query RBAC should be enabled.
1541+
type: boolean
1542+
type: object
15341543
resources:
15351544
description: Resources defines the compute resource requirements of
15361545
the Tempo container.

bundle/community/manifests/tempo.grafana.com_tempostacks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ spec:
14351435
type: string
14361436
type: object
14371437
rbac:
1438-
description: RBAC defines RBAC options.
1438+
description: RBAC defines query RBAC options.
14391439
properties:
14401440
enabled:
14411441
description: Enabled defines if the query RBAC should

bundle/openshift/manifests/tempo-operator.clusterserviceversion.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ metadata:
7474
capabilities: Deep Insights
7575
categories: Logging & Tracing,Monitoring
7676
containerImage: ghcr.io/grafana/tempo-operator/tempo-operator:v0.15.1
77-
createdAt: "2025-02-17T13:21:48Z"
77+
createdAt: "2025-02-20T16:35:43Z"
7878
description: Create and manage deployments of Tempo, a high-scale distributed
7979
tracing backend.
8080
operatorframework.io/cluster-monitoring: "true"
@@ -459,6 +459,14 @@ spec:
459459
- description: ServiceMonitors defines the ServiceMonitor configuration.
460460
displayName: Service Monitors
461461
path: observability.metrics.serviceMonitors
462+
- description: |-
463+
RBAC defines query RBAC options.
464+
This option can be used only with multi-tenancy.
465+
displayName: Query RBAC Settings
466+
path: rbac
467+
- description: Enabled defines if the query RBAC should be enabled.
468+
displayName: Query RBAC Enabled
469+
path: rbac.enabled
462470
- description: ServiceAccount defines the Service Account to use for all Tempo
463471
components.
464472
displayName: Service Account
@@ -995,7 +1003,7 @@ spec:
9951003
all pods of this component.
9961004
displayName: PodSecurityContext
9971005
path: template.gateway.podSecurityContext
998-
- description: RBAC defines RBAC options.
1006+
- description: RBAC defines query RBAC options.
9991007
displayName: Query RBAC Settings
10001008
path: template.gateway.rbac
10011009
- description: Enabled defines if the query RBAC should be enabled.

bundle/openshift/manifests/tempo.grafana.com_tempomonolithics.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,15 @@ spec:
15311531
type: object
15321532
type: object
15331533
type: object
1534+
rbac:
1535+
description: |-
1536+
RBAC defines query RBAC options.
1537+
This option can be used only with multi-tenancy.
1538+
properties:
1539+
enabled:
1540+
description: Enabled defines if the query RBAC should be enabled.
1541+
type: boolean
1542+
type: object
15341543
resources:
15351544
description: Resources defines the compute resource requirements of
15361545
the Tempo container.

bundle/openshift/manifests/tempo.grafana.com_tempostacks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ spec:
14351435
type: string
14361436
type: object
14371437
rbac:
1438-
description: RBAC defines RBAC options.
1438+
description: RBAC defines query RBAC options.
14391439
properties:
14401440
enabled:
14411441
description: Enabled defines if the query RBAC should

config/crd/bases/tempo.grafana.com_tempomonolithics.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,19 @@ spec:
15271527
type: object
15281528
type: object
15291529
type: object
1530+
query:
1531+
description: Query defines query configuration.
1532+
properties:
1533+
rbac:
1534+
description: |-
1535+
RBAC defines query RBAC options.
1536+
This option can be used only with multi-tenancy.
1537+
properties:
1538+
enabled:
1539+
description: Enabled defines if the query RBAC should be enabled.
1540+
type: boolean
1541+
type: object
1542+
type: object
15301543
resources:
15311544
description: Resources defines the compute resource requirements of
15321545
the Tempo container.

config/crd/bases/tempo.grafana.com_tempostacks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1431,7 +1431,7 @@ spec:
14311431
type: string
14321432
type: object
14331433
rbac:
1434-
description: RBAC defines RBAC options.
1434+
description: RBAC defines query RBAC options.
14351435
properties:
14361436
enabled:
14371437
description: Enabled defines if the query RBAC should

config/manifests/community/bases/tempo-operator.clusterserviceversion.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ spec:
388388
- description: ServiceMonitors defines the ServiceMonitor configuration.
389389
displayName: Service Monitors
390390
path: observability.metrics.serviceMonitors
391+
- description: |-
392+
RBAC defines query RBAC options.
393+
This option can be used only with multi-tenancy.
394+
displayName: Query RBAC Settings
395+
path: rbac
396+
- description: Enabled defines if the query RBAC should be enabled.
397+
displayName: Query RBAC Enabled
398+
path: rbac.enabled
391399
- description: ServiceAccount defines the Service Account to use for all Tempo
392400
components.
393401
displayName: Service Account
@@ -924,7 +932,7 @@ spec:
924932
all pods of this component.
925933
displayName: PodSecurityContext
926934
path: template.gateway.podSecurityContext
927-
- description: RBAC defines RBAC options.
935+
- description: RBAC defines query RBAC options.
928936
displayName: Query RBAC Settings
929937
path: template.gateway.rbac
930938
- description: Enabled defines if the query RBAC should be enabled.

config/manifests/openshift/bases/tempo-operator.clusterserviceversion.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,14 @@ spec:
388388
- description: ServiceMonitors defines the ServiceMonitor configuration.
389389
displayName: Service Monitors
390390
path: observability.metrics.serviceMonitors
391+
- description: |-
392+
RBAC defines query RBAC options.
393+
This option can be used only with multi-tenancy.
394+
displayName: Query RBAC Settings
395+
path: rbac
396+
- description: Enabled defines if the query RBAC should be enabled.
397+
displayName: Query RBAC Enabled
398+
path: rbac.enabled
391399
- description: ServiceAccount defines the Service Account to use for all Tempo
392400
components.
393401
displayName: Service Account
@@ -924,7 +932,7 @@ spec:
924932
all pods of this component.
925933
displayName: PodSecurityContext
926934
path: template.gateway.podSecurityContext
927-
- description: RBAC defines RBAC options.
935+
- description: RBAC defines query RBAC options.
928936
displayName: Query RBAC Settings
929937
path: template.gateway.rbac
930938
- description: Enabled defines if the query RBAC should be enabled.

docs/spec/tempo.grafana.com_tempomonolithics.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ spec: # TempoMonolithicSpec defines the desir
111111
enabled: false # Enabled defines if PrometheusRule objects should be created for this Tempo deployment.
112112
serviceMonitors: # ServiceMonitors defines the ServiceMonitor configuration.
113113
enabled: false # Enabled defines if ServiceMonitor objects should be created for this Tempo deployment.
114+
rbac: # RBAC defines query RBAC options. This option can be used only with multi-tenancy.
115+
enabled: false # Enabled defines if the query RBAC should be enabled.
114116
serviceAccount: "" # ServiceAccount defines the Service Account to use for all Tempo components.
115117
storage: # Storage defines the storage configuration.
116118
traces: # Traces defines the storage configuration for traces.

docs/spec/tempo.grafana.com_tempostacks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ spec: # TempoStackSpec defines the desired st
206206
route: # Route defines the options for the OpenShift route.
207207
termination: "" # Termination defines the termination type. The default is "edge".
208208
type: "" # Type defines the type of Ingress for the Jaeger Query UI. Currently ingress, route and none are supported.
209-
rbac: # RBAC defines RBAC options.
209+
rbac: # RBAC defines query RBAC options.
210210
enabled: false # Enabled defines if the query RBAC should be enabled.
211211
ingester: # Ingester defines the ingester component spec.
212212
podSecurityContext: # PodSecurityContext defines security context will be applied to all pods of this component.

internal/manifests/monolithic/statefulset.go

+4
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ func configureGateway(opts Options, sts *appsv1.StatefulSet) error {
431431
args = append(args, fmt.Sprintf("--traces.read.endpoint=http://localhost:%d", manifestutils.PortJaegerQuery)) // Jaeger UI upstream
432432
}
433433

434+
if tempo.Spec.Query.RBAC.Enabled {
435+
args = append(args, "--traces.query-rbac=true")
436+
}
437+
434438
if opts.CtrlConfig.Gates.OpenShift.ServingCertsService {
435439
args = append(args, []string{
436440
fmt.Sprintf("--tls.server.cert-file=%s", path.Join(servingCertDir, "tls.crt")), // TLS of public HTTP (8080) and gRPC (8090) server

0 commit comments

Comments
 (0)