grafana

by book-k8sinfra

Helm chartv5.3.0App 7.0.3

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 repo add edu https://iac-source.github.io/helm-charts
$ helm repo update

Installing the Chart

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

$ 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.

Upgrading an existing Release to a new major version

A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.

To 4.0.0 (And 3.12.1)

This version requires Helm >= 2.12.0.

To 5.0.0

You have to add --force to your helm upgrade command as the labels of the chart have changed.

Configuration

ParameterDescriptionDefault
replicasNumber of nodes1
podDisruptionBudget.minAvailablePod disruption minimum availablenil
podDisruptionBudget.maxUnavailablePod disruption maximum unavailablenil
deploymentStrategyDeployment strategy{ "type": "RollingUpdate" }
livenessProbeLiveness Probe settings{ "httpGet": { "path": "/api/health", "port": 3000 } "initialDelaySeconds": 60, "timeoutSeconds": 30, "failureThreshold": 10 }
readinessProbeReadiness Probe settings{ "httpGet": { "path": "/api/health", "port": 3000 } }
securityContextDeployment securityContext{"runAsUser": 472, "runAsGroup": 472, "fsGroup": 472}
priorityClassNameName of Priority Class to assign podsnil
image.repositoryImage repositorygrafana/grafana
image.tagImage tag (Must be >= 5.0.0)7.0.3
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsImage pull secrets{}
service.typeKubernetes service typeClusterIP
service.portKubernetes port where service is exposed80
service.portNameName of the port on the serviceservice
service.targetPortInternal service is port3000
service.nodePortKubernetes service nodePortnil
service.annotationsService annotations{}
service.labelsCustom labels{}
service.clusterIPinternal cluster service IPnil
service.loadBalancerIPIP address to assign to load balancer (if supported)nil
service.loadBalancerSourceRangeslist of IP CIDRs allowed access to lb (if supported)[]
service.externalIPsservice external IP addresses[]
extraExposePortsAdditional service ports for sidecar containers[]
ingress.enabledEnables Ingressfalse
ingress.annotationsIngress annotations (values are templated){}
ingress.labelsCustom labels{}
ingress.pathIngress accepted path/
ingress.hostsIngress accepted hostnames["chart-example.local"]
ingress.extraPathsIngress extra paths to prepend to every host configuration. Useful when configuring custom actions with AWS ALB Ingress Controller.[]
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{}
extraContainerVolumesVolumes that can be mounted in sidecar containers[]
schedulerNameName of the k8s scheduler (other than default)nil
persistence.enabledUse persistent volume to store datafalse
persistence.typeType of persistence (pvc or statefulset)pvc
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.annotationsPersistentVolumeClaim annotations{}
persistence.finalizersPersistentVolumeClaim finalizers[ "kubernetes.io/pvc-protection" ]
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{}
envValueFromEnvironment variables from alternate sources. See the API docs on EnvVarSource for format details.{}
envFromSecretName of a Kubernetes secret (must be manually created in the same namespace) containing values to be added to the environment. Can be templated""
envRenderSecretSensible environment variables passed to pods and stored as secret{}
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.enabledEnable LDAP authenticationfalse
ldap.existingSecretThe name of an existing secret containing the ldap.toml file, this must have the key ldap-toml.""
ldap.configGrafana's LDAP configuration""
annotationsDeployment annotations{}
labelsDeployment labels{}
podAnnotationsPod annotations{}
podLabelsPod labels{}
podPortNameName of the grafana port on the podgrafana
sidecar.image.repositorySidecar image repositorykiwigrid/k8s-sidecar
sidecar.image.tagSidecar image tag0.1.151
sidecar.imagePullPolicySidecar image pull policyIfNotPresent
sidecar.resourcesSidecar resources{}
`sidecar.dash

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 v5.3.0 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