kubernetes-app icon indicating copy to clipboard operation
kubernetes-app copied to clipboard

Connecting to rancher cluster

Open qdrop17 opened this issue 6 years ago • 5 comments

Hi everyone.

Can please someone quickly explain how we can connect this plugin to a Rancher (2.1.1) cluster? Our kubeconfig file looks as follows:

apiVersion: v1
kind: Config
clusters:
- name: "jls"
  cluster:
    server: "https://k8s.company.tld/k8s/clusters/c-ckrdr"
    api-version: v1

users:
- name: "user-rd343"
  user:
    token: "kubeconfig-user-rd343:cxdgf235zgsdg6436g325z45ujsgsdgwegwfwd4qr2"

contexts:
- name: "company"
  context:
    user: "user-rd343"
    cluster: "company"

current-context: "company"

We're perfectly able to use kubectl with this kubeconfig. No problems at all. But the plugin for grafana to monitor our cluster seems very reluctant to integrate.

Any suggestions are highly appreciated.

qdrop17 avatar Nov 27 '18 08:11 qdrop17

I have the same question

padiazg avatar Nov 28 '18 17:11 padiazg

I figured out it.

Get "Kubeconfig File" on your cluster node dashboard

Gather this values: url: from Kubeconfig File user: take in account that the token is user:password, so take the first part that is on the left of the : password: is the part that is to the right of : in token Ex:

token: "kubeconfig-user-g949c:zf9vzf5d8clrmqxth5hj29kptnskkps6zjs78df2qnt4kbqqsgt466"

User = kubeconfig-user-g949c Password: = zf9vzf5d8clrmqxth5hj29kptnskkps6zjs78df2qnt4kbqqsgt466

CA Cert: from Global => Settings => cacerts

Now in the cluster add panel complete url, select Basic Auth, With CA Cert and Skip TLS Verification (Insecure) , complete User , Password and CA Cert

You need to have a Prometheus installed and configured as Datasource before saving this config.

Once you fulfill those fields you can save, and hopefully you will have a connection to your cluster.

padiazg avatar Nov 30 '18 13:11 padiazg

Thanks @padiazg it works!

sosoriov avatar Jan 24 '19 08:01 sosoriov

are you using cluster monitoring installed by Rancher, or did you install prometheus operator? This is not working for me. and i don't have any CA certs either.

i5okie avatar Aug 14 '19 20:08 i5okie

Prometheus operator

sosoriov avatar Aug 15 '19 18:08 sosoriov