Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revisionBoth sides next revision
devops:deploy_prometheus_on_kubernetes_using_prometheus-operator [2020/04/27 15:24] – [values.yaml] admindevops:deploy_prometheus_on_kubernetes_using_prometheus-operator [2020/09/17 06:43] – [OpenID для входа в grafana] admin
Line 15: Line 15:
  
 ====== OpenID для входа в grafana ====== ====== OpenID для входа в grafana ======
-https://steemit.com/grafana/@timoschuetz/setting-up-grafana-oauth2-in-kubernetes +https://steemit.com/grafana/@timoschuetz/setting-up-grafana-oauth2-in-kubernetes \\ 
 +Вот пример настроек **grafana** для авторизации пользователей из **Active Directory**, которые аутентифицируются на **Keycloak**. Тут важно обратить внимание на то, что роли пользователей задаются в соответствии с группами, в которые входит пользователь (параметр **role_attribute_path**), а имена групп должны быть со слешем в начале: **/Grafana_Editor**.
 <code> <code>
-grafana: 
   grafana.ini:   grafana.ini:
     paths:     paths:
Line 29: Line 28:
     log:     log:
       mode: console       mode: console
 +      level: debug
     grafana_net:     grafana_net:
       url: https://grafana.net       url: https://grafana.net
     server:     server:
-      root_url: https://grafana.preprod.esb.rdleas.ru +      root_url: "https://grafana.domain.local"
-    auth.generic_oauth: +
-      enabled: true +
-      client_id: <<CLIENTID>> +
-      client_secret: <<CLIENTSECRET>> +
-      scopes: openid profile email +
-      auth_url: <<AUTHORIZEURL>> +
-      token_url: <<TOKENURL>> +
-      api_url: <<APIURL>>+
     auth.basic:     auth.basic:
       enabled: false       enabled: false
-    auth: 
       oauth_auto_login: true       oauth_auto_login: true
       disable_login_form: true       disable_login_form: true
 +    auth.generic_oauth:
 +      enabled: true
 +      tls_skip_verify_insecure: true
 +      name: keycloak
 +      allow_sign_up: true
 +      client_id: grafana
 +      client_secret: 12345678-123345678-12345678
 +      scopes: groups profile email
 +      #https://grafana.com/docs/grafana/latest/auth/generic-oauth/#jmespath-examples
 +      role_attribute_path: contains(groups[*], '/Grafana_Admin') && 'Admin' || contains(groups[*], '/Grafana_Editor') && 'Editor' || 'Viewer'
 +      auth_url: https://sso.domain.local/auth/realms/ad_realm/protocol/openid-connect/auth
 +      token_url: https://sso.domain.local/auth/realms/ad_realm/protocol/openid-connect/token
 +      api_url: https://sso.domain.local/auth/realms/ad_realm/protocol/openid-connect/userinfo
 +      signout_redirect_url: https://sso.domain.local/auth/realms/ad_realm/protocol/openid-connect/logout?redirect_uri=https://grafana.domain.local/login
 +
 +</code>
  • devops/deploy_prometheus_on_kubernetes_using_prometheus-operator.txt
  • Last modified: 2020/09/17 06:54
  • by admin