Skip to content
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

Add support for query RBAC #1100

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

pavolloffay
Copy link
Collaborator

@pavolloffay pavolloffay commented Jan 22, 2025

Depends on observatorium/api#789

TODOs

  • update gateway image
TEMPO_GATEWAY_IMAGE=docker.io/pavolloffay/obs-api:65 IMG_PREFIX=docker.io/pavolloffay OPERATOR_VERSION=$(date +%s).0.0 BUNDLE_VARIANT=openshift make docker-build docker-push bundle bundle-build bundle-push olm-upgrade reset
 k apply -f tests/e2e-openshift/multitenancy/02-install-otelcol.yaml
k apply -f tests/e2e-openshift/multitenancy/00-install-storage.yaml 
k apply -f tests/e2e-openshift/multitenancy/01-install-tempo.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: job-tempo-query
automountServiceAccountToken: true
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: tempostack-traces-reader
rules:
  - apiGroups:
      - 'tempo.grafana.com'
    resources:
      - dev
    resourceNames:
      - traces
    verbs:
      - 'get'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tempo-job-view
  namespace: chainsaw-multitenancy
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: tempostack-traces-reader
subjects:
- kind: ServiceAccount
  name: job-tempo-query
  namespace: chainsaw-multitenancy
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: view
  namespace: chainsaw-multitenancy
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: view
subjects:
- kind: ServiceAccount
  name: job-tempo-query
  namespace: chainsaw-multitenancy


apiVersion: batch/v1
kind: Job
metadata:
  name: verify-traces-grpc
  namespace: chainsaw-multitenancy
spec:
  template:
    spec:
      serviceAccountName: job-tempo-query
      containers:
      - name: verify-traces
        image: ghcr.io/grafana/tempo-operator/test-utils:main
        command:
        - /bin/bash
        - -eux
        - -c
        args:
        - |
          token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
          curl \
            -v -G \
            --header "Authorization: Bearer $token" \
            --header "X-Scope-OrgID: dev" \
            --cacert /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt \
           https://tempo-simplest-gateway.chainsaw-multitenancy.svc:8080/api/traces/v1/dev/tempo/api/search --data-urlencode 'q={ }' \
            | tee /tmp/jaeger.out
      restartPolicy: Never

UI plugin

kubectl apply -f - <<EOF         
apiVersion: observability.openshift.io/v1alpha1
kind: UIPlugin
metadata:
  name: distributed-tracing
spec:
  type: DistributedTracing
EOF

@codecov-commenter
Copy link

codecov-commenter commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 16 lines in your changes missing coverage. Please review.

Project coverage is 58.60%. Comparing base (1adba61) to head (070fb58).

Files with missing lines Patch % Lines
api/tempo/v1alpha1/zz_generated.deepcopy.go 0.00% 10 Missing ⚠️
internal/manifests/gateway/gateway.go 68.42% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1100      +/-   ##
==========================================
- Coverage   58.61%   58.60%   -0.02%     
==========================================
  Files         113      113              
  Lines       10168    10204      +36     
==========================================
+ Hits         5960     5980      +20     
- Misses       3902     3916      +14     
- Partials      306      308       +2     
Flag Coverage Δ
unittests 58.60% <55.55%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay marked this pull request as ready for review February 10, 2025 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants