Skip to content

Commit

Permalink
feat: adjustments to Grafana team permissions (#1563)
Browse files Browse the repository at this point in the history
Co-authored-by: Jehoszafat Zimnowoda <jehoszafat.zimnowoda@redkubes.com>
  • Loading branch information
merll and Jehoszafat Zimnowoda authored Mar 25, 2024
1 parent d0738e6 commit 3d16c1d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions helmfile.d/helmfile-60.teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ releases:
nameOverride: {{ $teamId }}-po-grafana
fullnameOverride: {{ $teamId }}-po-grafana
grafana.ini:
"auth.generic_oauth":
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin' || contains(groups[*], 'team-{{ $teamId }}') && 'Editor'{{ if not ($team | get "managedMonitoring.private" false) }} || 'Viewer'{{- end }}
server:
root_url: https://grafana-{{ $teamId }}.{{ $domain }}
sidecar:
Expand Down
5 changes: 3 additions & 2 deletions helmfile.d/snippets/grafana.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
auth_url: {{ printf "%s/protocol/openid-connect/auth" .keycloakBase }}
token_url: {{ printf "%s/protocol/openid-connect/token" .keycloakBase }}
api_url: {{ printf "%s/protocol/openid-connect/userinfo" .keycloakBase }}
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin' || 'Editor'
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin'
role_attribute_strict: true
log:
level: error
users:
allow_sign_up: true
allow_sign_up: false
auto_assign_org: true
# fall back to admin for anonymous when no auth is available
auto_assign_org_role: Viewer
1 change: 1 addition & 0 deletions values-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ changes:
- version: 20
networkPoliciesMigration: true
additions:
- 'teamConfig.{team}.managedMonitoring.private': true
- 'apps.loki.storage.gcs.serviceAccount'
deletions:
- 'apps.loki.storage.gcs.project'
Expand Down
3 changes: 3 additions & 0 deletions values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,9 @@ definitions:
alertmanager:
type: boolean
default: false
private:
type: boolean
default: false
networkPolicy:
ingressPrivate:
title: Enable filtering of ingress traffic inside the cluster
Expand Down

0 comments on commit 3d16c1d

Please sign in to comment.