GithubHelp home page GithubHelp logo

Comments (6)

armagankaratosun avatar armagankaratosun commented on June 2, 2024 2

Hello all

I was struggling with the same problem and I honestly think an example (https://github.com/grafana/grafana-operator/tree/master/examples) will improve the user/dev experience, at least, this is where I first look when I want to deploy resources with any operator.

If no one objects, I can provide examples based on my configuration for persistence storage and OpenID Connect (keycloak) integration as PR once I am finished tuning my setup. You can even assign this issue to me if you like.

Cheers!

from grafana-operator.

HubertStefanski avatar HubertStefanski commented on June 2, 2024 1

Hi @aidapsibr, We generally try to avoid adding examples like this, because they're mostly just K8s, rather than operator-specific settings. The Grafana CR for example has all the fields from the deployment.spec resource embedded within it. I.e. you should be able to look at k8s documentation on how to configure a deployment with persistent volumes (e.g. through persistentVolumeClaimTemplates)
For example: https://github.com/grafana/grafana-operator/blob/master/examples/grafana_deployment/resources.yaml#L19C7-L28C36 the template section is directly built from the DeploymentSpec Struct (that we import from the k8s lib), as such you can add any configuration available in the Deployment CR, and the operator will respect your settings, and even reconcile them as you specified. We thought this was a more robust means of supporting a wider range of settings that users requested, without having to specifically extend the Grafana CR with any further wrappers (and thus, confusion).

However, if you think this would improve user/dev experience, then we've got no issue with accepting pull requests with those. (Unfortunately, the core maintainer group is quite busy atm, our daily-jobs are focused on different areas right now).

I hope this helps, or at least gives some more relevant guidance (I found this from one of our users in the Grafana-Operator channel in the k8s slack)

apiVersion: grafana.integreatly.org/v1beta1
kind: Grafana
metadata:
  name: grafana
  labels:
    dashboards: "grafana"
spec:
  persistentVolumeClaim:    
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 10Gi
      storageClassName: standard-v1
      volumeMode: Filesystem
  config:
    log:
      mode: console
    # disable any means of authentication
    auth.anonymous:
      enabled: "True"
      org_role: Admin
    auth:
      disable_login_form: "False"
      disable_signout_menu: "True"
    auth.basic:
      enabled: "False"
    users:
      allow_sign_up: "False"
  deployment:
    spec:
      strategy: 
        type: Recreate
      template:
        spec:
          securityContext:
            runAsUser: 10001
            runAsGroup: 10001
            fsGroup: 10001
          volumes:
            - name: grafana-data
              persistentVolumeClaim:
                claimName: grafana-pvc

from grafana-operator.

HubertStefanski avatar HubertStefanski commented on June 2, 2024 1

Thank you @armagankaratosun !

@aidapsibr Let us know if those examples are helpful to you!

from grafana-operator.

HubertStefanski avatar HubertStefanski commented on June 2, 2024

@armagankaratosun That would be awesome! Thanks for offering your help! Looking forward to seeing your PR 😅 ping any of the maintainers on it, and we'll try to review and merge ASAP.

Thanks!

from grafana-operator.

armagankaratosun avatar armagankaratosun commented on June 2, 2024

hello again @HubertStefanski

I submitted my PR #1397

hope it helps!

cheers!

from grafana-operator.

spimmer avatar spimmer commented on June 2, 2024

@HubertStefanski

I just figured out that this section is incorrect indented:

volumes:
- name: grafana-data
persistentVolumeClaim:
claimName: grafana-pvc

According to API reference volumes[index] has to be under node Grafana.spec.deployment.spec.template.spec and not under Grafana.spec.deployment.spec.template

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.