Skip to content

Commit 0e3e686

Browse files
committed
fixed naming, removed validation, updated readm
e
1 parent 4b5cf41 commit 0e3e686

6 files changed

Lines changed: 104 additions & 44 deletions

File tree

redis/RELEASES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# Release Notes - Version 3.4.1
2+
3+
## What's New
4+
5+
- **Grafana Dashboard**: Added optional `GrafanaDashboard` CRD provisioned via the [Grafana Operator](https://grafana.github.io/grafana-operator/). Enable with `grafana.dashboard.enabled: true` (disabled by default). When enabled, a pre-built Redis dashboard is automatically created in your Grafana instance with CPU and memory panels always included, and Connected Clients, Redis Memory Used, Commands/sec, and Cache Hit Rate panels added when `redis.exporter.enabled: true`. Compatible with both Helm and ArgoCD deployments. Configure the target folder, datasource name, and Grafana CR selector via `grafana.folder`, `grafana.datasource`, and `grafana.instanceSelector`.
6+
7+
18
# Release Notes - Version 3.4.0
29

310
## What's New

redis/versions/3.4.1/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,55 @@ redis:
7474
- "redis_latency_percentiles_usec"
7575
```
7676

77+
**Grafana Dashboard** — opt-in, k8s clusters only. When enabled, a `GrafanaDashboard` CRD is provisioned via the [Grafana Operator](https://grafana.github.io/grafana-operator/) and automatically appears in your Grafana instance:
78+
79+
```yaml
80+
grafana:
81+
dashboard:
82+
enabled: true
83+
folder: Redis # Grafana folder the dashboard is placed in
84+
datasource: metrics # name of the Prometheus datasource in your Grafana instance
85+
instanceSelector:
86+
matchLabels:
87+
dashboards: grafana # must match the label on your Grafana CR
88+
```
89+
90+
On Control Plane's managed platform where no Grafana Operator is present, leave this disabled — the `GrafanaDashboard` CRD will have nothing to reconcile it.
91+
92+
**Prerequisites:**
93+
94+
1. **Grafana Operator installed** in your Kubernetes cluster. The operator must be configured with your Grafana instance URL and a Grafana service account API token (not a Control Plane token):
95+
96+
```bash
97+
kubectl create secret generic grafana-admin-credentials \
98+
--from-literal=GF_SECURITY_ADMIN_USER=admin \
99+
--from-literal=GF_SECURITY_ADMIN_PASSWORD=<grafana-api-token> \
100+
-n grafana-operator
101+
```
102+
103+
2. **A Grafana CR** with a label matching `grafana.instanceSelector.matchLabels`. For example:
104+
```yaml
105+
apiVersion: grafana.integreatly.org/v1beta1
106+
kind: Grafana
107+
metadata:
108+
name: grafana
109+
labels:
110+
dashboards: grafana
111+
spec:
112+
external:
113+
url: https://your-org.grafana.cpln.io
114+
adminPassword:
115+
name: grafana-admin-credentials
116+
key: GF_SECURITY_ADMIN_PASSWORD
117+
```
118+
119+
**Included panels:**
120+
- CPU Usage (`cpu_used`) — always included
121+
- Memory Usage (`mem_used`) — always included
122+
- Connected Clients, Redis Memory, Commands/sec, Cache Hit Rate — included when `redis.exporter.enabled: true`
123+
124+
The dashboard includes template variables for datasource, GVC, workload, and replica so you can filter by deployment without editing the dashboard.
125+
77126
**Firewall** — set the internal access scope for both Redis and Sentinel:
78127
```yaml
79128
firewall:

redis/versions/3.4.1/templates/_helpers.tpl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ Redis Backup Policy Name
106106
{{- printf "%s-redis-backup-policy" .Release.Name }}
107107
{{- end }}
108108

109-
{{/*
110-
Grafana Folder Name
111-
*/}}
112-
{{- define "redis.grafanaFolder.name" -}}
113-
{{- .Values.grafana.folder | lower | replace " " "-" }}
114-
{{- end }}
115-
116109
{{/*
117110
Grafana Dashboard Name
118111
*/}}

redis/versions/3.4.1/templates/grafana-dashboard.yaml

Lines changed: 47 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{{- if and (.Capabilities.APIVersions.Has "grafana.integreatly.org/v1beta1") .Values.grafana.dashboard.enabled }}
1+
{{- if .Values.grafana.dashboard.enabled }}
22
apiVersion: grafana.integreatly.org/v1beta1
33
kind: GrafanaDashboard
44
metadata:
55
name: {{ include "redis.grafanaDashboard.name" . }}
66
spec:
7-
folder: {{ include "redis.grafanaFolder.name" . }}
7+
folder: {{ .Values.grafana.folder }}
88
instanceSelector:
99
matchLabels:
1010
{{- toYaml .Values.grafana.instanceSelector.matchLabels | nindent 6 }}
@@ -25,32 +25,54 @@ spec:
2525
"name": "datasource",
2626
"label": "Datasource",
2727
"pluginId": "prometheus",
28-
"current": {}
28+
"regex": "{{ .Values.grafana.datasource }}",
29+
"current": {
30+
"text": "{{ .Values.grafana.datasource }}",
31+
"value": "{{ .Values.grafana.datasource }}"
32+
}
33+
},
34+
{
35+
"type": "textbox",
36+
"name": "gvc",
37+
"label": "GVC",
38+
"query": "{{ .Values.global.cpln.gvc }}",
39+
"current": {
40+
"value": "{{ .Values.global.cpln.gvc }}",
41+
"text": "{{ .Values.global.cpln.gvc }}"
42+
},
43+
"options": [
44+
{
45+
"selected": true,
46+
"text": "{{ .Values.global.cpln.gvc }}",
47+
"value": "{{ .Values.global.cpln.gvc }}"
48+
}
49+
]
2950
},
3051
{
3152
"type": "textbox",
32-
"name": "namespace",
33-
"label": "Namespace",
53+
"name": "workload",
54+
"label": "Workload",
55+
"query": "{{ include "redis.name" . }}",
3456
"current": {
35-
"value": "{{ .Release.Namespace }}",
36-
"text": "{{ .Release.Namespace }}"
57+
"value": "{{ include "redis.name" . }}",
58+
"text": "{{ include "redis.name" . }}"
3759
},
3860
"options": [
3961
{
4062
"selected": true,
41-
"text": "{{ .Release.Namespace }}",
42-
"value": "{{ .Release.Namespace }}"
63+
"text": "{{ include "redis.name" . }}",
64+
"value": "{{ include "redis.name" . }}"
4365
}
4466
]
4567
},
4668
{
4769
"type": "query",
48-
"name": "pod",
49-
"label": "Pod",
70+
"name": "replica",
71+
"label": "Replica",
5072
"datasource": {"type": "prometheus", "uid": "${datasource}"},
51-
"definition": "label_values(container_cpu_usage_seconds_total{container=\"redis\", namespace=\"$namespace\"}, pod)",
73+
"definition": "label_values(cpu_used{workload=\"$workload\", gvc=\"$gvc\"}, replica)",
5274
"query": {
53-
"query": "label_values(container_cpu_usage_seconds_total{container=\"redis\", namespace=\"$namespace\"}, pod)",
75+
"query": "label_values(cpu_used{workload=\"$workload\", gvc=\"$gvc\"}, replica)",
5476
"refId": "StandardVariableQuery"
5577
},
5678
"refresh": 2,
@@ -71,8 +93,8 @@ spec:
7193
"targets": [
7294
{
7395
"datasource": {"type": "prometheus", "uid": "${datasource}"},
74-
"expr": "rate(container_cpu_usage_seconds_total{container=\"redis\", namespace=\"$namespace\", pod=~\"$pod\"}[5m])",
75-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
96+
"expr": "cpu_used{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}",
97+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
7698
"refId": "A"
7799
}
78100
],
@@ -98,8 +120,8 @@ spec:
98120
"targets": [
99121
{
100122
"datasource": {"type": "prometheus", "uid": "${datasource}"},
101-
"expr": "container_memory_working_set_bytes{container=\"redis\", namespace=\"$namespace\", pod=~\"$pod\"}",
102-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
123+
"expr": "mem_used{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}",
124+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
103125
"refId": "A"
104126
}
105127
],
@@ -126,8 +148,8 @@ spec:
126148
"targets": [
127149
{
128150
"datasource": {"type": "prometheus", "uid": "${datasource}"},
129-
"expr": "redis_connected_clients{namespace=\"$namespace\", pod=~\"$pod\"}",
130-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
151+
"expr": "redis_connected_clients{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}",
152+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
131153
"refId": "A"
132154
}
133155
],
@@ -153,8 +175,8 @@ spec:
153175
"targets": [
154176
{
155177
"datasource": {"type": "prometheus", "uid": "${datasource}"},
156-
"expr": "redis_memory_used_bytes{namespace=\"$namespace\", pod=~\"$pod\"}",
157-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
178+
"expr": "redis_memory_used_bytes{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}",
179+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
158180
"refId": "A"
159181
}
160182
],
@@ -180,8 +202,8 @@ spec:
180202
"targets": [
181203
{
182204
"datasource": {"type": "prometheus", "uid": "${datasource}"},
183-
"expr": "rate(redis_commands_processed_total{namespace=\"$namespace\", pod=~\"$pod\"}[5m])",
184-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
205+
"expr": "rate(redis_commands_processed_total{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}[5m])",
206+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
185207
"refId": "A"
186208
}
187209
],
@@ -207,8 +229,8 @@ spec:
207229
"targets": [
208230
{
209231
"datasource": {"type": "prometheus", "uid": "${datasource}"},
210-
"expr": "rate(redis_keyspace_hits_total{namespace=\"$namespace\", pod=~\"$pod\"}[5m]) / (rate(redis_keyspace_hits_total{namespace=\"$namespace\", pod=~\"$pod\"}[5m]) + rate(redis_keyspace_misses_total{namespace=\"$namespace\", pod=~\"$pod\"}[5m]))",
211-
"legendFormat": "{{ "{{" }}pod{{ "}}" }}",
232+
"expr": "rate(redis_keyspace_hits_total{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}[5m]) / (rate(redis_keyspace_hits_total{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}[5m]) + rate(redis_keyspace_misses_total{workload=\"$workload\", gvc=\"$gvc\", replica=~\"$replica\"}[5m]))",
233+
"legendFormat": "{{ "{{" }}replica{{ "}}" }}",
212234
"refId": "A"
213235
}
214236
],

redis/versions/3.4.1/templates/grafana-folder.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

redis/versions/3.4.1/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ grafana:
189189
dashboard:
190190
enabled: false # K8s clusters only - set to true to provision the dashboard via the Grafana Operator
191191
folder: Redis # Grafana folder the dashboard is placed in
192-
datasource: Prometheus # name of the Prometheus datasource in your Grafana instance
192+
datasource: metrics # name of the Prometheus datasource in your Grafana instance
193193
instanceSelector:
194194
matchLabels:
195195
dashboards: grafana # must match the label on your Grafana CR

0 commit comments

Comments
 (0)