Skip to content

Commit

Permalink
feat: add serviceMonitor.extraLabels support (#1200)
Browse files Browse the repository at this point in the history
- Updated version and appVersion for redis, redis-cluster, redis-replication, and redis-sentinel charts to 0.16.5, 0.16.7, and 0.16.9 respectively.
- Introduced `serviceMonitor.extraLabels` in values.yaml and README.md for all Redis charts, allowing users to add custom labels to the ServiceMonitor when enabled.
- Updated templates to utilize the new `extraLabels` configuration for ServiceMonitor.

This change enhances the flexibility of monitoring configurations for Redis deployments.

Signed-off-by: drivebyer <wuyangmuc@gmail.com>
  • Loading branch information
drivebyer authored Jan 5, 2025
1 parent 0d4ce9c commit 79d016e
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 8 deletions.
4 changes: 2 additions & 2 deletions charts/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-cluster
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.4
appVersion: "0.16.4"
version: 0.16.5
appVersion: "0.16.5"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ helm delete <my-release> --namespace <namespace>
| redisExporter.tag | string | `"v1.44.0"` | |
| serviceAccountName | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.extraLabels | object | `{}` | extraLabels are added to the servicemonitor when enabled set to true |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.namespace | string | `"monitoring"` | |
| serviceMonitor.scrapeTimeout | string | `"10s"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-cluster/templates/follower-sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
app.kubernetes.io/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-cluster/templates/leader-sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
app.kubernetes.io/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ serviceMonitor:
interval: 30s
scrapeTimeout: 10s
namespace: monitoring
# -- extraLabels are added to the servicemonitor when enabled set to true
extraLabels: {}
# foo: bar
# team: devops

redisExporter:
enabled: false
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-replication/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-replication
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.6
appVersion: "0.16.6"
version: 0.16.7
appVersion: "0.16.7"
type: application
engine: gotpl
maintainers:
Expand Down
1 change: 1 addition & 0 deletions charts/redis-replication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ helm delete <my-release> --namespace <namespace>
| securityContext | object | `{}` | |
| serviceAccountName | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.extraLabels | object | `{}` | extraLabels are added to the servicemonitor when enabled set to true |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.namespace | string | `"monitoring"` | |
| serviceMonitor.scrapeTimeout | string | `"10s"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-replication/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
app.kubernetes.io/instance: {{ .Values.redisReplication.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-replication/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ serviceMonitor:
interval: 30s
scrapeTimeout: 10s
namespace: monitoring
# -- extraLabels are added to the servicemonitor when enabled set to true
extraLabels: {}
# foo: bar
# team: devops

redisExporter:
enabled: false
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-sentinel/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: redis-sentinel
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.8
appVersion: "0.16.8"
version: 0.16.9
appVersion: "0.16.9"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis-sentinel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ helm delete <my-release> --namespace <namespace>
| securityContext | object | `{}` | |
| serviceAccountName | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.extraLabels | object | `{}` | extraLabels are added to the servicemonitor when enabled set to true |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.namespace | string | `"monitoring"` | |
| serviceMonitor.scrapeTimeout | string | `"10s"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-sentinel/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
app.kubernetes.io/instance: {{ .Values.redisSentinel.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-sentinel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ serviceMonitor:
interval: 30s
scrapeTimeout: 10s
namespace: monitoring
# -- extraLabels are added to the servicemonitor when enabled set to true
extraLabels: {}
# foo: bar
# team: devops

redisExporter:
enabled: false
Expand Down
4 changes: 2 additions & 2 deletions charts/redis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
apiVersion: v2
name: redis
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.16.4
appVersion: "0.16.4"
version: 0.16.5
appVersion: "0.16.5"
home: https://github.com/ot-container-kit/redis-operator
sources:
- https://github.com/ot-container-kit/redis-operator
Expand Down
1 change: 1 addition & 0 deletions charts/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ helm delete <my-release> --namespace <namespace>
| securityContext | object | `{}` | |
| serviceAccountName | string | `""` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.extraLabels | object | `{}` | extraLabels are added to the servicemonitor when enabled set to true |
| serviceMonitor.interval | string | `"30s"` | |
| serviceMonitor.namespace | string | `"monitoring"` | |
| serviceMonitor.scrapeTimeout | string | `"10s"` | |
Expand Down
3 changes: 3 additions & 0 deletions charts/redis/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
app.kubernetes.io/instance: {{ .Values.redisStandalone.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ serviceMonitor:
interval: 30s
scrapeTimeout: 10s
namespace: monitoring
# -- extraLabels are added to the servicemonitor when enabled set to true
extraLabels: {}
# foo: bar
# team: devops

redisExporter:
enabled: false
Expand Down

0 comments on commit 79d016e

Please sign in to comment.