grafana

by joaquinito2051

Helm chartv3.3.8App 6.1.6

The leading tool for querying and visualizing time series and metrics.

About this chart

Grafana Helm Chart

  • Installs the web dashboarding system Grafana

TL;DR;

$ helm install <helm-repo>/grafana

$ helm install stable/grafana

Installing the Chart

To install the chart with the release name my-release:

$ helm install --name my-release <helm-repo>/grafana

$ helm install --name my-release stable/grafana

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

ParameterDescriptionDefault
replicasNumber of nodes1
deploymentStrategyDeployment strategyRollingUpdate
livenessProbeLiveness Probe settings{ "httpGet": { "path": "/api/health", "port": 3000 } "initialDelaySeconds": 60, "timeoutSeconds": 30, "failureThreshold": 10 }
readinessProbeRediness Probe settings{ "httpGet": { "path": "/api/health", "port": 3000 } }
securityContextDeployment securityContext{"runAsUser": 472, "fsGroup": 472}
priorityClassNameName of Priority Class to assign podsnil
image.repositoryImage repositorygrafana/grafana
image.tagImage tag. (Must be >= 5.0.0)6.1.6
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsImage pull secrets{}
service.typeKubernetes service typeClusterIP
service.portKubernetes port where service is exposed80
service.targetPortinternal service is port3000
service.annotationsService annotations{}
service.labelsCustom labels{}
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations{}
ingress.labelsCustom labels{}
ingress.pathIngress accepted path/
ingress.hostsIngress accepted hostnames[]
ingress.tlsIngress TLS configuration[]
resourcesCPU/Memory resource requests/limits{}
nodeSelectorNode labels for pod assignment{}
tolerationsToleration labels for pod assignment[]
affinityAffinity settings for pod assignment{}
extraInitContainersInit containers to add to the grafana pod{}
extraContainersSidecar containers to add to the grafana pod{}
persistence.enabledUse persistent volume to store datafalse
persistence.sizeSize of persistent volume claim10Gi
persistence.existingClaimUse an existing PVC to persist datanil
persistence.storageClassNameType of persistent volume claimnil
persistence.accessModesPersistence access modes[ReadWriteOnce]
persistence.subPathMount a sub dir of the persistent volumenil
initChownData.enabledIf false, don't reset data ownership at startuptrue
initChownData.image.repositoryinit-chown-data container image repositorybusybox
initChownData.image.taginit-chown-data container image taglatest
initChownData.image.pullPolicyinit-chown-data container image pull policyIfNotPresent
initChownData.resourcesinit-chown-data pod resource requests & limits{}
schedulerNameAlternate scheduler namenil
envExtra environment variables passed to pods{}
envFromSecretName of a Kubenretes secret (must be manually created in the same namespace) containing values to be added to the environment""
extraSecretMountsAdditional grafana server secret mounts[]
extraVolumeMountsAdditional grafana server volume mounts[]
extraConfigmapMountsAdditional grafana server configMap volume mounts[]
extraEmptyDirMountsAdditional grafana server emptyDir volume mounts[]
pluginsPlugins to be loaded along with Grafana[]
datasourcesConfigure grafana datasources (passed through tpl){}
notifiersConfigure grafana notifiers{}
dashboardProvidersConfigure grafana dashboard providers{}
dashboardsDashboards to import{}
dashboardsConfigMapsConfigMaps reference that contains dashboards{}
grafana.iniGrafana's primary configuration{}
ldap.existingSecretThe name of an existing secret containing the ldap.toml file, this must have the key ldap-toml.""
ldap.config Grafana's LDAP configuration""
annotationsDeployment annotations{}
podAnnotationsPod annotations{}
sidecar.imageSidecar imagekiwigrid/k8s-sidecar:0.0.16
sidecar.imagePullPolicySidecar image pull policyIfNotPresent
sidecar.resourcesSidecar resources{}
sidecar.dashboards.enabledEnabled the cluster wide search for dashboards and adds/updates/deletes them in grafanafalse
sidecar.skipTlsVerifySet to true to skip tls verification for kube api callsnil
sidecar.dashboards.labelLabel that config maps with dashboards should have to be addedgrafana_dashboard
sidecar.dashboards.folderFolder in the pod that should hold the collected dashboards (unless sidecar.dashboards.defaultFolderName is set). This path will be mounted./tmp/dashboards
sidecar.dashboards.defaultFolderNameThe default folder name, it will create a subfolder under the sidecar.dashboards.folder and put dashboards in there insteadnil
sidecar.dashboards.searchNamespaceIf specified, the sidecar will search for dashboard config-maps inside this namespace. Otherwise the namespace in which the sidecar is running will be used. It's also possible to specify ALL to search in all namespacesnil
sidecar.datasources.enabledEnabled the cluster wide search for datasources and adds/updates/deletes them in grafanafalse
sidecar.datasources.labelLabel that config maps with datasources should have to be addedgrafana_datasource
sidecar.datasources.searchNamespaceIf specified, the sidecar will search for datasources config-maps inside this namespace. Otherwise the namespace in which the sidecar is running will be used. It's also possible to specify ALL to search in all namespacesnil
smtp.existingSecretThe name of an existing secret containing the SMTP credentials.""
smtp.userKeyThe key in the existing SMTP secret containing the username."user"
smtp.passwordKeyThe key in the existing SMTP secret containing the password."password"
admin.existingSecretThe name of an existing secret containing the admin credentials.""
admin.userKeyThe key in the existing admin secret containing the username."admin-user"
admin.passwordKeyThe key in the existing admin secret containing the password."admin-password"
rbac.createCreate and use RBAC resourcestrue
rbac.namespacedCreates Role and Rolebinding instead of the default ClusterRole and ClusteRoleBindings for the grafana instancefalse
rbac.pspEnabledCreate PodSecurityPolicy (with rbac.create, grant roles permissions as well)true
rbac.pspUseAppArmorEnforce AppArmor in created PodSecurityPolicy (requires rbac.pspEnabled)true
commandDefine command to be executed by grafana container at startupnil
testFramework.imagetest-framework image repository.dduportal/bats
testFramework.tagtest-framework image tag.0.4.0

Example of extraVolumeMounts

- extraVolumeMounts:
  - name: plugins
    mountPath: /var/lib/grafana/plugins
    subPath: configs/grafana/plugins
    existingClaim: existing-grafana-claim
    readOnly: false

Import dashboards

There are a few methods to import dashboards to Grafana. Below are some examples and explanations as to how to use each method:

dashboards:
  default:
    some-dashboard:
      json: |
        {
          "annotations":

          ...
          # Complete json file he

Deploy grafana with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has grafana on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgrafana is pinned at v3.3.8 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply