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

Added name overwrite function to redis charts #168

Merged
merged 7 commits into from
Oct 18, 2023
Merged
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
2 changes: 1 addition & 1 deletion charts/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: redis-cluster
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.15.9
version: 0.15.10
appVersion: "0.15.1"
home: https://github.com/ot-container-kit/redis-operator
sources:
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 @@ -43,6 +43,7 @@ helm delete <my-release> --namespace <namespace>
| `redisCluster.imagePullPolicy` | IfNotPresent | Image Pull Policy of the redis image |
| `redisCluster.leaderServiceType` | ClusterIP | Kubernetes service type for Redis Leader |
| `redisCluster.followerServiceType` | ClusterIP | Kubernetes service type for Redis Follower |
| `redisCluster.name` | "" | Overwrites the name for the charts resources instead of the Release name |
| `externalService.enabled` | false | If redis service needs to be exposed using LoadBalancer or NodePort |
| `externalService.annotations` | {} | Kubernetes service related annotations |
| `externalService.serviceType` | NodePort | Kubernetes service type for exposing service, values - ClusterIP, NodePort, and LoadBalancer |
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

{{/* Define common labels */}}
{{- define "common.labels" -}}
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
{{- if .Values.labels }}
Expand Down
6 changes: 3 additions & 3 deletions charts/redis-cluster/templates/extra-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-ext-config
name: {{ .Values.redisCluster.name | default .Release.Name }}-ext-config
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
data:
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-cluster/templates/follower-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-follower-external-service
name: {{ .Values.redisCluster.name | default .Release.Name }}-follower-external-service
{{- if .Values.externalService.annotations }}
annotations:
{{ toYaml .Values.externalService.annotations | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
type: {{ .Values.externalService.serviceType }}
selector:
app: {{ .Release.Name }}-follower
app: {{ .Values.redisCluster.name | default .Release.Name }}-follower
redis_setup_type: cluster
role: follower
ports:
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-cluster/templates/follower-sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}-follower-prometheus-monitoring
name: {{ .Values.redisCluster.name | default .Release.Name }}-follower-prometheus-monitoring
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-follower
app: {{ .Values.redisCluster.name | default .Release.Name }}-follower
redis_setup_type: cluster
role: follower
endpoints:
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-cluster/templates/leader-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-leader-external-service
name: {{ .Values.redisCluster.name | default .Release.Name }}-leader-external-service
{{- if .Values.externalService.annotations }}
annotations:
{{ toYaml .Values.externalService.annotations | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
type: {{ .Values.externalService.serviceType }}
selector:
app: {{ .Release.Name }}-leader
app: {{ .Values.redisCluster.name | default .Release.Name }}-leader
redis_setup_type: cluster
role: leader
ports:
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-cluster/templates/leader-sm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}-leader-prometheus-monitoring
name: {{ .Values.redisCluster.name | default .Release.Name }}-leader-prometheus-monitoring
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisCluster.name | default .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/instance: {{ .Values.redisCluster.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
selector:
matchLabels:
app: {{ .Release.Name }}-leader
app: {{ .Values.redisCluster.name | default .Release.Name }}-leader
redis_setup_type: cluster
role: leader
endpoints:
Expand Down
6 changes: 3 additions & 3 deletions charts/redis-cluster/templates/redis-cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: redis.redis.opstreelabs.in/v1beta2
kind: RedisCluster
metadata:
name: {{ .Release.Name }}
name: {{ .Values.redisCluster.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
spec:
clusterSize: {{ .Values.redisCluster.clusterSize }}
Expand All @@ -13,14 +13,14 @@ spec:
replicas: {{ .Values.redisCluster.leader.replicas }}
{{- if .Values.externalConfig.enabled }}
redisConfig:
additionalRedisConfig: "{{ .Release.Name }}-ext-config"
additionalRedisConfig: "{{ .Values.redisCluster.name | default .Release.Name }}-ext-config"
{{- end }}

redisFollower: {{- include "redis.role" .Values.redisCluster.follower | nindent 4 }}
replicas: {{ .Values.redisCluster.follower.replicas }}
{{- if .Values.externalConfig.enabled }}
redisConfig:
additionalRedisConfig: "{{ .Release.Name }}-ext-config"
additionalRedisConfig: "{{ .Values.redisCluster.name | default .Release.Name }}-ext-config"
{{- end }}

redisExporter:
Expand Down
15 changes: 8 additions & 7 deletions charts/redis-cluster/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
redisCluster:
name: ""
clusterSize: 3
clusterVersion: v7
persistenceEnabled: true
Expand Down Expand Up @@ -37,7 +38,7 @@ redisCluster:
# effect: "NoSchedule"
nodeSelector: null
# memory: medium
securityContext : {}
securityContext: {}
pdb:
enabled: false
maxUnavailable: 1
Expand All @@ -62,7 +63,7 @@ redisCluster:
# effect: "NoSchedule"
nodeSelector: null
# memory: medium
securityContext : {}
securityContext: {}
pdb:
enabled: false
maxUnavailable: 1
Expand Down Expand Up @@ -125,7 +126,7 @@ sidecars:
# value: "my-env-var-value"

initContainer:
enabled: false
enabled: false
image: ""
imagePullPolicy: "IfNotPresent"
resources: {}
Expand Down Expand Up @@ -172,12 +173,12 @@ TLS:
secret:
secretName: ""

acl :
secret :
acl:
secret:
secretName: ""

env : []
env: []
# - name: VAR_NAME
# value: "value1"

serviceAccountName : ""
serviceAccountName: ""
2 changes: 1 addition & 1 deletion charts/redis-replication/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ maintainers:
- name: shubham-cmyk
sources:
- https://github.com/ot-container-kit/redis-operator
version: 0.15.9
version: 0.15.10
appVersion: "0.15.1"
home: https://github.com/ot-container-kit/redis-operator
keywords:
Expand Down
6 changes: 3 additions & 3 deletions charts/redis-replication/templates/extra-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-ext-config
name: {{ .Values.redisReplication.name | default .Release.Name }}-ext-config
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisReplication.name | default .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/instance: {{ .Values.redisReplication.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
data:
Expand Down
4 changes: 2 additions & 2 deletions charts/redis-replication/templates/redis-replication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: redis.redis.opstreelabs.in/v1beta2
kind: RedisReplication
metadata:
name: {{ .Release.Name }}
name: {{ .Values.redisReplication.name | default .Release.Name }}
labels: {{- include "common.labels" . | nindent 4 }}
spec:
clusterSize: {{ .Values.redisReplication.clusterSize }}
Expand Down Expand Up @@ -37,7 +37,7 @@ spec:

{{- if .Values.externalConfig.enabled }}
redisConfig:
additionalRedisConfig: "{{ .Release.Name }}-ext-config"
additionalRedisConfig: "{{ .Values.redisReplication.name | default .Release.Name }}-ext-config"
{{- end }}
{{- if .Values.storageSpec }}
storage: {{ toYaml .Values.storageSpec | nindent 4 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-replication/templates/replication-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-external-service
name: {{ .Values.redisReplication.name | default .Release.Name }}-external-service
{{- if .Values.externalService.annotations }}
annotations:
{{ toYaml .Values.externalService.annotations | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisReplication.name | default .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/instance: {{ .Values.redisReplication.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
type: {{ .Values.externalService.serviceType }}
selector:
app: {{ .Release.Name }}
app: {{ .Values.redisReplication.name | default .Release.Name }}
redis_setup_type: replication
role: replication
ports:
Expand Down
8 changes: 4 additions & 4 deletions charts/redis-replication/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Release.Name }}-prometheus-monitoring
name: {{ .Values.redisReplication.name | default .Release.Name }}-prometheus-monitoring
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisReplication.name | default .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/instance: {{ .Values.redisReplication.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
app: {{ .Values.redisReplication.name | default .Release.Name }}
redis_setup_type: replication
role: replication
endpoints:
Expand Down
16 changes: 10 additions & 6 deletions charts/redis-replication/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
redisReplication:
name: ""
clusterSize: 3
image: quay.io/opstree/redis
tag: v7.0.12
Expand All @@ -20,6 +21,9 @@ redisReplication:
ignoreAnnotations: []
# - "redis.opstreelabs.in/ignore"

# Overwite name for resources
# name: ""

labels: {}
# foo: bar
# test: echo
Expand Down Expand Up @@ -61,7 +65,7 @@ redisExporter:
# value: "value1"

initContainer:
enabled: false
enabled: false
image: ""
imagePullPolicy: "IfNotPresent"
resources: {}
Expand Down Expand Up @@ -109,7 +113,7 @@ podSecurityContext:
runAsUser: 1000
fsGroup: 1000

securityContext : {}
securityContext: {}

affinity: {}
# nodeAffinity:
Expand All @@ -127,7 +131,7 @@ tolerations: []
# value: "value"
# effect: "NoSchedule"

serviceAccountName : ""
serviceAccountName: ""

TLS:
ca: ca.key
Expand All @@ -136,10 +140,10 @@ TLS:
secret:
secretName: ""

acl :
secret :
acl:
secret:
secretName: ""

env : []
env: []
# - name: VAR_NAME
# value: "value1"
2 changes: 1 addition & 1 deletion charts/redis-sentinel/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: redis-sentinel
description: Provides easy redis setup definitions for Kubernetes services, and deployment.
version: 0.15.10
version: 0.15.11
appVersion: "0.15.1"
home: https://github.com/ot-container-kit/redis-operator
sources:
Expand Down
6 changes: 3 additions & 3 deletions charts/redis-sentinel/templates/extra-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-ext-config
name: {{ .Values.redisSentinel.name | default .Release.Name }}-ext-config
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/name: {{ .Values.redisSentinel.name | default .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/instance: {{ .Values.redisSentinel.name | default .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: middleware
data:
Expand Down
Loading
Loading