-
Notifications
You must be signed in to change notification settings - Fork 1.8k
OBSDOCS-1814: Docs for Tempo query RBAC #93417
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * observability/distr_tracing/distr-tracing-tempo-configuring.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="distr-tracing-tempo-configuring-query-rbac_{context}"] | ||
= Configuring the query RBAC | ||
|
||
As an administrator, you can set up the query role-based access control (RBAC) to filter the span attributes for your users by the namespaces for which you granted them permissions. | ||
max-cx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[NOTE] | ||
==== | ||
When you enable the query RBAC, users can still access traces from all namespaces, and the `service.name` and `k8s.namespace.name` attributes are also visible to all users. | ||
==== | ||
|
||
.Prerequisites | ||
|
||
* An active {oc-first} session by a cluster administrator with the `cluster-admin` role. | ||
+ | ||
[TIP] | ||
==== | ||
* Ensure that your {oc-first} version is up to date and matches your {product-title} version. | ||
|
||
* Run `oc login`: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc login --username=<your_username> | ||
---- | ||
==== | ||
|
||
.Procedure | ||
|
||
. Enable multitenancy and query RBAC in the `TempoStack` custom resource (CR), for example: | ||
+ | ||
[source,yaml] | ||
---- | ||
apiVersion: tempo.grafana.com/v1alpha1 | ||
kind: TempoStack | ||
metadata: | ||
name: simplest | ||
namespace: chainsaw-multitenancy | ||
spec: | ||
storage: | ||
secret: | ||
name: minio | ||
type: s3 | ||
storageSize: 1Gi | ||
resources: | ||
total: | ||
limits: | ||
memory: 2Gi | ||
cpu: 2000m | ||
tenants: | ||
mode: openshift | ||
authentication: | ||
- tenantName: dev | ||
tenantId: "1610b0c3-c509-4592-a256-a1871353dbfb" | ||
template: | ||
gateway: | ||
enabled: true # <1> | ||
rbac: | ||
enabled: true # <2> | ||
queryFrontend: | ||
jaegerQuery: | ||
enabled: false # <3> | ||
---- | ||
<1> Always set to `true`. | ||
<2> Always set to `true`. | ||
<3> Always set to `false`. | ||
|
||
. Create a cluster role and cluster role binding to grant the target users the permissions to access the tenant that you specified in the `TempoStack` CR, for example: | ||
+ | ||
[source,yaml] | ||
---- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: tempo-dev-read | ||
rules: | ||
- apiGroups: [tempo.grafana.com] | ||
resources: [dev] # <1> | ||
resourceNames: [traces] | ||
verbs: [get] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: tempo-dev-read | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: tempo-dev-read | ||
subjects: | ||
- kind: Group | ||
apiGroup: rbac.authorization.k8s.io | ||
name: system:authenticated # <2> | ||
max-cx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
---- | ||
<1> Tenant name in the `TempoStack` CR. | ||
<2> Means all authenticated OpenShift users. | ||
|
||
. Grant the target users the permissions to read attributes for the project. You can do this by running the following command: | ||
+ | ||
[source,bash] | ||
---- | ||
$ oc adm policy add-role-to-user view <username> -n <project> | ||
---- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.