-
Notifications
You must be signed in to change notification settings - Fork 415
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
LDAP configuration example #1369
Comments
Hi @Tualua This generally shouldn't be any different from a vanilla Grafana LDAP config, as long as you adhere to upstream documentation, and populate the respective fields in the Grafana CR, your LDAP config should be applied properly. The Operator simply exposes the upstream Grafana API through the Grafana CR spec, so if upstream has a config field called Does this help? We generally tend to avoid adding extensive examples, as most of what users want to do is already available in the Grafana API structs and documentation, but perhaps, now that I think of it, we should absolutely make that more clear in our own documentation. This isn't the first question of this type, so we should be more explicit and clear in how this works. |
But how to pass toml config file?
…On Wed, Jan 3, 2024, 17:42 Hubert Stefanski ***@***.***> wrote:
Hi @Tualua <https://github.com/Tualua> This generally shouldn't be any
different from a vanilla Grafana LDAP config, as long as you adhere to
upstream documentation, and populate the respective fields in the Grafana
CR, your LDAP config should be applied properly.
The Operator simply exposes the upstream Grafana API through the Grafana
CR spec, so if upstream has a config field called someconfig: myvalue you
should be able to populate the Grafana CR spec with the same key and value,
and have the operator manage that without having to do anything else.
Does this help? We generally tend to avoid adding extensive examples, as
most of what users want to do is already available in the Grafana API
structs and documentation, but perhaps, now that I think of it, we should
absolutely make that more clear in our own documentation. This isn't the
first question of this type, so we should be more explicit and clear in how
this works.
—
Reply to this email directly, view it on GitHub
<#1369 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHX2DHPDH32VUPX27365VSTYMURXPAVCNFSM6AAAAABBJSSHZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZVGA4DOMJTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@Tualua you should be able to pass it as separate fields, your YAML should look something like: config:
auth.anonymous:
enabled: "True"
auth:
disable_login_form: "False"
disable_signout_menu: "True"
auth.basic:
enabled: "True"
auth.proxy:
enabled: "True"
enable_login_token: "True"
header_property: "username"
header_name: "X-Forwarded-User" when using the following TOML [auth.anonymous]
enabled = "True"
[auth]
disable_login_form = "False"
disable_signout_menu = "True"
[auth.basic]
enabled = "True"
[auth.proxy]
enabled = "True"
enable_login_token = "True"
header_property = "username"
header_name = "X-Forwarded-User" See https://github.com/grafana/grafana-operator/blob/master/examples/oauth_proxy/resources.yaml#L140C6-L154 as an example of how that looks in a Grafana CR |
@HubertStefanski Hello! Thank you for your reply. According to LDAP configuration docs https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/ldap/
And in that file you should put all your LDAP settings. So my question was how to pass ldap.toml to grafana container? |
If that's your preferred method, you can simply volume mount it like any other volume source: The example above shows a sidecar config, for your use case, ignore it, and only pay attention to the volume/volume mounts and how they are structured within the Grafana CR. So, essentially all you need to do is add your LDAP config to a configmap, then volume mount it within the Grafana CR spec, the Grafana pod should automatically read it when it gets created. LMK if that helps |
Yes, I've found it (kuber-newbie :)) right after posted question.
May be it will help another newbie. Something like this:
It is 404 |
Yeah! You should be able to do that!
Ahh, we just merged #1370 , that changed the file extension from |
Yes, I can but unfortunately it does not work.
Error is:
What am I doing wrong? |
Can you please share a slightly wider spec with any sensitive fields removed? Thanks! |
Here is whole Ansible task
|
Sorry for only getting back now, @Tualua did you manage to make this work? or would you still like me to have a look at it? |
Complete working example for future searchers ldap-config.yaml
ldap-ingress-grafana.yaml
|
@kcepaxe Thanks for the example! 🙌 would you mind submitting a PR to add it to our |
Closed through #1376 |
I don't think this configuration ever worked. I've tried passing volumeMounts to the grafana container and it does not go anywhere: The ability to pass arbitrary ConfigMaps was removed in this commit a8c06a back in 2022. And the current Deployment reconciler https://github.com/grafana/grafana-operator/blob/master/controllers/reconcilers/grafana/deployment_reconciler.go#L113-L134 does not seem to read any volumeMounts I pass into it. |
@xmj the commit you reference switches the way overrides are processed. Instead of us defining all fields, we merge the If this doesn't work for you, please open a new bug report so we can properly triage it |
Hello!
Is there any example or how-to with LDAP configuration?
The text was updated successfully, but these errors were encountered: