mirror of
https://github.com/bitnami/charts.git
synced 2026-08-10 14:15:55 +08:00
Add Grafana Helm Chart
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
name: grafana
|
||||
version: 0.1.0
|
||||
appVersion: "6.3.3"
|
||||
description: Grafana is an open source metric analytics and visualization suite.
|
||||
keywords:
|
||||
- analitics
|
||||
- monitoring
|
||||
- metrics
|
||||
- logs
|
||||
home: https://grafana.com/
|
||||
maintainers:
|
||||
- name: Bitnami
|
||||
email: containers@bitnami.com
|
||||
engine: gotpl
|
||||
icon: https://grafana.com/static/assets/img/grafana_logo.svg
|
||||
@@ -0,0 +1,180 @@
|
||||
# Grafana
|
||||
|
||||
[Grafana](https://grafana.com/) is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
|
||||
|
||||
## TL;DR;
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install bitnami/grafana
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [grafana](https://github.com/bitnami/bitnami-docker-grafana) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters.
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install --name my-release bitnami/grafana
|
||||
```
|
||||
|
||||
These commands deploy grafana on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` statefulset:
|
||||
|
||||
```console
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release. Use the option `--purge` to delete all persistent volumes too.
|
||||
|
||||
## Configuration
|
||||
|
||||
The following tables lists the configurable parameters of the grafana chart and their default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
| ------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
|
||||
| `global.imageRegistry` | Global Docker image registry | `nil` |
|
||||
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `image.registry` | Grafana image registry | `docker.io` |
|
||||
| `image.repository` | Grafana Image name | `bitnami/grafana` |
|
||||
| `image.tag` | Grafana Image tag | `{TAG_NAME}` |
|
||||
| `image.pullPolicy` | Grafana image pull policy | `IfNotPresent` |
|
||||
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `nameOverride` | String to partially override grafana.fullname template with a string (will prepend the release name) | `nil` |
|
||||
| `fullnameOverride` | String to fully override grafana.fullname template with a string | `nil` |
|
||||
|`replicaCount` | Number of replicas of the Grafana Pod | `1` |
|
||||
| `updateStrategy.type` | Update strategy for deployment | `RollingUpdate` |
|
||||
| `schedulerName` | Alternative scheduler | `nil` |
|
||||
| `admin.user` | Grafana admin username | `admin` |
|
||||
| `admin.password` | Grafana admin password | Randomly generated |
|
||||
| `smtp.enabled` | Enable SMTP configuration | `false` |
|
||||
| `smtp.existingSecret` | Secret with SMTP credentials | `nil` |
|
||||
| `smtp.existingSecretUserKey` | Key which value is the SMTP user in the SMTP secret | `user` |
|
||||
| `smtp.existingSecretPasswordKey` | Key which values is the SMTP password in the SMTP secret | `password` |
|
||||
| `plugins` | Grafana plugins to be installed in deployment time separated by commas | `nil` |
|
||||
| `ldap.enabled` | Enable LDAP for Grafana | `false` |
|
||||
| `ldap.allowSignUp` | Allows LDAP sign up for Grafana | `false` |
|
||||
| `ldap.configMapName` | Name of the ConfigMap with the LDAP configuration file for Grafana | `nil` |
|
||||
| `extraEnvVars` | Array containing extra env vars to configure Grafana | `nil` |
|
||||
| `extraConfigmaps` | Array to mount extra ConfigMaps to configure Grafana | `nil` |
|
||||
| `config.useGrafanaIniFile` | Allows to load a `grafana.ini` file | `false` |
|
||||
| `config.grafanaIniConfigMap` | Name of the ConfigMap containing the `grafana.ini` file | `nil` |
|
||||
| `config.useCustomIniFile` | Allows to load a `custom.ini` file | `false` |
|
||||
| `config.customIniConfigMap` | Name of the ConfigMap containing the `custom.ini` file | `nil` |
|
||||
| `dashboardsProvider.enabled` | Enable the use of a Grafana dashboard provider | `false` |
|
||||
| `dashboardsProvider.configMapName` | Name of a ConfigMap containing a custom dashboard provider | `nil` |
|
||||
| `dashboardsConfigMaps` | Array with the names of a series of ConfigMaps containing dashboards files | `nil` |
|
||||
| `datasources.secretName` | Secret name containing custom datasource files | `nil` |
|
||||
| `persistence.enabled` | Enable persistence | `true` |
|
||||
| `presistence.storageClass` | Storage class to use with the PVC | `nil` |
|
||||
| `persistence.accessMode` | Access mode to the PV | `ReadWriteOnce` |
|
||||
| `persistence.size` | Size for the PV | `10Gi` |
|
||||
| `livenessProbe.enabled` | Enable/disable the Liveness probe | `true` |
|
||||
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `60` |
|
||||
| `livenessProbe.periodSeconds` | How often to perform the probe | `10` |
|
||||
| `livenessProbe.timeoutSeconds` | When the probe times out | `5` |
|
||||
| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed.| `1` |
|
||||
| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
|
||||
| `readinessProbe.enabled` | Enable/disable the Readiness probe | `true` |
|
||||
| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` |
|
||||
| `readinessProbe.periodSeconds` | How often to perform the probe | `10` |
|
||||
| `readinessProbe.timeoutSeconds` | When the probe times out | `5` |
|
||||
| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `6` |
|
||||
| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed.| `1` |
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.webPort` | Grafana client port | `80` |
|
||||
| `service.clusterPort` | Grafana cluster port | `7077` |
|
||||
| `service.nodePort` | Port to bind to for NodePort service type (client port) | `nil` |
|
||||
| `service.annotations` | Annotations for Grafana service | `{}` |
|
||||
| `service.loadBalancerIP` | loadBalancerIP if Grafana service type is `LoadBalancer` | `nil` |
|
||||
| `ingress.enabled` | Enable the use of the ingress controller to access the web UI | `false` |
|
||||
| `ingress.annotations` | Annotations for the Grafana Ingress | `{}` |
|
||||
| `ingress.hosts` | Add hosts to the ingress controller with name and path | `name: grafana.local`, `path: /` |
|
||||
| `ingress.tls` | Configure TLS for the Grafana Ingress | `[]` |
|
||||
| `securityContext.enabled` | Enable securityContext on for Granafa deployment | `true` |
|
||||
| `securityContext.runAsUser` | User for the security context | `1001` |
|
||||
| `securityContext.fsGroup` | Group to configure permissions for volumes | `1001` |
|
||||
| `securityContext.runAsNonRoot` | Run containers as non-root users | `true` |
|
||||
| `resources` | Configure resource requests and limits | `nil` |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` |
|
||||
| `affinity` | Affinity for pod assignment | `{}` |
|
||||
| `podAnnotations` | Pod annotations | `{}` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```console
|
||||
$ helm install --name my-release \
|
||||
--set admin.user=admin-user bitnami/grafana
|
||||
```
|
||||
|
||||
The above command sets the Grafana admin user to `admin-user`.
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```console
|
||||
$ helm install --name my-release -f values.yaml bitnami/grafana
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
### Using custom configuration
|
||||
|
||||
Grafana support multiples configuration files. Using kubernetes you can mount a file using a ConfigMap. For example, to mount a custom `grafana.ini` file or `custom.ini` file you can create a ConfigMap like the following:
|
||||
|
||||
```
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: myconfig
|
||||
data:
|
||||
grafana.ini: |-
|
||||
# Raw text of the file
|
||||
```
|
||||
|
||||
And now you need to pass the ConfigMap name, to the corresponding parameter:
|
||||
|
||||
```
|
||||
$ helm install bitnami/grafana --set config.useGrafanaIniFile=true,config.grafanaIniConfigMap=myconfig
|
||||
```
|
||||
|
||||
To provide dashboards on deployment time, Grafana needs a dashboards provider and the dashboards themselves. A default provider is created if enabled, or you can mount your own provider using a ConfigMap, but have in mind that the path to the dashboard folder must be `/opt/bitnami/grafana/dashboards`.
|
||||
To create a dashboard, it is needed to have a datasource for it. The datasources must be created mounting a secret with all the datasource files in it. In this case, it is not a ConfigMap because the datasource could contain sensitive information.
|
||||
To load the dashboards themselves you need to create a ConfigMap for each one containing the `json` file that defines the dashboard and set the array with the ConfigMap names into the `dashboardsConfigMaps` parameter.
|
||||
Note the difference between the datasources and the dashboards creation. For the datasources we can use just one secret with all of the files, while for the dashboards we need one ConfigMap per file.
|
||||
For example, after the creation of the dashboard and datasource ConfigMap in the same way that the explained for the `grafana.ini` file, execute the following to deploy Grafana with custom dashboards:
|
||||
|
||||
```
|
||||
$ helm install bitnami/grafana --set "dashboardsProvider.enabled=true,datasources.secretName=datasource-secret,dashboardsConfigMaps[0]=mydashboard"
|
||||
```
|
||||
|
||||
### Production configuration
|
||||
|
||||
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`.
|
||||
|
||||
```console
|
||||
$ helm install --name my-release -f ./values-production.yaml bitnami/grafana
|
||||
```
|
||||
|
||||
- Enable ingress controller
|
||||
```diff
|
||||
- ingress.enabled: false
|
||||
+ ingress.enabled: true
|
||||
```
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
@@ -0,0 +1,402 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: mydashboard
|
||||
data:
|
||||
dashboard.json: |-
|
||||
{
|
||||
"__inputs": [
|
||||
{
|
||||
"name": "DS_GRAPHITE",
|
||||
"label": "graphite",
|
||||
"description": "",
|
||||
"type": "datasource",
|
||||
"pluginId": "graphite",
|
||||
"pluginName": "Graphite"
|
||||
}
|
||||
],
|
||||
"__requires": [
|
||||
{
|
||||
"type": "panel",
|
||||
"id": "graph",
|
||||
"name": "Graph",
|
||||
"version": ""
|
||||
},
|
||||
{
|
||||
"type": "grafana",
|
||||
"id": "grafana",
|
||||
"name": "Grafana",
|
||||
"version": "3.1.0-beta1"
|
||||
},
|
||||
{
|
||||
"type": "datasource",
|
||||
"id": "graphite",
|
||||
"name": "Graphite",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
],
|
||||
"id": null,
|
||||
"title": "Graphite Carbon Metrics",
|
||||
"tags": [
|
||||
"graphite",
|
||||
"carbon"
|
||||
],
|
||||
"style": "dark",
|
||||
"timezone": "utc",
|
||||
"editable": true,
|
||||
"hideControls": false,
|
||||
"sharedCrosshair": false,
|
||||
"rows": [
|
||||
{
|
||||
"collapsable": true,
|
||||
"collapse": false,
|
||||
"editable": true,
|
||||
"height": 327.625,
|
||||
"notice": false,
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": {},
|
||||
"annotate": {
|
||||
"enable": false
|
||||
},
|
||||
"bars": false,
|
||||
"datasource": "${DS_GRAPHITE}",
|
||||
"editable": true,
|
||||
"fill": 0,
|
||||
"grid": {
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"threshold1": null,
|
||||
"threshold1Color": "rgba(216, 200, 27, 0.27)",
|
||||
"threshold2": null,
|
||||
"threshold2Color": "rgba(234, 112, 112, 0.22)"
|
||||
},
|
||||
"id": 1,
|
||||
"legend": {
|
||||
"avg": true,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": true,
|
||||
"alignAsTable": true,
|
||||
"rightSide": true
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"loadingEditor": false,
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"resolution": 100,
|
||||
"scale": 1,
|
||||
"seriesOverrides": [
|
||||
{
|
||||
"alias": "Points Per Update",
|
||||
"yaxis": 2
|
||||
},
|
||||
{
|
||||
"alias": "CPU",
|
||||
"yaxis": 2
|
||||
}
|
||||
],
|
||||
"span": 12,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"target": "alias(sumSeries(carbon.agents.*.updateOperations),\"Updates\") "
|
||||
},
|
||||
{
|
||||
"refId": "B",
|
||||
"target": "alias(sumSeries(carbon.agents.*.metricsReceived),'Metrics Received')"
|
||||
},
|
||||
{
|
||||
"refId": "C",
|
||||
"target": "alias(sumSeries(carbon.agents.*.committedPoints),'Committed Points')"
|
||||
},
|
||||
{
|
||||
"refId": "F",
|
||||
"target": "alias(sumSeries(carbon.agents.*.creates),'Creates')"
|
||||
}
|
||||
],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Carbon Ops",
|
||||
"tooltip": {
|
||||
"msResolution": false,
|
||||
"query_as_alias": true,
|
||||
"shared": false,
|
||||
"sort": 0,
|
||||
"value_type": "cumulative"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"show": true
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"zerofill": true,
|
||||
"links": []
|
||||
}
|
||||
],
|
||||
"title": "Row1"
|
||||
},
|
||||
{
|
||||
"title": "New row",
|
||||
"height": 414.4375,
|
||||
"editable": true,
|
||||
"collapse": false,
|
||||
"panels": [
|
||||
{
|
||||
"aliasColors": {
|
||||
"CPU": "#E24D42"
|
||||
},
|
||||
"annotate": {
|
||||
"enable": false
|
||||
},
|
||||
"bars": false,
|
||||
"datasource": "${DS_GRAPHITE}",
|
||||
"editable": true,
|
||||
"fill": 2,
|
||||
"grid": {
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"threshold1": null,
|
||||
"threshold1Color": "rgba(216, 200, 27, 0.27)",
|
||||
"threshold2": null,
|
||||
"threshold2Color": "rgba(234, 112, 112, 0.22)"
|
||||
},
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"loadingEditor": false,
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"resolution": 100,
|
||||
"scale": 1,
|
||||
"seriesOverrides": [
|
||||
{
|
||||
"alias": "Points Per Update",
|
||||
"yaxis": 2
|
||||
},
|
||||
{
|
||||
"alias": "CPU",
|
||||
"yaxis": 1
|
||||
}
|
||||
],
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"refId": "E",
|
||||
"target": "alias(averageSeries(carbon.agents.*.cpuUsage),'CPU')"
|
||||
}
|
||||
],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "CPU Usage",
|
||||
"tooltip": {
|
||||
"msResolution": false,
|
||||
"query_as_alias": true,
|
||||
"shared": false,
|
||||
"sort": 0,
|
||||
"value_type": "cumulative"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"show": true
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "percent",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
],
|
||||
"zerofill": true,
|
||||
"links": []
|
||||
},
|
||||
{
|
||||
"aliasColors": {
|
||||
"CPU": "#E24D42"
|
||||
},
|
||||
"annotate": {
|
||||
"enable": false
|
||||
},
|
||||
"bars": false,
|
||||
"datasource": "${DS_GRAPHITE}",
|
||||
"editable": true,
|
||||
"fill": 2,
|
||||
"grid": {
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"threshold1": null,
|
||||
"threshold1Color": "rgba(216, 200, 27, 0.27)",
|
||||
"threshold2": null,
|
||||
"threshold2Color": "rgba(234, 112, 112, 0.22)"
|
||||
},
|
||||
"id": 3,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": false,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"loadingEditor": false,
|
||||
"nullPointMode": "null as zero",
|
||||
"percentage": false,
|
||||
"pointradius": 5,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"resolution": 100,
|
||||
"scale": 1,
|
||||
"seriesOverrides": [
|
||||
{
|
||||
"alias": "Points Per Update",
|
||||
"yaxis": 1
|
||||
},
|
||||
{
|
||||
"alias": "CPU",
|
||||
"yaxis": 1
|
||||
}
|
||||
],
|
||||
"span": 6,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"refId": "E",
|
||||
"target": "alias(averageSeries(carbon.agents.*.pointsPerUpdate), 'Points Per Update')"
|
||||
}
|
||||
],
|
||||
"timeFrom": null,
|
||||
"timeShift": null,
|
||||
"title": "Points Per Update",
|
||||
"tooltip": {
|
||||
"msResolution": false,
|
||||
"query_as_alias": true,
|
||||
"shared": false,
|
||||
"sort": 0,
|
||||
"value_type": "cumulative"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"show": true
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": 0,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": false
|
||||
}
|
||||
],
|
||||
"zerofill": true,
|
||||
"links": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"time": {
|
||||
"from": "now-1h",
|
||||
"to": "now"
|
||||
},
|
||||
"timepicker": {
|
||||
"collapse": false,
|
||||
"enable": true,
|
||||
"notice": false,
|
||||
"now": true,
|
||||
"refresh_intervals": [
|
||||
"5s",
|
||||
"10s",
|
||||
"30s",
|
||||
"1m",
|
||||
"5m",
|
||||
"15m",
|
||||
"30m",
|
||||
"1h",
|
||||
"2h",
|
||||
"1d"
|
||||
],
|
||||
"status": "Stable",
|
||||
"time_options": [
|
||||
"5m",
|
||||
"15m",
|
||||
"1h",
|
||||
"6h",
|
||||
"12h",
|
||||
"24h",
|
||||
"2d",
|
||||
"7d",
|
||||
"30d"
|
||||
],
|
||||
"type": "timepicker"
|
||||
},
|
||||
"templating": {
|
||||
"enable": false,
|
||||
"list": []
|
||||
},
|
||||
"annotations": {
|
||||
"enable": false,
|
||||
"list": []
|
||||
},
|
||||
"refresh": false,
|
||||
"schemaVersion": 12,
|
||||
"version": 7,
|
||||
"links": [],
|
||||
"gnetId": 43
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: datasource-secret
|
||||
type: Opaque
|
||||
stringData:
|
||||
datasource.yaml: |-
|
||||
# config file version
|
||||
apiVersion: 1
|
||||
|
||||
# list of datasources that should be deleted from the database
|
||||
deleteDatasources:
|
||||
- name: Graphite
|
||||
orgId: 1
|
||||
|
||||
# list of datasources to insert/update depending
|
||||
# whats available in the database
|
||||
datasources:
|
||||
# <string, required> name of the datasource. Required
|
||||
- name: Graphite
|
||||
# <string, required> datasource type. Required
|
||||
type: graphite
|
||||
# <string, required> access mode. proxy or direct (Server or Browser in the UI). Required
|
||||
access: proxy
|
||||
# <int> org id. will default to orgId 1 if not specified
|
||||
orgId: 1
|
||||
# <string> url
|
||||
url: http://10.30.246.155:80
|
||||
# <string> database password, if used
|
||||
password:
|
||||
# <string> database user, if used
|
||||
user:
|
||||
# <string> database name, if used
|
||||
database:
|
||||
# <bool> enable/disable basic auth
|
||||
basicAuth:
|
||||
# <string> basic auth username
|
||||
basicAuthUser:
|
||||
# <string> basic auth password
|
||||
basicAuthPassword:
|
||||
# <bool> enable/disable with credentials headers
|
||||
withCredentials:
|
||||
# <bool> mark as default datasource. Max one per org
|
||||
isDefault:
|
||||
# <map> fields that will be converted to json and stored in json_data
|
||||
jsonData:
|
||||
graphiteVersion: "1.1"
|
||||
tlsAuth: true
|
||||
tlsAuthWithCACert: true
|
||||
# <string> json object of data that will be encrypted.
|
||||
secureJsonData:
|
||||
tlsCACert: "..."
|
||||
tlsClientCert: "..."
|
||||
tlsClientKey: "..."
|
||||
version: 1
|
||||
# <bool> allow users to edit datasources from the UI.
|
||||
editable: false
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: ldap
|
||||
data:
|
||||
ldap.toml: |-
|
||||
[[servers]]
|
||||
host = "127.0.0.1"
|
||||
port = 389
|
||||
use_ssl = false
|
||||
start_tls = false
|
||||
ssl_skip_verify = false
|
||||
bind_dn = "cn=admin,dc=grafana,dc=org"
|
||||
bind_password = 'grafana'
|
||||
search_filter = "(cn=%s)"
|
||||
search_base_dns = ["dc=grafana,dc=org"]
|
||||
|
||||
[servers.attributes]
|
||||
name = "givenName"
|
||||
surname = "sn"
|
||||
username = "cn"
|
||||
member_of = "memberOf"
|
||||
email = "email"
|
||||
@@ -0,0 +1,24 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "grafana.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "grafana.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "grafana.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "grafana.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl port-forward $POD_NAME 8080:80
|
||||
{{- end }}
|
||||
|
||||
2. Get the admin password:
|
||||
echo Password: $(kubectl get secret {{ include "grafana.fullname" . }}-secret -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 --decode)
|
||||
@@ -0,0 +1,96 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "grafana.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "grafana.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "grafana.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "grafana.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "grafana.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: "{{ include "grafana.fullname" . }}-envvars"
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
data:
|
||||
GF_SECURITY_ADMIN_USER: {{ .Values.admin.user | quote }}
|
||||
{{- if .Values.plugins }}
|
||||
GF_INSTALL_PLUGINS: {{ .Values.plugins | quote }}
|
||||
{{- end }}
|
||||
GF_PATHS_PLUGINS: "/opt/bitnami/grafana/data/plugins"
|
||||
GF_AUTH_LDAP_ENABLED: {{ .Values.ldap.enabled | quote }}
|
||||
GF_AUTH_LDAP_CONFIG_FILE: "/opt/bitnami/grafana/conf/ldap.toml"
|
||||
GF_AUTH_LDAP_ALLOW_SIGN_UP: {{ .Values.ldap.allowSignUp | quote }}
|
||||
GF_PATHS_PROVISIONING: "/opt/bitnami/grafana/conf/provisioning"
|
||||
GF_PATHS_CONFIG: "/opt/bitnami/grafana/conf/grafana.ini"
|
||||
GF_PATHS_DATA: "/opt/bitnami/grafana/data"
|
||||
GF_PATHS_LOGS: "/opt/bitnami/grafana/logs"
|
||||
GF_PATHS_PLUGINS: "/opt/bitnami/grafana/data/plugins"
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- if .Values.dashboardsProvider.enabled }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "grafana.fullname" . }}-provider
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
data:
|
||||
default-provider.yaml: |-
|
||||
apiVersion: 1
|
||||
|
||||
providers:
|
||||
# <string> an unique provider name
|
||||
- name: 'default-provider'
|
||||
# <int> org id. will default to orgId 1 if not specified
|
||||
orgId: 1
|
||||
# <string, required> name of the dashboard folder. Required
|
||||
folder: dashboards
|
||||
# <string> folder UID. will be automatically generated if not specified
|
||||
folderUid: ''
|
||||
# <string, required> provider type. Required
|
||||
type: file
|
||||
# <bool> disable dashboard deletion
|
||||
disableDeletion: false
|
||||
# <bool> enable dashboard editing
|
||||
editable: true
|
||||
# <int> how often Grafana will scan for changed dashboards
|
||||
updateIntervalSeconds: 10
|
||||
options:
|
||||
# <string, required> path to dashboard files on disk. Required
|
||||
path: /opt/bitnami/grafana/dashboards
|
||||
{{- end }}
|
||||
@@ -0,0 +1,172 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "grafana.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- if .Values.updateStrategy }}
|
||||
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
checksum/dashboard-provider: {{ include (print $.Template.BasePath "/dashboard-provider.yaml") . | sha256sum }}
|
||||
{{ toYaml .Values.podAnnotations | indent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: "{{ .Values.schedulerName }}"
|
||||
{{- end }}
|
||||
{{- include "grafana.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: "{{ include "grafana.fullname" . }}-envvars"
|
||||
- secretRef:
|
||||
name: "{{ include "grafana.fullname" . }}-secret"
|
||||
{{- if .Values.smtp.existingSecret }}
|
||||
- name: GF_SMTP_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.smtp.existingSecret }}
|
||||
key: {{ .Values.smtp.existingSecretUserKey | default "user" }}
|
||||
- name: GF_SMTP_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.smtp.existingSecret }}
|
||||
key: {{ .Values.smtp.existingSecretPasswordKey | default "password" }}
|
||||
{{- end }}
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{ toYaml .Values.extraEnvVars | indent 8 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if .Values.config.useGrafanaIniFile }}
|
||||
- name: grafana-ini
|
||||
mountPath: /opt/bitnami/grafana/conf/grafana.ini
|
||||
subPath: grafana.ini
|
||||
{{- end }}
|
||||
{{- if .Values.config.useCustomIniFile }}
|
||||
- name: custom-ini
|
||||
mountPath: /opt/bitnami/grafana/conf/custom.ini
|
||||
subPath: custom.ini
|
||||
{{- end }}
|
||||
- name: data
|
||||
mountPath: /opt/bitnami/grafana/data
|
||||
{{- if .Values.dashboardsProvider.enabled }}
|
||||
- name: dashboards-provider
|
||||
mountPath: /opt/bitnami/grafana/conf/provisioning/dashboards
|
||||
{{- end }}
|
||||
{{- range .Values.dashboardsConfigMaps }}
|
||||
- name: {{ . }}
|
||||
mountPath: /opt/bitnami/grafana/dashboards
|
||||
{{- end }}
|
||||
{{- if .Values.datasources.secretName }}
|
||||
- name: datasources
|
||||
mountPath: /opt/bitnami/grafana/conf/provisioning/datasources
|
||||
{{- end }}
|
||||
{{- if and .Values.ldap.enabled .Values.ldap.configMapName }}
|
||||
- name: ldap
|
||||
mountPath: /opt/bitnami/grafana/conf/ldap.toml
|
||||
subPath: ldap.toml
|
||||
{{- end }}
|
||||
{{- range .Values.extraConfigmaps }}
|
||||
- name: {{ .name }}
|
||||
mountPath: {{ .mountPath }}
|
||||
subPath: {{ .subPath | default "" }}
|
||||
readOnly: {{ .readOnly }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: dashboard
|
||||
containerPort: 3000
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: dashboard
|
||||
{{ toYaml .Values.livenessProbe | indent 10 }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: dashboard
|
||||
{{ toYaml .Values.readinessProbe | indent 10 }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 10 }}
|
||||
volumes:
|
||||
- name: data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "grafana.fullname" .) }}
|
||||
{{- end }}
|
||||
{{- if and .Values.ldap.enabled .Values.ldap.configMapName }}
|
||||
- name: ldap
|
||||
configMap:
|
||||
name: {{ .Values.ldap.configMapName }}
|
||||
{{- end }}
|
||||
{{- if .Values.dashboardsProvider.enabled }}
|
||||
- name: dashboards-provider
|
||||
configMap:
|
||||
{{- if .Values.dashboardsProvider.configMapName }}
|
||||
name: {{ .Values.dashboardsProvider.configMapName }}
|
||||
{{- else }}
|
||||
name: {{ include "grafana.fullname" . }}-provider
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range .Values.dashboardsConfigMaps }}
|
||||
- name: {{ . }}
|
||||
configMap:
|
||||
name: {{ . }}
|
||||
{{- end }}
|
||||
{{- if .Values.datasources.secretName }}
|
||||
- name: datasources
|
||||
secret:
|
||||
secretName: {{ .Values.datasources.secretName }}
|
||||
{{- end }}
|
||||
{{- if .Values.config.useGrafanaIniFile }}
|
||||
- name: grafana-ini
|
||||
configMap:
|
||||
name: {{ required "A configmap containing the grafana.ini file is needed!!" .Values.config.grafanaIniConfigMap }}
|
||||
{{- end }}
|
||||
{{- if .Values.config.useCustomIniFile }}
|
||||
- name: custom-ini
|
||||
configMap:
|
||||
name: {{ required "A configmap containing the custom.ini file is needed!!" .Values.config.customIniConfigMap }}
|
||||
{{- end }}
|
||||
{{- range .Values.extraConfigmaps }}
|
||||
- name: {{ .name }}
|
||||
configMap:
|
||||
name: {{ .name }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | indent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,38 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "grafana.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
backend:
|
||||
serviceName: {{ include "grafana.fullname" $ }}
|
||||
servicePort: http
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{ include "grafana.storageClass" . }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "grafana.fullname" . }}-secret
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if .Values.admin.password }}
|
||||
GF_SECURITY_ADMIN_PASSWORD: {{ .Values.admin.password }}
|
||||
{{- else }}
|
||||
GF_SECURITY_ADMIN_PASSWORD: {{ randAlphaNum 10 | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if and .Values.smtp.enabled (not .Values.smtp.existingSecret) }}
|
||||
{{- if and .Values.smtp.user .Values.smtp.password }}
|
||||
GF_SMTP_USER: {{ .Values.smtp.user }}
|
||||
GF_SMTP_PASSWORD: {{ .Values.smtp.password }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,28 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "grafana.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- if .Values.service.annotations }}
|
||||
annotations: {{ toYaml .Values.service.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
{{- if .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort }}
|
||||
{{- end }}
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
@@ -0,0 +1,18 @@
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "grafana.fullname" . }}-test-connection"
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "grafana.name" . }}
|
||||
helm.sh/chart: {{ include "grafana.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
annotations:
|
||||
"helm.sh/hook": test-success
|
||||
spec:
|
||||
containers:
|
||||
- name: wget
|
||||
image: busybox
|
||||
command: ['wget']
|
||||
args: ['{{ include "grafana.fullname" . }}:{{ .Values.service.port }}']
|
||||
restartPolicy: Never
|
||||
@@ -0,0 +1,241 @@
|
||||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Grafana image version
|
||||
## ref: https://hub.docker.com/r/bitnami/grafana/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/grafana
|
||||
tag: 6.3.3-debian-9-r12
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## Optionally specify an array of imagePullSecrets.
|
||||
## Secrets must be manually created in the namespace.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||
##
|
||||
# pullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
|
||||
## String to partially override grafana.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override grafana.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
## Set up update strategy for Grafana installation. Set to Recreate if you use persistent volume that cannot be mounted by more than one pods to makesure the pods is destroyed first.
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
|
||||
## Example:
|
||||
## updateStrategy:
|
||||
## type: RollingUpdate
|
||||
## rollingUpdate:
|
||||
## maxSurge: 25%
|
||||
## maxUnavailable: 25%
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
|
||||
## Use an alternate scheduler, e.g. "stork".
|
||||
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName:
|
||||
|
||||
## Admin access configuration
|
||||
## If a password is not provided a random password will be generated
|
||||
#
|
||||
admin:
|
||||
user: "admin"
|
||||
# password:
|
||||
|
||||
## SMTP configuration
|
||||
## Use either a secret container the credentials or set the credentials through command line.
|
||||
smtp:
|
||||
enabled: false
|
||||
# Provide credentials by command line
|
||||
user: user
|
||||
password: password
|
||||
## Existing secret with SMTP credentials (user and password)
|
||||
# existingSecret:
|
||||
## User and password key on the existing secret ( "user" and "password" by default )
|
||||
# existingSecretUserKey:
|
||||
# existingSecretPasswordKey:
|
||||
|
||||
## Grafana plugins that will be installed
|
||||
## Specify plugins as a list separated by commas ( you will need to scape them when specifying from command line )
|
||||
## Example:
|
||||
## plugins=grafana-kubernetes-app,grafana-example-app
|
||||
#
|
||||
# plugins:
|
||||
|
||||
ldap:
|
||||
enabled: false
|
||||
allowSignUp: false
|
||||
## configMap with LDAP configuration file (ldap.toml)
|
||||
# configMapName:
|
||||
|
||||
## An array to add extra env vars
|
||||
## For example:
|
||||
## extraEnvVars:
|
||||
## - name: GF_DEFAULT_INSTANCE_NAME
|
||||
## value: my-instance
|
||||
#
|
||||
# extraEnvVars:
|
||||
|
||||
## An array to add extra configmaps:
|
||||
## For example:
|
||||
## extraConfigmaps:
|
||||
## - name: myconfigmap
|
||||
## mountPath: /opt/bitnami/desired-path
|
||||
## subPath: file-name.extension (optional)
|
||||
## readOnly: true
|
||||
|
||||
## Parameters to override the default grafana.ini and custom.ini files.
|
||||
## It is needed to create a configmap containing the grafana.ini and custom.ini files.
|
||||
config:
|
||||
useGrafanaIniFile: false
|
||||
grafanaIniConfigMap:
|
||||
useCustomIniFile: false
|
||||
customIniConfigMap:
|
||||
|
||||
## Create dasboard provider to load dashboards, a default one is created to load
|
||||
## dashboards from "/opt/bitnami/grafana/dashboards"
|
||||
dashboardsProvider:
|
||||
enabled: false
|
||||
## ConfigMap with a custom provider file.
|
||||
## Important to set the Path to "/opt/bitnami/grafana/dashboards"
|
||||
configMapName:
|
||||
|
||||
## Create dashboards from a custom configMap that contains the file.
|
||||
## They will be mounted by the default dashboard provider if it is enabled
|
||||
## Use an array with the configMap names.
|
||||
## Example:
|
||||
## dashboardsConfigMaps:
|
||||
## - mydashboard
|
||||
## - myotherdashboard
|
||||
dashboardsConfigMaps: []
|
||||
|
||||
## Create datasources from a custom secret
|
||||
## The secret must contain the files
|
||||
datasources:
|
||||
secretName:
|
||||
|
||||
## Enable persistence using Persistent Volume Claims
|
||||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## wordpress data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
# storageClass: "-"
|
||||
##
|
||||
## If you want to reuse an existing claim, you can pass the name of the PVC using
|
||||
## the existingClaim variable
|
||||
# existingClaim: your-claim
|
||||
accessMode: ReadWriteOnce
|
||||
size: 10Gi
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 120
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
|
||||
# Service configuration
|
||||
service:
|
||||
port: 3000
|
||||
type: ClusterIP
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
# nodePort:
|
||||
|
||||
## Provide any additional annotations which may be required. This can be used to
|
||||
## set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## loadBalancerIP for the PrestaShop Service (optional, cloud specific)
|
||||
## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
|
||||
# Ingress configuration
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: grafana.local
|
||||
paths: ["/"]
|
||||
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
# SecurityContext configuration
|
||||
|
||||
securityContext:
|
||||
enabled: true
|
||||
runAsUser: 1001
|
||||
fsGroup: 1001
|
||||
runAsNonRoot: true
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
## Example:
|
||||
## resources:
|
||||
## requests:
|
||||
## memory: 512Mi
|
||||
## cpu: 300m
|
||||
#
|
||||
# resources:
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Pod annotations
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
##
|
||||
podAnnotations: {}
|
||||
@@ -0,0 +1,241 @@
|
||||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry, imagePullSecrets and storageClass
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Grafana image version
|
||||
## ref: https://hub.docker.com/r/bitnami/grafana/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/grafana
|
||||
tag: 6.3.3-debian-9-r12
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## Optionally specify an array of imagePullSecrets.
|
||||
## Secrets must be manually created in the namespace.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||
##
|
||||
# pullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
|
||||
## String to partially override grafana.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override grafana.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
## Set up update strategy for Grafana installation. Set to Recreate if you use persistent volume that cannot be mounted by more than one pods to makesure the pods is destroyed first.
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy
|
||||
## Example:
|
||||
## updateStrategy:
|
||||
## type: RollingUpdate
|
||||
## rollingUpdate:
|
||||
## maxSurge: 25%
|
||||
## maxUnavailable: 25%
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
|
||||
## Use an alternate scheduler, e.g. "stork".
|
||||
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName:
|
||||
|
||||
## Admin access configuration
|
||||
## If a password is not provided a random password will be generated
|
||||
#
|
||||
admin:
|
||||
user: "admin"
|
||||
# password:
|
||||
|
||||
## SMTP configuration
|
||||
## Use either a secret container the credentials or set the credentials through command line.
|
||||
smtp:
|
||||
enabled: false
|
||||
# Provide credentials by command line
|
||||
user: user
|
||||
password: password
|
||||
## Existing secret with SMTP credentials (user and password)
|
||||
# existingSecret:
|
||||
## User and password key on the existing secret ( "user" and "password" by default )
|
||||
# existingSecretUserKey:
|
||||
# existingSecretPasswordKey:
|
||||
|
||||
## Grafana plugins that will be installed
|
||||
## Specify plugins as a list separated by commas ( you will need to scape them when specifying from command line )
|
||||
## Example:
|
||||
## plugins=grafana-kubernetes-app,grafana-example-app
|
||||
#
|
||||
# plugins:
|
||||
|
||||
ldap:
|
||||
enabled: false
|
||||
allowSignUp: false
|
||||
## configMap with LDAP configuration file (ldap.toml)
|
||||
# configMapName:
|
||||
|
||||
## An array to add extra env vars
|
||||
## For example:
|
||||
## extraEnvVars:
|
||||
## - name: GF_DEFAULT_INSTANCE_NAME
|
||||
## value: my-instance
|
||||
#
|
||||
# extraEnvVars:
|
||||
|
||||
## An array to add extra configmaps:
|
||||
## For example:
|
||||
## extraConfigmaps:
|
||||
## - name: myconfigmap
|
||||
## mountPath: /opt/bitnami/desired-path
|
||||
## subPath: file-name.extension (optional)
|
||||
## readOnly: true
|
||||
|
||||
## Parameters to override the default grafana.ini and custom.ini files.
|
||||
## It is needed to create a configmap containing the grafana.ini and custom.ini files.
|
||||
config:
|
||||
useGrafanaIniFile: false
|
||||
grafanaIniConfigMap:
|
||||
useCustomIniFile: false
|
||||
customIniConfigMap:
|
||||
|
||||
## Create dasboard provider to load dashboards, a default one is created to load
|
||||
## dashboards from "/opt/bitnami/grafana/dashboards"
|
||||
dashboardsProvider:
|
||||
enabled: false
|
||||
## ConfigMap with a custom provider file.
|
||||
## Important to set the Path to "/opt/bitnami/grafana/dashboards"
|
||||
configMapName:
|
||||
|
||||
## Create dashboards from a custom configMap that contains the file.
|
||||
## They will be mounted by the default dashboard provider if it is enabled
|
||||
## Use an array with the configMap names.
|
||||
## Example:
|
||||
## dashboardsConfigMaps:
|
||||
## - mydashboard
|
||||
## - myotherdashboard
|
||||
dashboardsConfigMaps: []
|
||||
|
||||
## Create datasources from a custom secret
|
||||
## The secret must contain the files
|
||||
datasources:
|
||||
secretName:
|
||||
|
||||
## Enable persistence using Persistent Volume Claims
|
||||
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## wordpress data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
# storageClass: "-"
|
||||
##
|
||||
## If you want to reuse an existing claim, you can pass the name of the PVC using
|
||||
## the existingClaim variable
|
||||
# existingClaim: your-claim
|
||||
accessMode: ReadWriteOnce
|
||||
size: 10Gi
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 120
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
readinessProbe:
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
|
||||
# Service configuration
|
||||
service:
|
||||
port: 3000
|
||||
type: ClusterIP
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
# nodePort:
|
||||
|
||||
## Provide any additional annotations which may be required. This can be used to
|
||||
## set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## loadBalancerIP for the PrestaShop Service (optional, cloud specific)
|
||||
## ref: http://kubernetes.io/docs/user-guide/services/#type-loadbalancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
|
||||
# Ingress configuration
|
||||
ingress:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
# kubernetes.io/ingress.class: nginx
|
||||
# kubernetes.io/tls-acme: "true"
|
||||
hosts:
|
||||
- host: grafana.local
|
||||
paths: ["/"]
|
||||
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
# - chart-example.local
|
||||
|
||||
# SecurityContext configuration
|
||||
|
||||
securityContext:
|
||||
enabled: true
|
||||
runAsUser: 1001
|
||||
fsGroup: 1001
|
||||
runAsNonRoot: true
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
## Example:
|
||||
## resources:
|
||||
## requests:
|
||||
## memory: 512Mi
|
||||
## cpu: 300m
|
||||
#
|
||||
# resources:
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Pod annotations
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
##
|
||||
podAnnotations: {}
|
||||
Reference in New Issue
Block a user