github.com/galamsiva2020/kubernetes-heapster-monitoring@v0.0.0-20210823134957-3c1baa7c1e70/docs/influxdb.md (about)

     1  # Run Heapster in a Kubernetes cluster with an InfluxDB backend and a Grafana UI
     2  
     3  ### Setup a Kubernetes cluster
     4  [Bring up a Kubernetes cluster](https://github.com/kubernetes/kubernetes), if you haven't already.
     5  Ensure that you are able to interact with the cluster via `kubectl` (this may be `kubectl.sh` if using
     6  the local-up-cluster in the Kubernetes repository).
     7  
     8  ### Start all of the pods and services
     9  
    10  In order to deploy Heapster and InfluxDB, you will need to create the Kubernetes resources
    11  described by the contents of [deploy/kube-config/influxdb](../deploy/kube-config/influxdb).
    12  
    13  If you're running a different architecture than amd64, you should correct the image architecture 
    14  for the `grafana-deployment.yaml` and the `influxdb-deployment.yaml`.
    15  
    16  Ensure that you have a valid checkout of Heapster and are in the root directory of
    17  the Heapster repository, and then run
    18  
    19  ```shell
    20  $ kubectl create -f deploy/kube-config/influxdb/
    21  $ kubectl create -f deploy/kube-config/rbac/heapster-rbac.yaml
    22  ```
    23  
    24  Grafana service by default requests for a LoadBalancer. If that is not available in your cluster, consider changing that to NodePort. Use the external IP assigned to the Grafana service,
    25  to access Grafana.
    26  The default user name and password is 'admin'.
    27  Once you login to Grafana, add a datasource that is InfluxDB. The URL for InfluxDB will be `http://INFLUXDB_HOST:INFLUXDB_PORT`. Database name is 'k8s'. Default user name and password is 'root'.
    28  Grafana documentation for InfluxDB [here](http://docs.grafana.org/datasources/influxdb/).
    29  
    30  Take a look at the [storage schema](storage-schema.md) to understand how metrics are stored in InfluxDB.
    31  
    32  Grafana is set up to auto-populate nodes and pods using templates.
    33  
    34  The Grafana web interface can also be accessed via the api-server proxy. The URL should be visible in `kubectl cluster-info` once the above resources are created.
    35  
    36  ## Troubleshooting guide
    37  
    38  See also the [debugging documentation](debugging.md).
    39  
    40  1. If the Grafana service is not accessible, it might not be running. Use `kubectl` to verify that the `heapster` and `influxdb & grafana` pods are alive.
    41      ```
    42      $ kubectl get pods --namespace=kube-system
    43      ...
    44      monitoring-grafana-927606581-0tmdx        1/1       Running   0          6d
    45      monitoring-influxdb-3276295126-joqo2      1/1       Running   0          15d
    46      ...
    47      
    48      $ kubectl get services --namespace=kube-system monitoring-grafana monitoring-influxdb
    49      ```
    50  
    51  1. If you find InfluxDB to be using up a lot of CPU or memory, consider placing resource restrictions on the `InfluxDB & Grafana` pods. You can add `cpu: <millicores>` and `memory: <bytes>` in the Controller Specs for [InfluxDB](../deploy/kube-config/influxdb/influxdb.yaml) and [Grafana](../deploy/kube-config/influxdb/grafana.yaml), and relaunch the controllers by running `kubectl apply -f deploy/kube-config/influxdb/` and deleting the old influxdb pods.