Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts/redis-ha] Add extraAnnotations value allowing to add annotations for every sing… #234

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/redis-ha/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ keywords:
- redis
- keyvalue
- database
version: 4.22.4
version: 4.22.5
appVersion: 7.0.4
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png
Expand Down
1 change: 1 addition & 0 deletions charts/redis-ha/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ The following table lists the configurable parameters of the Redis chart and the
| `extraContainers` | Extra containers to include in StatefulSet |`[]`|
| `extraInitContainers` | Extra init containers to include in StatefulSet |`[]`|
| `extraVolumes` | Extra volumes to include in StatefulSet |`[]`|
| `extraAnnotations` | Annotations that should be applied to all created resources |`{}`|
| `extraLabels` | Labels that should be applied to all created resources |`{}`|
| `networkPolicy.enabled` | Create NetworkPolicy for Redis StatefulSet pods |`false`|
| `networkPolicy.labels` | Labels for NetworkPolicy |`{}`|
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-auth-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: Secret
metadata:
name: {{ template "redis-ha.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-ha-announce-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ metadata:
{{- if $root.Values.serviceAnnotations }}
{{ toYaml $root.Values.serviceAnnotations | indent 4 }}
{{- end }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
publishNotReadyAddresses: true
type: ClusterIP
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: ConfigMap
metadata:
name: {{ template "redis-ha.fullname" . }}-configmap
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ConfigMap
metadata:
name: {{ template "redis-ha.fullname" . }}-exporter-script-configmap
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-health-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ kind: ConfigMap
metadata:
name: {{ template "redis-ha.fullname" . }}-health-configmap
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-ha-network-policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ metadata:
{{- range $key, $value := .Values.networkPolicy.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "redis-ha.fullname" . }}-pdb
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-prometheus-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ metadata:
{{- if .Values.prometheusRule.namespace }}
namespace: {{ .Values.prometheusRule.namespace }}
{{- end }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels: {{- toYaml .Values.prometheusRule.additionalLabels | nindent 4 }}
spec:
groups:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: Role
metadata:
name: {{ template "redis-ha.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: RoleBinding
metadata:
name: {{ template "redis-ha.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ kind: Secret
metadata:
name: {{ include "redis-ha.fullname" . }}-secret
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-ha-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ metadata:
{{- if .Values.serviceAnnotations }}
{{ toYaml .Values.serviceAnnotations | indent 4 }}
{{- end }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceAccount
metadata:
name: {{ template "redis-ha.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-ha-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceMonitor
metadata:
name: {{ template "redis-ha.fullname" . }}
namespace: {{ .Values.exporter.serviceMonitor.namespace | default .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
6 changes: 6 additions & 0 deletions charts/redis-ha/templates/redis-ha-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ metadata:
{{ include "labels.standard" . | indent 4 }}
annotations:
{{ toYaml .Values.redis.annotations | indent 4 }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
selector:
matchLabels:
Expand Down Expand Up @@ -562,6 +565,9 @@ spec:
{{- range $key, $value := .Values.persistentVolume.annotations }}
{{ $key }}: {{ $value }}
{{- end }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels: {{- toYaml .Values.persistentVolume.labels | nindent 8 }}

spec:
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ apiVersion: apps/v1
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy-pdb
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ kind: Role
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
component: {{ template "redis-ha.fullname" . }}-haproxy
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ kind: RoleBinding
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
component: {{ template "redis-ha.fullname" . }}-haproxy
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ metadata:
{{- if .Values.haproxy.service.annotations }}
{{ toYaml .Values.haproxy.service.annotations | indent 4 }}
{{- end }}
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
type: {{ default "ClusterIP" .Values.haproxy.service.type }}
{{- if and (eq .Values.haproxy.service.type "LoadBalancer") .Values.haproxy.service.loadBalancerIP }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceAccount
metadata:
name: {{ template "redis-ha.serviceAccountName" . }}-haproxy
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-haproxy-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: ServiceMonitor
metadata:
name: {{ template "redis-ha.fullname" . }}-haproxy
namespace: {{ .Values.haproxy.metrics.serviceMonitor.namespace | default .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/redis-tls-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
metadata:
name: {{ template "redis-ha.fullname" . }}-tls-secret
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
4 changes: 4 additions & 0 deletions charts/redis-ha/templates/sentinel-auth-secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ kind: Secret
metadata:
name: {{ template "redis-ha.fullname" . }}-sentinel
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- range $key, $value := .Values.extraAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
{{ include "labels.standard" . | indent 4 }}
{{- range $key, $value := .Values.extraLabels }}
Expand Down
3 changes: 3 additions & 0 deletions charts/redis-ha/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@ extraVolumes: []
# - name: empty
# emptyDir: {}

# Annotations added here are applied to all created resources
extraAnnotations: {}

# Labels added here are applied to all created resources
extraLabels: {}

Expand Down