Giter VIP home page Giter VIP logo

Comments (11)

jtlisi avatar jtlisi commented on August 23, 2024 2

@renich there currently isn't support for templating this kind of deployment. The configs are stored inside a SQL database. Configuration is done using the Grafana UI or an api call to grafana. Grafana 5.0 has static datasources that could be installed with helm. Although I think it may get very messy since the configs for the kubernetes datasource are somewhat obfuscated from the user.

http://docs.grafana.org/administration/provisioning/#example-datasource-config-file

Your best bet would be to configure the datasource and get it working using the UI. Then output the json using the grafana api /api/datasources/:id

The static yaml file for this app will be something like this:

# config file version
apiVersion: 1

datasources:
  # <string, required> name of the datasource. Required
- name: example_kube
  # <string, required> datasource type. Required
  type: grafana-kubernetes-datasource
  # <string, required> access mode. direct or proxy. Required
  access: proxy
  # <int> org id. will default to orgId 1 if not specified
  orgId: 1
  # <string> url
  url: http://localhost:443
  # <string> database password, if used
  password: ""
  # <string> database user, if used
  user: ""
  # <string> database name, if used
  database: ""
  # <bool> enable/disable basic auth
  basicAuth: false
  # <string> basic auth username
  basicAuthUser: ""
  # <string> basic auth password
  basicAuthPassword: ""
  # <bool> enable/disable with credentials headers
  withCredentials: true
  # <bool> mark as default datasource. Max one per org
  isDefault: false
  # <map> fields that will be converted to json and stored in json_data
  jsonData:
    ds: example_prometheus
    keepCookies: []
    tlsAuth: true
    tlsAuthWithCACert: true
  secureJsonData:
    tlsCACert: "..."
    tlsClientCert: "..."
    tlsClientKey: "..."
  version: 1
  # <bool> allow users to edit datasources from the UI.
  editable: false

from kubernetes-app.

Timbus avatar Timbus commented on August 23, 2024 2

Just an FYI: I added the kube datasource by running kubectl as a second container in the same pod as grafana. Just run kubectl proxy --port 8888 and it will handle the token stuff. Then you can just add http://localhost:8888 as the API location. Makes it very simple.

from kubernetes-app.

stigok avatar stigok commented on August 23, 2024 1

For extra clarity in @Timbus suggestion, the last argument should be --port

kubectl proxy --port 8888

Works good for me too

from kubernetes-app.

thuandt avatar thuandt commented on August 23, 2024

@renich grafana chart is already in kubernetes stable/grafana
But seem this application need some special config to access Kubernetes API.

from kubernetes-app.

renich avatar renich commented on August 23, 2024

Yes. Any idea of what to do? I'm kind of stuck there.

from kubernetes-app.

thuandt avatar thuandt commented on August 23, 2024

Maybe I'm wrong but this application seem don't support "inCluster" discovery.

from kubernetes-app.

jtlisi avatar jtlisi commented on August 23, 2024

@thuandt By that do you mean the application will automatically configure the cluster if the Grafana instance is running in the cluster?

from kubernetes-app.

thuandt avatar thuandt commented on August 23, 2024

@jschill Yes. By default, if granfana run inside k8s cluster, we already have cert and token to access API server.

from kubernetes-app.

jtlisi avatar jtlisi commented on August 23, 2024

@thuandt the issue is, the plugin code related to adding a Kubernetes cluster is executed on the front end. So we can not take advantage of the inCluster configuration.

from kubernetes-app.

Flowkap avatar Flowkap commented on August 23, 2024

I'm a bit confused. Is there any way of automatically installing this plugin within a kubernetes deploy?

from kubernetes-app.

tammersaleh avatar tammersaleh commented on August 23, 2024

Does the kubectl proxy solution require you to be running that proxy at all times, or just for the initial configuration?

from kubernetes-app.

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.