Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

Commit

Permalink
Merge #550
Browse files Browse the repository at this point in the history
550: [backports/1.3/manifests] backported changes to manifests r=anguslees a=sameersbn

- manifests: reload grafana pods on ConfigMap updates
- manifests: define grafana plugins array

Co-authored-by: Sameer Naik <sameer@bitnami.com>
  • Loading branch information
bors[bot] and Sameer Naik committed May 20, 2019
2 parents a118073 + 1a53765 commit a3aeab9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
18 changes: 18 additions & 0 deletions docs/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,24 @@ custom_dashboards: kube.ConfigMap($.p + "grafana-custom-dashboards") + $.metadat

And mount that ConfigMap in the desired location inside the Grafana pod.

#### Grafana Plugins

Plugins enables users to add support for various types of datasources, panels and apps to Grafana. Checkout the official [Plugin Repository](https://grafana.com/plugins) to discover the available plugins for Grafana.

To install additional plug-ins, override the `plugins` item inside the `grafana` scope, like this:

```jsonnet
(import "../../manifests/platforms/aks.jsonnet") {
config:: import "kubeprod-autogen.json",
grafana+: {
plugins+: [
"grafana-piechart-panel",
"grafana-worldmap-panel",
],
},
}
```

## Ingress stack
### NGINX Ingress Controller

Expand Down
10 changes: 7 additions & 3 deletions manifests/components/grafana.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ local GRAFANA_DATA_MOUNTPOINT = "/opt/bitnami/grafana/data";
// Amount of persistent storage required by Alertmanager
storage:: "1Gi",

// List of plugins to install
plugins:: [],

prometheus:: error "No Prometheus service",

// Default to "Admin". See http://docs.grafana.org/permissions/overview/ for
Expand Down Expand Up @@ -73,7 +76,7 @@ local GRAFANA_DATA_MOUNTPOINT = "/opt/bitnami/grafana/data";
},

// Generates YAML configuration under provisioning/datasources/
datasources: kube.ConfigMap($.p + "grafana-prometheus-datasource") + $.metadata {
datasources: utils.HashedConfigMap($.p + "grafana-datasource-configuration") + $.metadata {
local this = self,
datasources:: {
// Built-in datasource for BKPR's Prometheus
Expand All @@ -94,7 +97,7 @@ local GRAFANA_DATA_MOUNTPOINT = "/opt/bitnami/grafana/data";
},

// Generates YAML dashboard configuration under provisioning/dashboards/
dashboards_provider: kube.ConfigMap($.p + "grafana-dashboards-configuration") + $.metadata {
dashboards_provider: utils.HashedConfigMap($.p + "grafana-dashboards-configuration") + $.metadata {
local this = self,
dashboard_provider:: {
// Grafana dashboards configuration
Expand All @@ -117,7 +120,7 @@ local GRAFANA_DATA_MOUNTPOINT = "/opt/bitnami/grafana/data";
},
},

kubernetes_dashboards: kube.ConfigMap($.p + "grafana-kubernetes-dashboards") + $.metadata {
kubernetes_dashboards: utils.HashedConfigMap($.p + "grafana-kubernetes-dashboards") + $.metadata {
local this = self,
data+: {
"k8s_cluster_capacity.json": importstr "grafana-dashboards/handcrafted/kubernetes/k8s_cluster_capacity.json",
Expand Down Expand Up @@ -158,6 +161,7 @@ local GRAFANA_DATA_MOUNTPOINT = "/opt/bitnami/grafana/data";
GF_LOG_MODE: "console",
GF_LOG_LEVEL: "warn",
GF_METRICS_ENABLED: "true",
GF_INSTALL_PLUGINS: std.join(",", $.plugins),
},
ports_+: {
dashboard: { containerPort: 3000 },
Expand Down

0 comments on commit a3aeab9

Please sign in to comment.