Skip to content

Commit

Permalink
Update dashboard types
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Dec 14, 2023
1 parent f661eb5 commit 1d7b98d
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 25 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,62 @@ jobs:
--namespace kubedb --create-namespace \
--set global.monitoring.agent=prometheus.io/builtin
helm delete kubedb-opscenter --namespace kubedb
- name: Test Grafana Dashboards
run: |
echo "all db dashboards"
helm template charts/kubedb-grafana-dashboards
echo "-----------------------------------------"
echo "elasticsearch dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=elasticsearch \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "kafka dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=kafka \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "mariadb dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=mariadb \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "mongodb dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=mongodb \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "mysql dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=mysql \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "perconaxtradb dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=perconaxtradb \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "postgres dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=postgres \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "proxysql dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=proxysql \
--set app.name=mydb \
--set app.namespace=demo
echo "-----------------------------------------"
echo "redis dashboard with alerts"
helm template charts/kubedb-grafana-dashboards \
--set resources[0]=redis \
--set app.name=mydb \
--set app.namespace=demo
42 changes: 21 additions & 21 deletions charts/kubedb-grafana-dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,32 @@ The command removes all the Kubernetes components associated with the chart and

The following table lists the configurable parameters of the `kubedb-grafana-dashboards` chart and their default values.

| Parameter | Description | Default |
|---------------------------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| nameOverride | Overrides name template | <code>""</code> |
| fullnameOverride | Overrides fullname template | <code>""</code> |
| resources | List of resources for which dashboards will be applied | <code>["elasticsearch","mariadb","mongodb","mysql","postgres","redis","proxysql"]</code> |
| dashboard.folderID | ID of Grafana folder where these dashboards will be applied | <code>0</code> |
| dashboard.overwrite | If true, dashboard with matching uid will be overwritten | <code>true</code> |
| dashboard.templatize.title | If true, datasource will be prefixed to dashboard name | <code>false</code> |
| dashboard.templatize.datasource | If true, datasource will be hardcoded in the dashboard | <code>false</code> |
| dashboard.replacements.job=\"kube-state-metrics\" | | <code>job=\"kubernetes-service-endpoints\"</code> |
| dashboard.replacements.job=\"kubelet\" | | <code>job=\"kubernetes-nodes-cadvisor\"</code> |
| dashboard.replacements.job=\"repl-stats\" | | <code>job=\"kubedb-databases\"</code> |
| grafana.name | Name of Grafana Appbinding where these dashboards are applied | <code>""</code> |
| grafana.namespace | Namespace of Grafana Appbinding where these dashboards are applied | <code>""</code> |
| grafana.version | | <code>8.2.3</code> |
| grafana.jobName | | <code>kubedb-databases</code> |
| grafana.url | | <code>""</code> |
| grafana.apikey | | <code>""</code> |
| app.name | | <code>""</code> |
| app.namespace | | <code>""</code> |
| Parameter | Description | Default |
|---------------------------------------------------|--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| nameOverride | Overrides name template | <code>""</code> |
| fullnameOverride | Overrides fullname template | <code>""</code> |
| resources | List of resources for which dashboards will be applied | <code>["elasticsearch","kafka","mariadb","mongodb","mysql","perconaxtradb","postgres","proxysql","redis"]</code> |
| dashboard.folderID | ID of Grafana folder where these dashboards will be applied | <code>0</code> |
| dashboard.overwrite | If true, dashboard with matching uid will be overwritten | <code>true</code> |
| dashboard.templatize.title | If true, datasource will be prefixed to dashboard name | <code>false</code> |
| dashboard.templatize.datasource | If true, datasource will be hardcoded in the dashboard | <code>false</code> |
| dashboard.replacements.job=\"kube-state-metrics\" | | <code>job=\"kubernetes-service-endpoints\"</code> |
| dashboard.replacements.job=\"kubelet\" | | <code>job=\"kubernetes-nodes-cadvisor\"</code> |
| dashboard.replacements.job=\"repl-stats\" | | <code>job=\"kubedb-databases\"</code> |
| grafana.name | Name of Grafana Appbinding where these dashboards are applied | <code>""</code> |
| grafana.namespace | Namespace of Grafana Appbinding where these dashboards are applied | <code>""</code> |
| grafana.version | | <code>8.2.3</code> |
| grafana.jobName | | <code>kubedb-databases</code> |
| grafana.url | | <code>""</code> |
| grafana.apikey | | <code>""</code> |
| app.name | | <code>""</code> |
| app.namespace | | <code>""</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:

```bash
$ helm upgrade -i kubedb-grafana-dashboards appscode/kubedb-grafana-dashboards -n kubeops --create-namespace --version=v2023.12.11 --set resources=["elasticsearch","mariadb","mongodb","mysql","postgres","redis","proxysql"]
$ helm upgrade -i kubedb-grafana-dashboards appscode/kubedb-grafana-dashboards -n kubeops --create-namespace --version=v2023.12.11 --set resources=["elasticsearch","kafka","mariadb","mongodb","mysql","perconaxtradb","postgres","proxysql","redis"]
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while
Expand Down
9 changes: 6 additions & 3 deletions charts/kubedb-grafana-dashboards/data/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ mongodb:
mysql:
kind: MySQL
resource: mysqls
perconaxtradb:
kind: PerconaXtraDB
resource: perconaxtradbs
postgres:
kind: Postgres
resource: postgreses
redis:
kind: Redis
resource: redises
proxysql:
kind: ProxySQL
resource: proxysqls
redis:
kind: Redis
resource: redises
4 changes: 3 additions & 1 deletion charts/kubedb-grafana-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ fullnameOverride: ""
# List of resources for which dashboards will be applied
resources: # +doc-gen:break
- elasticsearch
- kafka
- mariadb
- mongodb
- mysql
- perconaxtradb
- postgres
- redis
- proxysql
- redis

dashboard:
# ID of Grafana folder where these dashboards will be applied
Expand Down

0 comments on commit 1d7b98d

Please sign in to comment.