Appearance
Grafana
This section shows all available options that can be overridden in the config.jsonnet
file.
All Grafana config is stored under the grafana object in the config.
js
{
grafana+: {
annotations:: {
deployment: {},
ingress: {},
pod: {},
},
dashboards:: [
{
definition: importstr '../../dashboards/kubernetes-node-resources.json',
file: 'kubernetes-node-resources.json',
folder: 'Kubernetes',
title: 'Node Resources',
},
{
definition: importstr '../../dashboards/kubernetes-pod-resources.json',
file: 'kubernetes-pod-resources.json',
folder: 'Kubernetes',
title: 'Pod Resources',
},
],
env:: {},
image:: 'grafana/grafana:9.5.1',
ingress:: {},
labels:: {
deployment: {},
pod: {},
selector: {'app.kubernetes.io/name': 'grafana'},
},
name:: 'grafana',
path:: '/',
ports:: {
external: 80,
internal: 3000,
},
resources:: {
cpu: {request: '50m', limit: '200m'},
memory: {request: '32Mi', limit: '128Mi'},
},
secrets:: {
admin: {
username: '<fill with admin username>',
password: '<fill with admin password>',
},
},
security:: {
tls: {
enabled: false,
issuer: '<fill with certificate issuer>',
},
},
}
}
Field | Description / Default |
---|---|
annotations.deployment | Annotations added at the deployment (topmost) level. {} |
annotations.ingress | Annotations added to the ingress. {} |
annotations.pod | Annotations added at the pod level. {} |
dashboards | Array of dashboard definitions that are provisioned. See Custom Dashboards. [ /* various default dashboards */ ] |
env | Environment variables that are added to the Grafana container. See Customize Grafana {} |
host | Hostname where the UI is exposed. undefined |
image | Docker image that gets deployed. grafana/grafana:9.5.1 |
ingress.className | Class name added to the Grafana ingress. undefined |
labels.deployment | Labels added at the deployment (topmost) level. {} |
labels.pod | Labels added at the pod level. {} |
labels.selector | Selector used for all Grafana k8s resources. {'app.kubernetes.io/name': 'grafana'} |
name | Name used for the k8s resources. grafana |
path | Path where the UI is exposed. / |
ports.external | External port where the UI is exposed. 80 |
ports.internal | Internal port used inside the container. 3000 |
resources.cpu.request | Min. requested amount of CPU time. 50m |
resources.cpu.limit | Max. allowed amount of CPU time. 200m |
resources.memory.request | Min. requested amount of memory. 32Mi |
resources.memory.limit | Max. allowed amount of memory. 128Mi |
secrets.admin.username | Admin username for Grafana. <fill with admin username> |
secrets.admin.password | Admin password for Grafana. <fill with admin password> |
security.tls.enabled | Enables TLS, creating a certificate to access Grafana over HTTPS. false |
security.tls.issuer | Issuer or ClusterIssuer where the certificate is requested. See cert-manager documentation on how to set one up. <fill with certificate issuer> |
Customize Grafana
While it is possible to configure the most common options through the Jsonnet config above, it doesn't cover all use cases.
Grafana itself is quite customizable and allows to set any possible option through environment variables. See overide configuration with environment variabls on the official Grafana documentation.
The environment variables can be set by using the env
field mentioned above.
An example may look like this:
js
{
grafana+: {
env+:: {
'GF_AUTH_DISABLE_LOGIN_FORM': true,
'GF_AUTH_GITHUB_AUTH_URL': 'https://github.com/login/oauth/authorize',
'GF_AUTH_GITHUB_ENABLED': true,
},
}
}