Skip to content

Commit

Permalink
Support grafana additional volumeMounts field. (#3960)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikechengwei authored May 17, 2021
1 parent e405d4d commit a015396
Show file tree
Hide file tree
Showing 11 changed files with 2,208 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/api-references/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6150,6 +6150,19 @@ IngressSpec
<em>(Optional)</em>
</td>
</tr>
<tr>
<td>
<code>additionalVolumeMounts</code></br>
<em>
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#volumemount-v1-core">
[]Kubernetes core/v1.VolumeMount
</a>
</em>
</td>
<td>
<p>Additional volume mounts of grafana pod.</p>
</td>
</tr>
</tbody>
</table>
<h3 id="helperspec">HelperSpec</h3>
Expand Down
1 change: 1 addition & 0 deletions examples/basic/tidb-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ kind: TidbMonitor
metadata:
name: basic
spec:
replicas: 1
clusters:
- name: basic
prometheus:
Expand Down
50 changes: 50 additions & 0 deletions examples/monitor-with-externalConfigMap/grafana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# An example describes how to mount a custom dashboard JSON file for Grafana.

> **Note:**
>
> This document is to show how to mount a custom dashboard for Grafana in TidbMonitor.
> This would help to customize the user's Grafana dashboards.
## Install

The following commands are assumed to be executed in this directory.

Create custom dashboard JSON with configMap:

```bash
kubectl apply -f custom-dashboard.yaml -n ${namespace}
```

Install TidbMonitor:

```bash
kubectl apply -f tidb-monitor.yaml -n ${namespace}
```

Wait for Pods ready:

```bash
watch kubectl -n ${namespace} get pod
```

Explore the monitoring dashboards:

```bash
kubectl -n ${namespace} port-forward svc/basic-grafana 3000:3000
```

Browse [localhost:3000](http://localhost:3000), and check the custom dashboard.

## Uninstall

Uninstall TidbMonitor:

```bash
kubectl delete -f tidb-monitor.yaml -n ${namespace}
```

Delete the external configMap:

```bash
kubectl delete -f custom-dashboard.yaml -n ${namespace}
```
Loading

0 comments on commit a015396

Please sign in to comment.