move sentinel inside replication

This commit is contained in:
2026-01-08 14:32:08 -06:00
parent 52f339984a
commit 2b1016b45b
5 changed files with 86 additions and 67 deletions

View File

@@ -1,6 +1,6 @@
apiVersion: v2 apiVersion: v2
name: redis-replication name: redis-replication
version: 0.5.0 version: 0.6.0
description: Redis Replication with Sentinel description: Redis Replication with Sentinel
keywords: keywords:
- redis-operator - redis-operator
@@ -12,4 +12,4 @@ sources:
maintainers: maintainers:
- name: alexlebens - name: alexlebens
icon: https://github.com/OT-CONTAINER-KIT/redis-operator/raw/main/static/redis-operator-logo.svg icon: https://github.com/OT-CONTAINER-KIT/redis-operator/raw/main/static/redis-operator-logo.svg
appVersion: v0.21.0 appVersion: v0.23.0

View File

@@ -1,6 +1,6 @@
# redis-replication # redis-replication
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![AppVersion: v0.21.0](https://img.shields.io/badge/AppVersion-v0.21.0-informational?style=flat-square) ![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![AppVersion: v0.23.0](https://img.shields.io/badge/AppVersion-v0.23.0-informational?style=flat-square)
Redis Replication with Sentinel Redis Replication with Sentinel

View File

@@ -37,3 +37,22 @@ spec:
redisExporter: redisExporter:
enabled: {{ .Values.redisReplication.redisExporter.enabled }} enabled: {{ .Values.redisReplication.redisExporter.enabled }}
image: "{{ .Values.redisReplication.redisExporter.image.repository }}:{{ .Values.redisReplication.redisExporter.image.tag }}" image: "{{ .Values.redisReplication.redisExporter.image.repository }}:{{ .Values.redisReplication.redisExporter.image.tag }}"
{{- if .Values.redisSentinel.enabled }}
sentinel:
image: "{{ .Values.redisSentinel.image.repository }}:{{ .Values.redisSentinel.image.tag }}"
imagePullPolicy: {{ .Values.redisSentinel.image.pullPolicy }}
{{ if .Values.existingSecret.enabled }}
redisSecret:
name: {{ .Values.existingSecret.name }}
key: {{ .Values.existingSecret.key }}
{{ end }}
resources:
{{- with .Values.redisSentinel.resources }}
{{- toYaml . | nindent 10 }}
{{ end }}
size: {{ .Values.redisSentinel.clusterSize }}
{{- end }}

View File

@@ -1,46 +1,46 @@
{{- if .Values.redisSentinel.enabled }} # {{- if .Values.redisSentinel.enabled }}
--- # ---
apiVersion: redis.redis.opstreelabs.in/v1beta2 # apiVersion: redis.redis.opstreelabs.in/v1beta2
kind: RedisSentinel # kind: RedisSentinel
metadata: # metadata:
name: {{ include "redis.sentinelName" . }} # name: {{ include "redis.sentinelName" . }}
namespace: {{ include "redis.namespace" . }} # namespace: {{ include "redis.namespace" . }}
labels: # labels:
{{- include "redis.labels" . | nindent 4 }} # {{- include "redis.labels" . | nindent 4 }}
{{- include "redis.sentinelSelectorLabels" . | nindent 4 }} # {{- include "redis.sentinelSelectorLabels" . | nindent 4 }}
spec: # spec:
clusterSize: {{ .Values.redisSentinel.clusterSize }} # clusterSize: {{ .Values.redisSentinel.clusterSize }}
podSecurityContext: # podSecurityContext:
{{- with .Values.redisSentinel.podSecurityContext }} # {{- with .Values.redisSentinel.podSecurityContext }}
{{- toYaml . | nindent 10 }} # {{- toYaml . | nindent 10 }}
{{ end }} # {{ end }}
redisSentinelConfig: # redisSentinelConfig:
redisReplicationName: {{ include "redis.replicationName" . }} # redisReplicationName: {{ include "redis.replicationName" . }}
{{ if .Values.existingSecret.enabled }} # {{ if .Values.existingSecret.enabled }}
redisReplicationPassword: # redisReplicationPassword:
secretKeyRef: # secretKeyRef:
name: {{ .Values.existingSecret.name }} # name: {{ .Values.existingSecret.name }}
key: {{ .Values.existingSecret.key }} # key: {{ .Values.existingSecret.key }}
{{ end }} # {{ end }}
kubernetesConfig: # kubernetesConfig:
image: "{{ .Values.redisSentinel.image.repository }}:{{ .Values.redisSentinel.image.tag }}" # image: "{{ .Values.redisSentinel.image.repository }}:{{ .Values.redisSentinel.image.tag }}"
imagePullPolicy: {{ .Values.redisSentinel.image.pullPolicy }} # imagePullPolicy: {{ .Values.redisSentinel.image.pullPolicy }}
resources: # resources:
{{- with .Values.redisSentinel.resources }} # {{- with .Values.redisSentinel.resources }}
{{- toYaml . | nindent 10 }} # {{- toYaml . | nindent 10 }}
{{ end }} # {{ end }}
{{ if .Values.existingSecret.enabled }} # {{ if .Values.existingSecret.enabled }}
redisSecret: # redisSecret:
name: {{ .Values.existingSecret.name }} # name: {{ .Values.existingSecret.name }}
key: {{ .Values.existingSecret.key }} # key: {{ .Values.existingSecret.key }}
{{ end }} # {{ end }}
redisExporter: # redisExporter:
enabled: {{ .Values.redisSentinel.redisExporter.enabled }} # enabled: {{ .Values.redisSentinel.redisExporter.enabled }}
image: "{{ .Values.redisSentinel.redisExporter.image.repository }}:{{ .Values.redisSentinel.redisExporter.image.tag }}" # image: "{{ .Values.redisSentinel.redisExporter.image.repository }}:{{ .Values.redisSentinel.redisExporter.image.tag }}"
{{- end }} # {{- end }}

View File

@@ -23,27 +23,27 @@ spec:
scrapeTimeout: {{ .Values.redisReplication.redisExporter.serviceMonitor.scrapeTimeout }} scrapeTimeout: {{ .Values.redisReplication.redisExporter.serviceMonitor.scrapeTimeout }}
{{- end }} {{- end }}
{{- if and (.Values.redisSentinel.redisExporter.serviceMonitor.enabled) (.Values.redisSentinel.enabled) }} # {{- if and (.Values.redisSentinel.redisExporter.serviceMonitor.enabled) (.Values.redisSentinel.enabled) }}
--- # ---
apiVersion: monitoring.coreos.com/v1 # apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor # kind: ServiceMonitor
metadata: # metadata:
name: {{ include "redis.sentinelName" . }} # name: {{ include "redis.sentinelName" . }}
namespace: {{ include "redis.namespace" . }} # namespace: {{ include "redis.namespace" . }}
labels: # labels:
{{- include "redis.labels" . | nindent 4 }} # {{- include "redis.labels" . | nindent 4 }}
{{- include "redis.sentinelSelectorLabels" . | nindent 4 }} # {{- include "redis.sentinelSelectorLabels" . | nindent 4 }}
{{- with .Values.redisSentinel.redisExporter.serviceMonitor.extraLabels }} # {{- with .Values.redisSentinel.redisExporter.serviceMonitor.extraLabels }}
{{- toYaml . | nindent 4 }} # {{- toYaml . | nindent 4 }}
{{- end }} # {{- end }}
spec: # spec:
selector: # selector:
matchLabels: # matchLabels:
app: {{ include "redis.sentinelName" . }} # app: {{ include "redis.sentinelName" . }}
redis_setup_type: sentinel # redis_setup_type: sentinel
role: sentinel # role: sentinel
endpoints: # endpoints:
- port: sentinel-client # - port: redis-exporter
interval: {{ .Values.redisSentinel.redisExporter.serviceMonitor.interval }} # interval: {{ .Values.redisSentinel.redisExporter.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.redisSentinel.redisExporter.serviceMonitor.scrapeTimeout }} # scrapeTimeout: {{ .Values.redisSentinel.redisExporter.serviceMonitor.scrapeTimeout }}
{{- end }} # {{- end }}