Code Monkey home page Code Monkey logo

Comments (7)

pb82 avatar pb82 commented on May 23, 2024

Creating ldap.toml is currently not directly supported. However, the Grafana CR allows you to specify a list of secrets that are added to the Grafana pod as volumes (see the docs here). The name of the extra volume will be secret-<secret name>. You could have a Secret with a key ldap.toml and the file contents as the value and use this mechanism to mount it to a directory inside the Grafana pod.

An example of how we use this can be found here: https://github.com/integr8ly/application-monitoring-operator/blob/master/templates/grafana.yaml#L48

I agree that ConfigMaps would be more suitable but currently the Grafana CR only accepts a list of secrets. But i'm thinking about adding configmap mounting support for a while.

Please let me know if this works for you.

from grafana-operator.

pb82 avatar pb82 commented on May 23, 2024

Sorry, we don't currently create volume mounts for those extra volumes in the Grafana pod. So this won't work. But thats a good use case for it and we should probably implement it.

from grafana-operator.

abergmeier avatar abergmeier commented on May 23, 2024

I wonder why not implement handling of GrafanaConfigAuthLdap instead?

from grafana-operator.

pb82 avatar pb82 commented on May 23, 2024

I'd like to keep it as generic as possible. Being able to mount files into the Grafana pod in combination with the the configuration in the Grafana CR should work for your use case and probably a number of others as well.

from grafana-operator.

abergmeier avatar abergmeier commented on May 23, 2024

I'd like to keep it as generic as possible.

So rather remove GrafanaConfigAuthLdap and insert an init-container, which then copies content of configMaps into volumes!?

from grafana-operator.

pb82 avatar pb82 commented on May 23, 2024

No, the idea is not to remove GrafanaConfigAuthLdap. I'm not familiar with LDAP configuration in Grafana, but it looks like the following is needed:

  1. Configure LDAP as described in the Grafana docs. This is already possible with GrafanaConfigAuthLdap. You need to provide a path to ldap.toml in that config, so...
  2. ...give users a way to provide ldap.toml in the Grafana pod. Using a ConfigMap is probably the way to go and the idea is to allow mounting configmaps as volumes (and volumemounts) via the Grafana CR.

It would probably look something like this:

apiVersion: integreatly.org/v1alpha1
kind: Grafana
...
spec:
  config:
    auth.ldap:
      config_file: "/etc/configmaps/ldap-toml/ldap.toml"
  configmaps:
    - ldap-tomp
...

The operator would then automatically add a volumes for all configmaps to the Grafana pod and also mount every configmap under /etc/configmaps/<config map name>. Keys in the configmap would be available as files in this directory.

This is also how its implemented in the Prometheus operator. Do you think that would cover all requirements for configuring LDAP?

from grafana-operator.

pb82 avatar pb82 commented on May 23, 2024

ping @abergmeier. The proposed solution is now implemented in #49 , mind giving it a try?

from grafana-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.