Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Latest commit

 

History

History
59 lines (40 loc) · 3.01 KB

influxdb.md

File metadata and controls

59 lines (40 loc) · 3.01 KB

Run Heapster in a Kubernetes cluster with an InfluxDB backend and a Grafana UI

Warning: Virtual machines need to have at least 2 cores for InfluxDB to perform optimally.

Setup a Kubernetes cluster

Bring up a Kubernetes cluster, if you haven't already. Ensure that kubecfg.sh is exported.

Start all of the pods and services

$ kubectl.sh create -f deploy/kube-config/influxdb/

Grafana will be accessible at https://<masterIP>/api/v1beta3/proxy/namespaces/default/services/monitoring-grafana/. Use the master auth to access Grafana.

Production setup for InfluxDB and Grafana

By default, InfluxDB and Grafana are made accessible via a proxy on the Kubernetes apiserver, to make them accessible with minimal configurations on all Kubernetes deployments. This is not ideal for production deployments since the proxy will be a bottleneck. To use InfluxDB and Grafana in production, we recommend setting up an External Kubernetes Service.

Guide

  1. Remove the environment variable INFLUXDB_EXTERNAL_URL from InfluxDB Grafana RC config here. This option makes Grafana reach InfluxDB service via the apiserver proxy.

  2. Update Grafana service to either include a public IP or setup an external load balancer. In the Grafana service, set "createExternalLoadBalancer": true in the Grafana Service Spec or, set "PublicIPs": ["<Externally Accessible IP>"].

  3. Delete and recreate InfluxDB and Grafana RCs and services.

Troubleshooting guide

  1. If the Grafana service is not accessible, chances are it might not be running. Use kubectl.sh to verify that the heapster and influxdb & grafana pods are alive.

$ kubectl.sh get pods ```

```shell

$ kubectl.sh get services ```

  1. If the default Grafana dashboard doesn't show any graphs, check the Heapster logs with kubectl.sh log <heapster pod name>. Look for any errors related to accessing the Kubernetes master or the kubelet.

  2. To access the InfluxDB UI, you will have to open up the InfluxDB UI port (8083) on the nodes. You can do so by creating a firewall rule:

$ gcloud compute firewall-rules create monitoring-heapster --allow "tcp:8083" "tcp:8086" --target-tags=kubernetes-minion ```

Then, find out the IP address of the node where InfluxDB is running and point your web browser to `http://<nodeIP>:8083/`.

_Note: We are working on exposing the InfluxDB UI using the proxy service on the Kubernetes master._
  1. If you find InfluxDB to be using up a lot of CPU or memory, consider placing resource restrictions on the InfluxDB & Grafana pod. You can add cpu: <millicores> and memory: <bytes> in the Controller Spec and relaunch the controllers:

$ deploy/kube.sh restart ```