Code Monkey home page Code Monkey logo

Comments (2)

MichalPloski avatar MichalPloski commented on August 29, 2024 1

Workaround:

Enable plugin:

curl -v --basic -XPOST "admin:admin@localhost:3000/api/plugins/grafana-kubernetes-app/settings?enabled=true"

Configure datasource:

curl -v --basic -XPOST "admin:admin@localhost:3000/api/datasources" -d '{"type":"grafana-kubernetes-datasource","name":"k8s.dev.io","url":"https://api.k8s.dev.io","access":"proxy","jsonData":{"keepCookies":[],"ds":"prometheus","tlsSkipVerify":true},"basicAuth":true,"basicAuthUser":"admin","basicAuthPassword":"admin"}' -H "Content-Type: application/json"

Ansible example:

- name: Install grafana plugins
  grafana_plugin:
    name: "{{ item }}"
    version: latest
    state: present
  with_items: "{{ grafana_plugins }}"
  notify: restart grafana
  ignore_errors: true

- name: Enable grafana  kubernetes plugin
  uri:
      url: "http://{{ grafana_local_ip }}:{{ grafana_port }}/api/plugins/grafana-kubernetes-app/settings?enabled=true"
      method: POST
      user: "{{ grafana_user }}"
      password: "{{ grafana_password }}"
      body: ''
      body_format: json
      force_basic_auth: yes
      headers:
        Content-Type: "application/json"

- name: Configure grafana kubernetes plugin datasource
  uri:
      url: "http://{{ grafana_local_ip }}:{{ grafana_port }}/api/datasources"
      method: POST
      user:  "{{ grafana_user }}"
      password: "{{ grafana_password }}"
      body: '{"type":"grafana-kubernetes-datasource","name":"k8s.dev.shedul.io","url":"https://api.k8s.dev.shedul.io","access":"proxy","jsonData":{"keepCookies":[],"ds":"prometheus","tlsSkipVerify":true},"basicAuth":true,"basicAuthUser":"admin","basicAuthPassword":"7GPfUrkCobA98nGWxL8liTyXYCXUFejN"}'
      body_format: json
      force_basic_auth: yes
      status_code: 200,409
      headers:
        Content-Type: "application/json"

from kubernetes-app.

karthikeayan avatar karthikeayan commented on August 29, 2024

I get this,

*   Trying 100.66.212.213...
* Connected to grafana-service (100.66.212.213) port 80 (#0)
* Server auth using Basic with user 'admin'
> POST /api/plugins/grafana-kubernetes-app/settings?enabled=true HTTP/1.1
> Authorization: Basic xxxxxxxxxxxxxxxxxxx
> User-Agent: curl/7.29.0
> Host: grafana-service
> Accept: */*
>
< HTTP/1.1 415 Unsupported Media Type
< Cache-Control: no-cache
< Content-Type: application/json; charset=utf-8
< Expires: -1
< Pragma: no-cache
< X-Frame-Options: deny
< Date: Tue, 04 Jun 2019 07:54:21 GMT
< Content-Length: 70
<
{ [data not shown]
100    70  100    70    0     0    222      0 --:--:-- --:--:-- --:--:--   222
* Connection #0 to host grafana-service left intact
[{"classification":"ContentTypeError","message":"Empty Content-Type"}]

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.