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

chore: prettify syntax in redis-sentiel,redis-cluster,redis-operator #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 1 addition & 2 deletions charts/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ maintainers:
name: redis-cluster
sources:
- https://github.com/ot-container-kit/redis-operator
version: 0.14.3

version: 0.14.4
appVersion: "0.14.0"
home: https://github.com/ot-container-kit/redis-operator
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/redis-cluster/templates/extra-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Values.externalConfig.enabled true }}
{{- if .Values.externalConfig.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
10 changes: 5 additions & 5 deletions charts/redis-cluster/templates/follower-service.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{- if and (gt (int .Values.redisCluster.follower.replicas) 0) (eq .Values.externalService.enabled true) }}
{{- if and .Values.externalService.enabled (gt (int .Values.redisCluster.follower.replicas) 0) }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-follower-external-service
{{- if .Values.externalService.annotations }}
annotations:
{{ toYaml .Values.externalService.annotations | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.externalService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.externalService.serviceType }}
selector:
Expand Down
27 changes: 0 additions & 27 deletions charts/redis-cluster/templates/follower-sm.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions charts/redis-cluster/templates/leader-service.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{{- if and (gt (int .Values.redisCluster.leader.replicas) 0) (eq .Values.externalService.enabled true) }}
{{- if and .Values.externalService.enabled (gt (int .Values.redisCluster.leader.replicas) 0) }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-leader-external-service
{{- if .Values.externalService.annotations }}
annotations:
{{ toYaml .Values.externalService.annotations | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- with .Values.externalService.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.externalService.serviceType }}
selector:
Expand Down
128 changes: 67 additions & 61 deletions charts/redis-cluster/templates/redis-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,98 +10,104 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- if .Values.labels }}
{{- range $labelkey, $labelvalue := .Values.labels }}
{{ $labelkey}}: {{ $labelvalue }}
{{- end }}
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterSize: {{ .Values.redisCluster.clusterSize }}
persistenceEnabled: {{ .Values.redisCluster.persistenceEnabled }}
clusterVersion: {{ .Values.redisCluster.clusterVersion }}
{{- with .Values.redisCluster.leader }}
redisLeader:
{{- if .Values.redisCluster.leader.affinity }}
{{- with .affinity }}
affinity:
{{ toYaml .Values.redisCluster.leader.affinity | nindent 6 }}
{{- end }}
replicas: {{ .Values.redisCluster.leader.replicas }}
{{- if eq .Values.externalConfig.enabled true }}
{{- toYaml . | nindent 6 }}
{{- end }}
replicas: {{ .replicas }}
{{- if $.Values.externalConfig.enabled }}
redisConfig:
additionalRedisConfig: {{ .Release.Name }}-ext-config
{{- end }}
{{- if eq .Values.pdb.enabled true }}
{{- end }}
{{- with $.Values.pdb }}
{{- if .enabled }}
pdb:
enabled: {{ .Values.pdb.enabled }}
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
enabled: true
{{- with .maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- with .minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.redisCluster.follower }}
redisFollower:
{{- if .Values.redisCluster.follower.affinity }}
{{- with .affinity }}
affinity:
{{ toYaml .Values.redisCluster.follower.affinity | nindent 6 }}
{{- end }}
replicas: {{ .Values.redisCluster.follower.replicas }}
{{- if eq .Values.externalConfig.enabled true }}
{{- toYaml . | nindent 6 }}
{{- end }}
replicas: {{ .replicas }}
{{- if $.Values.externalConfig.enabled }}
redisConfig:
additionalRedisConfig: {{ .Release.Name }}-ext-config
{{- end }}
{{- if eq .Values.pdb.enabled true }}
{{- end }}
{{- with $.Values.pdb }}
{{- if .enabled }}
pdb:
enabled: {{ .Values.pdb.enabled }}
{{- if .Values.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
enabled: true
{{- with .maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
{{- if .Values.pdb.minAvailable }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- with .minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
redisExporter:
enabled: {{ .Values.redisExporter.enabled }}
image: "{{ .Values.redisExporter.image }}:{{ .Values.redisExporter.tag }}"
imagePullPolicy: "{{ .Values.redisExporter.imagePullPolicy }}"
resources:
{{ toYaml .Values.redisExporter.resources | indent 6 }}
{{- toYaml .Values.redisExporter.resources | nindent 6 }}
kubernetesConfig:
image: "{{ .Values.redisCluster.image }}:{{ .Values.redisCluster.tag }}"
imagePullPolicy: "{{ .Values.redisCluster.imagePullPolicy }}"
resources:
{{ toYaml .Values.redisCluster.resources | indent 6 }}
{{- if .Values.redisCluster.redisSecret }}
{{- toYaml .Values.redisCluster.resources | nindent 6 }}
{{- with .Values.redisCluster.redisSecret }}
redisSecret:
name: "{{ .Values.redisCluster.redisSecret.secretName }}"
key: "{{ .Values.redisCluster.redisSecret.secretKey }}"
{{- end }}
{{- if .Values.storageSpec }}
name: "{{ .secretName }}"
key: "{{ .secretKey }}"
{{- end }}
{{- with .Values.storageSpec }}
storage:
{{ toYaml .Values.storageSpec | indent 4 }}
{{- end }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
{{- if .Values.nodeSelector }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: "{{ . }}"
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 4 }}
{{- end }}
{{- if .Values.securityContext }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.securityContext }}
securityContext:
{{ toYaml .Values.securityContext | indent 4 }}
{{- end }}
{{- if .Values.tolerations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.tolerations }}
tolerations:
{{ toYaml .Values.tolerations | indent 4 }}
{{- end }}
{{- if .Values.TLS }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.TLS }}
TLS:
{{ toYaml .Values.TLS | indent 4 }}
{{- end}}
{{- if .Values.sidecars }}
{{ toYaml . | nindent 4 }}
{{- end}}
{{- with .Values.sidecars }}
sidecars:
{{ toYaml .Values.sidecars | indent 4 }}
{{- end }}
{{- if .Values.serviceAccountName }}
serviceAccountName: "{{ .Values.serviceAccountName }}"
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.serviceAccountName }}
serviceAccountName: "{{ . }}"
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{{- if and (eq .Values.serviceMonitor.enabled true) (gt (int .Values.redisCluster.leader.replicas) 0) }}
{{- if and .Values.serviceMonitor.enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}-leader-prometheus-monitoring
labels:
app.kubernetes.io/name: {{ .Release.Name }}
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-leader
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/name: {{ .Release.Name }}
redis_setup_type: cluster
role: leader
endpoints:
- port: redis-exporter
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
- port: redis-exporter
interval: {{ .Values.serviceMonitor.interval }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
namespaceSelector:
matchNames:
- {{ .Values.serviceMonitor.namespace }}
- {{ .Values.serviceMonitor.namespace }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/redis-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
apiVersion: v2
version: 0.14.3
version: 0.14.4
appVersion: "0.14.0"
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
engine: gotpl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,42 @@ spec:
{{- end }}
labels:
name: {{ .Values.redisOperator.name }}
{{- with .Values.redisOperator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.redisOperator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
containers:
- name: "{{ .Values.redisOperator.name }}"
image: "{{ .Values.redisOperator.imageName }}:{{ .Values.redisOperator.imageTag | default (printf "v%s" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.redisOperator.imagePullPolicy }}
imagePullPolicy: "{{ .Values.redisOperator.imagePullPolicy }}"
command:
- /manager
- /manager
args:
- --leader-elect
{{- if .Values.watch_namespace }}
- "--leader-elect"
{{- with .Values.watch_namespace }}
env:
- name: NAMESPACE
value: {{ .Values.watch_namespace }}
{{- end }}
{{- if .Values.resources }}
value: "{{ . }}"
{{- end }}
{{- with .Values.resources }}
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- end }}
{{- toYaml . | nindent 10 }}
{{- end }}
nodeSelector:
{{- with .Values.nodeSelector }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
priorityClassName: {{ .Values.priorityClassName }}
{{- with .Values.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
tolerations:
{{- if .Values.tolerateAllTaints }}
{{- if .Values.tolerateAllTaints }}
- operator: Exists
{{- end }}
{{- with .Values.tolerations }}
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}
{{- with .Values.tolerations }}
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: "{{ .Values.serviceAccountName }}"
serviceAccount: "{{ .Values.serviceAccountName }}"
2 changes: 1 addition & 1 deletion charts/redis-sentinel/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers:
name: redis-sentinel
sources:
- https://github.com/ot-container-kit/redis-operator
version: 0.14.2
version: 0.14.3
appVersion: "0.14.0"
home: https://github.com/ot-container-kit/redis-operator
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/redis-sentinel/templates/extra-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if eq .Values.externalConfig.enabled true }}
{{- if .Values.externalConfig.enabled }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
Loading