Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Issue with GKE cluster #29

Open
pvikas opened this issue Jun 6, 2018 · 10 comments
Open

Issue with GKE cluster #29

pvikas opened this issue Jun 6, 2018 · 10 comments

Comments

@pvikas
Copy link

pvikas commented Jun 6, 2018

Hi,

I have a standalone grafana server with the plugin installed.
Was able to successfully connect to the GKE cluster (the node-exporter and kube-state-metrics) were also successfully deployed automatically.
I went ahead and deployed Prometheus in the cluster and updated the scrape config to match the one provided in the add-cluster page.

Thought I can see the node list, services, namespaces and PODs, none of the metrics are shown. All I get in the dashboard is NA and an error stating 'Datasource named $datasource was not found'.

screen shot 2018-06-06 at 10 00 48 am

Please help.

Thanks,
Vikas

@pvikas
Copy link
Author

pvikas commented Jun 7, 2018

This was a honest newbie mistake.

Steps to be followed:

  • Install grafana on a VM
  • Install the plugin
  • Setup prometheus using HELM in GKE cluster
  • Update the scrape config with the one suggested in this plugin's create dashboard page
  • Expose the prometheus endpoint
  • Create a datasource pointing to the exposed prometheus endpoint
  • Get the credentials (username/password) from GKE cluster info page, also the master URL
  • Create a new cluster, select the Basic auth option and use the above username/password and master
  • Select the prometheus datasoruce created earlier
  • Save

Regards,
Vikas

@gabrielfsousa
Copy link

@pvikas what prometheus did you install ?

@xmariopereira
Copy link

@pvikas only with username / password?

@gabrielfsousa
Copy link

i have an independent kubernetes and used TLS Client Auth With CA Cert . and manage to connect.

now my prometheus dont see the kube-state-metrics, any one the give me some guidelines ?

@pvikas
Copy link
Author

pvikas commented Jun 27, 2018

@gabrielfsousa - Prometheus installed via helm (took the latest stable version)
As for no metrics - first guess is check the scrape config for Prometheus

@mariopoeta - this is a setup with VPC in-place. Hence used just the username/password.

@gabrielfsousa
Copy link

gabrielfsousa commented Jun 29, 2018

@pvikas thanks, i'm working with my independent kubernetes cluster

i did my own Prometheus installation and works.
now all metrics are working, but did somethings difference

kube-state-metrics is from https://github.com/kubernetes/kube-state-metrics
and the prometheus.yml is this

scrape_configs:
    - job_name: 'kubernetes-kubelet'
      scheme: https
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      kubernetes_sd_configs:
      - role: node
      relabel_configs:
      - action: labelmap
        regex: __meta_kubernetes_node_label_(.+)
      - target_label: __address__
        replacement: kubernetes.default.svc:443
      - source_labels: [__meta_kubernetes_node_name]
        regex: (.+)
        target_label: __metrics_path__
        replacement: /api/v1/nodes/${1}/proxy/metrics
    - job_name: 'kubernetes-cadvisor'
      scheme: https
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
      bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      kubernetes_sd_configs:
      - role: node
      relabel_configs:
      - action: labelmap
        regex: __meta_kubernetes_node_label_(.+)
      - target_label: __address__
        replacement: kubernetes.default.svc:443
      - source_labels: [__meta_kubernetes_node_name]
        regex: (.+)
        target_label: __metrics_path__
        replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
    - job_name: 'kubernetes-kube-state'
      kubernetes_sd_configs:
      - role: pod
      relabel_configs:
      - action: labelmap
        regex: __meta_kubernetes_pod_label_(.+)
      - source_labels: [__meta_kubernetes_namespace]
        action: replace
        target_label: kubernetes_namespace
      - source_labels: [__meta_kubernetes_pod_name]
        action: replace
        target_label: kubernetes_pod_name
      - source_labels: [__meta_kubernetes_pod_label_grafanak8sapp]
        regex: .*true.*
        action: keep
      - source_labels: ['__meta_kubernetes_pod_label_daemon', '__meta_kubernetes_pod_node_name']
        regex: 'node-exporter;(.*)'
        action: replace
        target_label: nodename
    - job_name: 'kubernetes-pods'
      kubernetes_sd_configs:
      - role: pod
      relabel_configs:
      - action: labelmap
        regex: __meta_kubernetes_pod_label_(.+)
      - source_labels: [__meta_kubernetes_namespace]
        action: replace
        target_label: kubernetes_namespace
      - source_labels: [__meta_kubernetes_pod_name]
        action: replace
        target_label: kubernetes_pod_name

whit out kubernetes-pods i dont have the kube_ metrics

@cmorent
Copy link

cmorent commented Oct 14, 2018

Hello there, I am struggling with the same kind of issue...

I have a prometheus environment running within my cluster, installed using the stable helm chart, working fine for other dashboards and metrics collection.

I deployed grafana using the stable helm chart too and I'm struggling with the authentication part.
I use the cluster endpoint ip as URL like: https://<endpoint> along with the username, password and cluster CA certificate available in the GKE cluster details. I am also checking the Basic Auth, With CA Cert and Skip TLS verification options.

If I click on the save button, it says that everything went fine and was successfully able to connect to the cluster. However, if I hit the deploy button, it says that the datasource was added but that it was not able to connect to the cluster...

Am I doing something wrong?

@josepedro
Copy link

I have the same problem with GKE stuffs... =(

@ghost
Copy link

ghost commented Jan 14, 2019

it is working on GKE and on separate Kube cluster (on VMs)

  1. Install via Kube cluster
  2. Install via Helm prometheus and grafana
  3. Install kube plugin on grafana
  4. Configure datasource
  5. Done.

If you have any additional questions please let me know and I will try to help you.

I have just one problem which related to Node Cluster data on dashboard.

@neodani
Copy link

neodani commented Jul 31, 2019

it is working on GKE and on separate Kube cluster (on VMs)

1. Install via Kube cluster

2. Install via Helm prometheus and grafana

3. Install kube plugin on grafana

4. Configure datasource

5. Done.

If you have any additional questions please let me know and I will try to help you.

I have just one problem which related to Node Cluster data on dashboard.

Are you still using the plugin in your GKE cluster?

What steps did you follow to connect the plugin with your cluster?

I used prometheus-operator helm

Thank you very much

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants