Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 2.45 KB

File metadata and controls

60 lines (42 loc) · 2.45 KB

Grafana Configuration Guide

Using an existing Grafana deployment can be accomplished through one of two options:

  1. Linking to an external Grafana directly
  2. Deploying with Grafana sidecar enabled

Option 1: Directly link to an external Grafana

After installing Kubecost, select Settings from the left navigation and update Grafana Address to a URL that is visible to users accessing Grafana dashboards. This variable can alternatively be passed at the time you deploy Kubecost via the kubecostProductConfigs.grafanaURL parameter in values.yaml. Next, import Kubecost Grafana dashboards as JSON from this folder.

Grafana Address option

Option 2: Deploy with Grafana sidecar enabled

Passing the Grafana parameters below in your values.yaml will install ConfigMaps for Grafana dashboards that will be picked up by the Grafana sidecar if you have Grafana with the dashboard sidecar already installed.

{% code overflow="wrap" %}

global:
  grafana:
    enabled: false
    domainName: cost-analyzer-grafana.default #example where format is <service-name>.<namespace>
    proxy: false
grafana:
  sidecar:
    dashboards:
      enabled: true
    datasources:
      enabled: false

{% endcode %}

Ensure that the following flags are set in your Operator deployment:

  1. sidecar.dashboards.enabled=true
  2. sidecar.dashboards.searchNamespace isn't restrictive. Use ALL if Kubecost runs in another namespace.

{% hint style="warning" %} The Kubecost UI cannot link to the Grafana dashboards unless kubecostProductConfigs.grafanaURL is set, either via the Helm chart, or via the Settings page, as described in Option 1. {% endhint %}

When using Kubecost on a custom ingress path, you must add this path to the Grafana root_url:

{% code overflow="wrap" %}

--set grafana.grafana.ini.server.root_url: "%(protocol)s://%(domain)s:%(http_port)s/kubecost/grafana"

{% endcode %}

Disabling Grafana

If you choose to disable Grafana, set the following Helm values to ensure successful pod startup:

--set global.grafana.enabled=false
--set global.grafana.proxy=false