From 7cc779428d87c507e55a8806431b89e568d206d6 Mon Sep 17 00:00:00 2001 From: whzghb <41436057+whzghb@users.noreply.github.com> Date: Mon, 16 Oct 2023 17:42:13 +0800 Subject: [PATCH 1/6] fix redis-sentinel selector role value (#164) * fix redis-sentinel selector role value Signed-off-by: whzghb <631064936@qq.com> * fix lints Signed-off-by: Shubham Gupta * fix linl-2 Signed-off-by: Shubham Gupta --------- Signed-off-by: whzghb <631064936@qq.com> Signed-off-by: Shubham Gupta Co-authored-by: Shubham Gupta Signed-off-by: EStork09 --- charts/redis-sentinel/Chart.yaml | 2 +- charts/redis-sentinel/templates/service.yaml | 2 +- charts/redis-sentinel/values.yaml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/redis-sentinel/Chart.yaml b/charts/redis-sentinel/Chart.yaml index aa4d2642..e290d519 100644 --- a/charts/redis-sentinel/Chart.yaml +++ b/charts/redis-sentinel/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: redis-sentinel 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: diff --git a/charts/redis-sentinel/templates/service.yaml b/charts/redis-sentinel/templates/service.yaml index 3dfb5991..5c3d3c19 100644 --- a/charts/redis-sentinel/templates/service.yaml +++ b/charts/redis-sentinel/templates/service.yaml @@ -20,7 +20,7 @@ spec: selector: app: {{ .Release.Name }} redis_setup_type: sentinel - role: sentinle + role: sentinel ports: - protocol: TCP port: {{ .Values.externalService.port }} diff --git a/charts/redis-sentinel/values.yaml b/charts/redis-sentinel/values.yaml index 76a64014..51757eba 100644 --- a/charts/redis-sentinel/values.yaml +++ b/charts/redis-sentinel/values.yaml @@ -70,7 +70,7 @@ redisExporter: # value: "value1" initContainer: - enabled: false + enabled: false image: "" imagePullPolicy: "IfNotPresent" resources: {} @@ -108,7 +108,7 @@ podSecurityContext: runAsUser: 1000 fsGroup: 1000 -securityContext : {} +securityContext: {} affinity: {} # nodeAffinity: @@ -126,7 +126,7 @@ tolerations: [] # value: "value" # effect: "NoSchedule" -serviceAccountName : "" +serviceAccountName: "" TLS: ca: ca.key @@ -135,10 +135,10 @@ TLS: secret: secretName: "" -acl : - secret : +acl: + secret: secretName: "" -env : [] +env: [] # - name: VAR_NAME # value: "value1" From 7c08ffb3524db5ad69422d77828dbc9bf4b662b0 Mon Sep 17 00:00:00 2001 From: EStork09 Date: Wed, 18 Oct 2023 11:15:09 +0000 Subject: [PATCH 2/6] Added name overwrite function to redis charts Signed-off-by: EStork09 --- charts/redis-cluster/README.md | 1 + charts/redis-cluster/templates/_helpers.tpl | 4 ++-- charts/redis-cluster/templates/extra-config.yaml | 6 +++--- charts/redis-cluster/templates/follower-service.yaml | 8 ++++---- charts/redis-cluster/templates/follower-sm.yaml | 8 ++++---- charts/redis-cluster/templates/leader-service.yaml | 8 ++++---- charts/redis-cluster/templates/leader-sm.yaml | 8 ++++---- charts/redis-cluster/templates/redis-cluster.yaml | 6 +++--- charts/redis-cluster/values.yaml | 3 +++ charts/redis-replication/templates/extra-config.yaml | 6 +++--- charts/redis-replication/templates/redis-replication.yaml | 4 ++-- .../redis-replication/templates/replication-service.yaml | 8 ++++---- charts/redis-replication/templates/servicemonitor.yaml | 8 ++++---- charts/redis-replication/values.yaml | 3 +++ charts/redis-sentinel/templates/extra-config.yaml | 6 +++--- charts/redis-sentinel/templates/redis-sentinel.yaml | 6 +++--- charts/redis-sentinel/templates/service.yaml | 8 ++++---- charts/redis-sentinel/values.yaml | 3 +++ charts/redis/README.md | 1 + charts/redis/templates/_helpers.tpl | 4 ++-- charts/redis/templates/extra-config.yaml | 6 +++--- charts/redis/templates/redis-standalone.yaml | 4 ++-- charts/redis/templates/service.yaml | 8 ++++---- charts/redis/templates/servicemonitor.yaml | 8 ++++---- charts/redis/values.yaml | 3 +++ 25 files changed, 76 insertions(+), 62 deletions(-) diff --git a/charts/redis-cluster/README.md b/charts/redis-cluster/README.md index a74dc34f..64916d9d 100644 --- a/charts/redis-cluster/README.md +++ b/charts/redis-cluster/README.md @@ -43,6 +43,7 @@ helm delete --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 | +| `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 | diff --git a/charts/redis-cluster/templates/_helpers.tpl b/charts/redis-cluster/templates/_helpers.tpl index cb9c07a7..d8ffb023 100644 --- a/charts/redis-cluster/templates/_helpers.tpl +++ b/charts/redis-cluster/templates/_helpers.tpl @@ -2,10 +2,10 @@ {{/* Define common labels */}} {{- define "common.labels" -}} -app.kubernetes.io/name: {{ .Release.Name }} +app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware {{- if .Values.labels }} diff --git a/charts/redis-cluster/templates/extra-config.yaml b/charts/redis-cluster/templates/extra-config.yaml index e751f561..19612600 100644 --- a/charts/redis-cluster/templates/extra-config.yaml +++ b/charts/redis-cluster/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-ext-config + name: {{ .Values.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-cluster/templates/follower-service.yaml b/charts/redis-cluster/templates/follower-service.yaml index 8147a444..f97107ca 100644 --- a/charts/redis-cluster/templates/follower-service.yaml +++ b/charts/redis-cluster/templates/follower-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-follower-external-service + name: {{ .Values.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.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.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.name | default .Release.Name }}-follower redis_setup_type: cluster role: follower ports: diff --git a/charts/redis-cluster/templates/follower-sm.yaml b/charts/redis-cluster/templates/follower-sm.yaml index 18ffaead..56719c71 100644 --- a/charts/redis-cluster/templates/follower-sm.yaml +++ b/charts/redis-cluster/templates/follower-sm.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Release.Name }}-follower-prometheus-monitoring + name: {{ .Values.name | default .Release.Name }}-follower-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: selector: matchLabels: - app: {{ .Release.Name }}-follower + app: {{ .Values.name | default .Release.Name }}-follower redis_setup_type: cluster role: follower endpoints: diff --git a/charts/redis-cluster/templates/leader-service.yaml b/charts/redis-cluster/templates/leader-service.yaml index 05f459ac..e628fd1b 100644 --- a/charts/redis-cluster/templates/leader-service.yaml +++ b/charts/redis-cluster/templates/leader-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-leader-external-service + name: {{ .Values.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.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.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.name | default .Release.Name }}-leader redis_setup_type: cluster role: leader ports: diff --git a/charts/redis-cluster/templates/leader-sm.yaml b/charts/redis-cluster/templates/leader-sm.yaml index 58d4f2a0..98d2ac03 100644 --- a/charts/redis-cluster/templates/leader-sm.yaml +++ b/charts/redis-cluster/templates/leader-sm.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Release.Name }}-leader-prometheus-monitoring + name: {{ .Values.name | default .Release.Name }}-leader-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: selector: matchLabels: - app: {{ .Release.Name }}-leader + app: {{ .Values.name | default .Release.Name }}-leader redis_setup_type: cluster role: leader endpoints: diff --git a/charts/redis-cluster/templates/redis-cluster.yaml b/charts/redis-cluster/templates/redis-cluster.yaml index 5cf55ba5..46b21c90 100644 --- a/charts/redis-cluster/templates/redis-cluster.yaml +++ b/charts/redis-cluster/templates/redis-cluster.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: - name: {{ .Release.Name }} + name: {{ .Values.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisCluster.clusterSize }} @@ -13,14 +13,14 @@ spec: replicas: {{ .Values.redisCluster.leader.replicas }} {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.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.name | default .Release.Name }}-ext-config" {{- end }} redisExporter: diff --git a/charts/redis-cluster/values.yaml b/charts/redis-cluster/values.yaml index b5ed2c56..e61b5398 100644 --- a/charts/redis-cluster/values.yaml +++ b/charts/redis-cluster/values.yaml @@ -68,6 +68,9 @@ redisCluster: maxUnavailable: 1 minAvailable: 1 +# Overwite name for resources +# name: "" + labels: {} # foo: bar # test: echo diff --git a/charts/redis-replication/templates/extra-config.yaml b/charts/redis-replication/templates/extra-config.yaml index e751f561..19612600 100644 --- a/charts/redis-replication/templates/extra-config.yaml +++ b/charts/redis-replication/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-ext-config + name: {{ .Values.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-replication/templates/redis-replication.yaml b/charts/redis-replication/templates/redis-replication.yaml index 4e65b553..a1a297e8 100644 --- a/charts/redis-replication/templates/redis-replication.yaml +++ b/charts/redis-replication/templates/redis-replication.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: - name: {{ .Release.Name }} + name: {{ .Values.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisReplication.clusterSize }} @@ -37,7 +37,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.storageSpec }} storage: {{ toYaml .Values.storageSpec | nindent 4 }} diff --git a/charts/redis-replication/templates/replication-service.yaml b/charts/redis-replication/templates/replication-service.yaml index 71dc4419..175cfeb2 100644 --- a/charts/redis-replication/templates/replication-service.yaml +++ b/charts/redis-replication/templates/replication-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-external-service + name: {{ .Values.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.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.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.name | default .Release.Name }} redis_setup_type: replication role: replication ports: diff --git a/charts/redis-replication/templates/servicemonitor.yaml b/charts/redis-replication/templates/servicemonitor.yaml index 465636c7..1a95f5ed 100644 --- a/charts/redis-replication/templates/servicemonitor.yaml +++ b/charts/redis-replication/templates/servicemonitor.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Release.Name }}-prometheus-monitoring + name: {{ .Values.name | default .Release.Name }}-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: selector: matchLabels: - app: {{ .Release.Name }} + app: {{ .Values.name | default .Release.Name }} redis_setup_type: replication role: replication endpoints: diff --git a/charts/redis-replication/values.yaml b/charts/redis-replication/values.yaml index 644ef8b9..7eee8c96 100644 --- a/charts/redis-replication/values.yaml +++ b/charts/redis-replication/values.yaml @@ -20,6 +20,9 @@ redisReplication: ignoreAnnotations: [] # - "redis.opstreelabs.in/ignore" +# Overwite name for resources +# name: "" + labels: {} # foo: bar # test: echo diff --git a/charts/redis-sentinel/templates/extra-config.yaml b/charts/redis-sentinel/templates/extra-config.yaml index cf2c1069..9a57ceee 100644 --- a/charts/redis-sentinel/templates/extra-config.yaml +++ b/charts/redis-sentinel/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-ext-config + name: {{ .Values.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-sentinel/templates/redis-sentinel.yaml b/charts/redis-sentinel/templates/redis-sentinel.yaml index 1fab60a9..92c95486 100644 --- a/charts/redis-sentinel/templates/redis-sentinel.yaml +++ b/charts/redis-sentinel/templates/redis-sentinel.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisSentinel metadata: - name: {{ .Release.Name }} + name: {{ .Values.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisSentinel.clusterSize }} @@ -16,7 +16,7 @@ spec: failoverTimeout: {{ .Values.redisSentinelConfig.failoverTimeout | default "180000" | quote}} downAfterMilliseconds: {{ .Values.redisSentinelConfig.downAfterMilliseconds | default "30000" | quote}} {{- if eq .Values.externalConfig.enabled true }} - additionalSentinelConfig: {{ .Release.Name }}-ext-config + additionalSentinelConfig: {{ .Values.name | default .Release.Name }}-ext-config {{- end }} kubernetesConfig: @@ -50,7 +50,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }} diff --git a/charts/redis-sentinel/templates/service.yaml b/charts/redis-sentinel/templates/service.yaml index 5c3d3c19..2e764423 100644 --- a/charts/redis-sentinel/templates/service.yaml +++ b/charts/redis-sentinel/templates/service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-external-service + name: {{ .Values.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.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.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.name | default .Release.Name }} redis_setup_type: sentinel role: sentinel ports: diff --git a/charts/redis-sentinel/values.yaml b/charts/redis-sentinel/values.yaml index 51757eba..4ece0904 100644 --- a/charts/redis-sentinel/values.yaml +++ b/charts/redis-sentinel/values.yaml @@ -20,6 +20,9 @@ redisSentinel: ignoreAnnotations: [] # - "redis.opstreelabs.in/ignore" +# Overwite name for resources +# name: "" + labels: {} # foo: bar # test: echo diff --git a/charts/redis/README.md b/charts/redis/README.md index 45485e8f..69f9a196 100644 --- a/charts/redis/README.md +++ b/charts/redis/README.md @@ -37,6 +37,7 @@ helm delete --namespace | `redisStandalone.imagePullPolicy` | IfNotPresent | Image Pull Policy of the redis image | | `redisStandalone.serviceType` | ClusterIP | Kubernetes service type for Redis | | `redisStandalone.resources` | {} | Request and limits for redis statefulset | +| `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 | diff --git a/charts/redis/templates/_helpers.tpl b/charts/redis/templates/_helpers.tpl index cfc58681..e95ef45d 100644 --- a/charts/redis/templates/_helpers.tpl +++ b/charts/redis/templates/_helpers.tpl @@ -2,10 +2,10 @@ {{/* Define common labels */}} {{- define "common.labels" -}} -app.kubernetes.io/name: {{ .Release.Name }} +app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware {{- if .Values.labels }} diff --git a/charts/redis/templates/extra-config.yaml b/charts/redis/templates/extra-config.yaml index e751f561..19612600 100644 --- a/charts/redis/templates/extra-config.yaml +++ b/charts/redis/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Release.Name }}-ext-config + name: {{ .Values.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis/templates/redis-standalone.yaml b/charts/redis/templates/redis-standalone.yaml index c69fa5c3..b0b45105 100644 --- a/charts/redis/templates/redis-standalone.yaml +++ b/charts/redis/templates/redis-standalone.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: - name: {{ .Release.Name }} + name: {{ .Values.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: kubernetesConfig: @@ -36,7 +36,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.storageSpec }} storage: {{ toYaml .Values.storageSpec | nindent 4 }} diff --git a/charts/redis/templates/service.yaml b/charts/redis/templates/service.yaml index 46b2310a..1387d6a0 100644 --- a/charts/redis/templates/service.yaml +++ b/charts/redis/templates/service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Release.Name }}-external-service + name: {{ .Values.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.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.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.name | default .Release.Name }} redis_setup_type: standalone role: standalone ports: diff --git a/charts/redis/templates/servicemonitor.yaml b/charts/redis/templates/servicemonitor.yaml index 1e5a6b01..9c5d2f09 100644 --- a/charts/redis/templates/servicemonitor.yaml +++ b/charts/redis/templates/servicemonitor.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Release.Name }}-prometheus-monitoring + name: {{ .Values.name | default .Release.Name }}-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Release.Name }} + app.kubernetes.io/name: {{ .Values.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.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: selector: matchLabels: - app: {{ .Release.Name }} + app: {{ .Values.name | default .Release.Name }} redis_setup_type: standalone role: standalone endpoints: diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 17ce72e9..88bc01e9 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -19,6 +19,9 @@ redisStandalone: ignoreAnnotations: [] # - "redis.opstreelabs.in/ignore" +# Overwite name for resources +# name: "" + labels: {} # foo: bar # test: echo From a294368274797a938c06ccb33df53dd6c567d3ab Mon Sep 17 00:00:00 2001 From: EStork09 Date: Wed, 18 Oct 2023 11:38:16 +0000 Subject: [PATCH 3/6] Bumpped versions Signed-off-by: EStork09 --- charts/redis-cluster/Chart.yaml | 2 +- charts/redis-replication/Chart.yaml | 2 +- charts/redis-sentinel/Chart.yaml | 2 +- charts/redis/Chart.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/redis-cluster/Chart.yaml b/charts/redis-cluster/Chart.yaml index c49e1704..cfe4e8a0 100644 --- a/charts/redis-cluster/Chart.yaml +++ b/charts/redis-cluster/Chart.yaml @@ -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: diff --git a/charts/redis-replication/Chart.yaml b/charts/redis-replication/Chart.yaml index 9bd4ce09..b4edfebd 100644 --- a/charts/redis-replication/Chart.yaml +++ b/charts/redis-replication/Chart.yaml @@ -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: diff --git a/charts/redis-sentinel/Chart.yaml b/charts/redis-sentinel/Chart.yaml index e290d519..2f5803d7 100644 --- a/charts/redis-sentinel/Chart.yaml +++ b/charts/redis-sentinel/Chart.yaml @@ -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: diff --git a/charts/redis/Chart.yaml b/charts/redis/Chart.yaml index 1eb4a455..95148d13 100644 --- a/charts/redis/Chart.yaml +++ b/charts/redis/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: redis 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: From 5e470700258d714152d02a5a002fc4fc322f544f Mon Sep 17 00:00:00 2001 From: EStork09 Date: Wed, 18 Oct 2023 11:51:53 +0000 Subject: [PATCH 4/6] Moved fields for name under specific configuration Signed-off-by: EStork09 --- charts/redis-cluster/README.md | 2 +- charts/redis-cluster/templates/_helpers.tpl | 4 ++-- charts/redis-cluster/templates/extra-config.yaml | 6 +++--- charts/redis-cluster/templates/follower-service.yaml | 8 ++++---- charts/redis-cluster/templates/follower-sm.yaml | 8 ++++---- charts/redis-cluster/templates/leader-service.yaml | 8 ++++---- charts/redis-cluster/templates/leader-sm.yaml | 8 ++++---- charts/redis-cluster/templates/redis-cluster.yaml | 6 +++--- charts/redis-cluster/values.yaml | 4 +--- charts/redis-replication/templates/extra-config.yaml | 6 +++--- charts/redis-replication/templates/redis-replication.yaml | 4 ++-- .../redis-replication/templates/replication-service.yaml | 8 ++++---- charts/redis-replication/templates/servicemonitor.yaml | 8 ++++---- charts/redis-replication/values.yaml | 1 + charts/redis-sentinel/templates/extra-config.yaml | 6 +++--- charts/redis-sentinel/templates/redis-sentinel.yaml | 6 +++--- charts/redis-sentinel/templates/service.yaml | 8 ++++---- charts/redis-sentinel/values.yaml | 1 + charts/redis/README.md | 2 +- charts/redis/templates/_helpers.tpl | 4 ++-- charts/redis/templates/extra-config.yaml | 6 +++--- charts/redis/templates/redis-standalone.yaml | 4 ++-- charts/redis/templates/service.yaml | 8 ++++---- charts/redis/templates/servicemonitor.yaml | 8 ++++---- charts/redis/values.yaml | 4 +--- 25 files changed, 68 insertions(+), 70 deletions(-) diff --git a/charts/redis-cluster/README.md b/charts/redis-cluster/README.md index 64916d9d..73363700 100644 --- a/charts/redis-cluster/README.md +++ b/charts/redis-cluster/README.md @@ -43,7 +43,7 @@ helm delete --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 | -| `name` | "" | Overwrites the name for the charts resources instead of the Release name | +| `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 | diff --git a/charts/redis-cluster/templates/_helpers.tpl b/charts/redis-cluster/templates/_helpers.tpl index d8ffb023..0dd154eb 100644 --- a/charts/redis-cluster/templates/_helpers.tpl +++ b/charts/redis-cluster/templates/_helpers.tpl @@ -2,10 +2,10 @@ {{/* Define common labels */}} {{- define "common.labels" -}} -app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .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 }} diff --git a/charts/redis-cluster/templates/extra-config.yaml b/charts/redis-cluster/templates/extra-config.yaml index 19612600..755c4d36 100644 --- a/charts/redis-cluster/templates/extra-config.yaml +++ b/charts/redis-cluster/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.name | default .Release.Name }}-ext-config + name: {{ .Values.redisCluster.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisCluster.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-cluster/templates/follower-service.yaml b/charts/redis-cluster/templates/follower-service.yaml index f97107ca..6fa64552 100644 --- a/charts/redis-cluster/templates/follower-service.yaml +++ b/charts/redis-cluster/templates/follower-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }}-follower + app: {{ .Values.redisCluster.name | default .Release.Name }}-follower redis_setup_type: cluster role: follower ports: diff --git a/charts/redis-cluster/templates/follower-sm.yaml b/charts/redis-cluster/templates/follower-sm.yaml index 56719c71..c1f19977 100644 --- a/charts/redis-cluster/templates/follower-sm.yaml +++ b/charts/redis-cluster/templates/follower-sm.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Values.name | default .Release.Name }}-follower-prometheus-monitoring + name: {{ .Values.redisCluster.name | default .Release.Name }}-follower-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }}-follower + app: {{ .Values.redisCluster.name | default .Release.Name }}-follower redis_setup_type: cluster role: follower endpoints: diff --git a/charts/redis-cluster/templates/leader-service.yaml b/charts/redis-cluster/templates/leader-service.yaml index e628fd1b..e7cedd86 100644 --- a/charts/redis-cluster/templates/leader-service.yaml +++ b/charts/redis-cluster/templates/leader-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }}-leader + app: {{ .Values.redisCluster.name | default .Release.Name }}-leader redis_setup_type: cluster role: leader ports: diff --git a/charts/redis-cluster/templates/leader-sm.yaml b/charts/redis-cluster/templates/leader-sm.yaml index 98d2ac03..1fabfab1 100644 --- a/charts/redis-cluster/templates/leader-sm.yaml +++ b/charts/redis-cluster/templates/leader-sm.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Values.name | default .Release.Name }}-leader-prometheus-monitoring + name: {{ .Values.redisCluster.name | default .Release.Name }}-leader-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }}-leader + app: {{ .Values.redisCluster.name | default .Release.Name }}-leader redis_setup_type: cluster role: leader endpoints: diff --git a/charts/redis-cluster/templates/redis-cluster.yaml b/charts/redis-cluster/templates/redis-cluster.yaml index 46b21c90..a8140e7b 100644 --- a/charts/redis-cluster/templates/redis-cluster.yaml +++ b/charts/redis-cluster/templates/redis-cluster.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisCluster metadata: - name: {{ .Values.name | default .Release.Name }} + name: {{ .Values.redisCluster.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisCluster.clusterSize }} @@ -13,14 +13,14 @@ spec: replicas: {{ .Values.redisCluster.leader.replicas }} {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Values.name | default .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: "{{ .Values.name | default .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.redisCluster.name | default .Release.Name }}-ext-config" {{- end }} redisExporter: diff --git a/charts/redis-cluster/values.yaml b/charts/redis-cluster/values.yaml index e61b5398..1cd8755e 100644 --- a/charts/redis-cluster/values.yaml +++ b/charts/redis-cluster/values.yaml @@ -1,5 +1,6 @@ --- redisCluster: + name: "" clusterSize: 3 clusterVersion: v7 persistenceEnabled: true @@ -68,9 +69,6 @@ redisCluster: maxUnavailable: 1 minAvailable: 1 -# Overwite name for resources -# name: "" - labels: {} # foo: bar # test: echo diff --git a/charts/redis-replication/templates/extra-config.yaml b/charts/redis-replication/templates/extra-config.yaml index 19612600..d143cdb2 100644 --- a/charts/redis-replication/templates/extra-config.yaml +++ b/charts/redis-replication/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.name | default .Release.Name }}-ext-config + name: {{ .Values.redisReplication.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisReplication.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-replication/templates/redis-replication.yaml b/charts/redis-replication/templates/redis-replication.yaml index a1a297e8..0939c5ab 100644 --- a/charts/redis-replication/templates/redis-replication.yaml +++ b/charts/redis-replication/templates/redis-replication.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisReplication metadata: - name: {{ .Values.name | default .Release.Name }} + name: {{ .Values.redisReplication.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisReplication.clusterSize }} @@ -37,7 +37,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.redisReplication.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.storageSpec }} storage: {{ toYaml .Values.storageSpec | nindent 4 }} diff --git a/charts/redis-replication/templates/replication-service.yaml b/charts/redis-replication/templates/replication-service.yaml index 175cfeb2..f9a3a7e0 100644 --- a/charts/redis-replication/templates/replication-service.yaml +++ b/charts/redis-replication/templates/replication-service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app: {{ .Values.redisReplication.name | default .Release.Name }} redis_setup_type: replication role: replication ports: diff --git a/charts/redis-replication/templates/servicemonitor.yaml b/charts/redis-replication/templates/servicemonitor.yaml index 1a95f5ed..1eaef343 100644 --- a/charts/redis-replication/templates/servicemonitor.yaml +++ b/charts/redis-replication/templates/servicemonitor.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Values.name | default .Release.Name }}-prometheus-monitoring + name: {{ .Values.redisReplication.name | default .Release.Name }}-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app: {{ .Values.redisReplication.name | default .Release.Name }} redis_setup_type: replication role: replication endpoints: diff --git a/charts/redis-replication/values.yaml b/charts/redis-replication/values.yaml index 7eee8c96..8a5671fd 100644 --- a/charts/redis-replication/values.yaml +++ b/charts/redis-replication/values.yaml @@ -1,5 +1,6 @@ --- redisReplication: + name: "" clusterSize: 3 image: quay.io/opstree/redis tag: v7.0.12 diff --git a/charts/redis-sentinel/templates/extra-config.yaml b/charts/redis-sentinel/templates/extra-config.yaml index 9a57ceee..400fc3c5 100644 --- a/charts/redis-sentinel/templates/extra-config.yaml +++ b/charts/redis-sentinel/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.name | default .Release.Name }}-ext-config + name: {{ .Values.redisSentinel.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisSentinel.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis-sentinel/templates/redis-sentinel.yaml b/charts/redis-sentinel/templates/redis-sentinel.yaml index 92c95486..d0e4951e 100644 --- a/charts/redis-sentinel/templates/redis-sentinel.yaml +++ b/charts/redis-sentinel/templates/redis-sentinel.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: RedisSentinel metadata: - name: {{ .Values.name | default .Release.Name }} + name: {{ .Values.redisSentinel.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: clusterSize: {{ .Values.redisSentinel.clusterSize }} @@ -16,7 +16,7 @@ spec: failoverTimeout: {{ .Values.redisSentinelConfig.failoverTimeout | default "180000" | quote}} downAfterMilliseconds: {{ .Values.redisSentinelConfig.downAfterMilliseconds | default "30000" | quote}} {{- if eq .Values.externalConfig.enabled true }} - additionalSentinelConfig: {{ .Values.name | default .Release.Name }}-ext-config + additionalSentinelConfig: {{ .Values.redisSentinel.name | default .Release.Name }}-ext-config {{- end }} kubernetesConfig: @@ -50,7 +50,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.redisSentinel.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | nindent 4 }} diff --git a/charts/redis-sentinel/templates/service.yaml b/charts/redis-sentinel/templates/service.yaml index 2e764423..112da8b0 100644 --- a/charts/redis-sentinel/templates/service.yaml +++ b/charts/redis-sentinel/templates/service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.name | default .Release.Name }}-external-service + name: {{ .Values.redisSentinel.name | default .Release.Name }}-external-service {{- if .Values.externalService.annotations }} annotations: {{ toYaml .Values.externalService.annotations | indent 4 }} {{- end }} labels: - app.kubernetes.io/name: {{ .Values.name | default .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: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisSentinel.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: type: {{ .Values.externalService.serviceType }} selector: - app: {{ .Values.name | default .Release.Name }} + app: {{ .Values.redisSentinel.name | default .Release.Name }} redis_setup_type: sentinel role: sentinel ports: diff --git a/charts/redis-sentinel/values.yaml b/charts/redis-sentinel/values.yaml index 4ece0904..43d8c86a 100644 --- a/charts/redis-sentinel/values.yaml +++ b/charts/redis-sentinel/values.yaml @@ -1,5 +1,6 @@ --- redisSentinel: + name: "" clusterSize: 3 image: quay.io/opstree/redis-sentinel tag: v7.0.12 diff --git a/charts/redis/README.md b/charts/redis/README.md index 69f9a196..a506943c 100644 --- a/charts/redis/README.md +++ b/charts/redis/README.md @@ -37,7 +37,7 @@ helm delete --namespace | `redisStandalone.imagePullPolicy` | IfNotPresent | Image Pull Policy of the redis image | | `redisStandalone.serviceType` | ClusterIP | Kubernetes service type for Redis | | `redisStandalone.resources` | {} | Request and limits for redis statefulset | -| `name` | "" | Overwrites the name for the charts resources instead of the Release name | +| `redisStandalone.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 | diff --git a/charts/redis/templates/_helpers.tpl b/charts/redis/templates/_helpers.tpl index e95ef45d..698c901e 100644 --- a/charts/redis/templates/_helpers.tpl +++ b/charts/redis/templates/_helpers.tpl @@ -2,10 +2,10 @@ {{/* Define common labels */}} {{- define "common.labels" -}} -app.kubernetes.io/name: {{ .Values.name | default .Release.Name }} +app.kubernetes.io/name: {{ .Values.redisStandalone.name | default .Release.Name }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} -app.kubernetes.io/instance: {{ .Values.name | default .Release.Name }} +app.kubernetes.io/instance: {{ .Values.redisStandalone.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware {{- if .Values.labels }} diff --git a/charts/redis/templates/extra-config.yaml b/charts/redis/templates/extra-config.yaml index 19612600..d1eb804d 100644 --- a/charts/redis/templates/extra-config.yaml +++ b/charts/redis/templates/extra-config.yaml @@ -3,12 +3,12 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ .Values.name | default .Release.Name }}-ext-config + name: {{ .Values.redisStandalone.name | default .Release.Name }}-ext-config labels: - app.kubernetes.io/name: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/name: {{ .Values.redisStandalone.name | default .Release.Name }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisStandalone.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware data: diff --git a/charts/redis/templates/redis-standalone.yaml b/charts/redis/templates/redis-standalone.yaml index b0b45105..d1e932e6 100644 --- a/charts/redis/templates/redis-standalone.yaml +++ b/charts/redis/templates/redis-standalone.yaml @@ -2,7 +2,7 @@ apiVersion: redis.redis.opstreelabs.in/v1beta2 kind: Redis metadata: - name: {{ .Values.name | default .Release.Name }} + name: {{ .Values.redisStandalone.name | default .Release.Name }} labels: {{- include "common.labels" . | nindent 4 }} spec: kubernetesConfig: @@ -36,7 +36,7 @@ spec: {{- if .Values.externalConfig.enabled }} redisConfig: - additionalRedisConfig: "{{ .Values.name | default .Release.Name }}-ext-config" + additionalRedisConfig: "{{ .Values.redisStandalone.name | default .Release.Name }}-ext-config" {{- end }} {{- if .Values.storageSpec }} storage: {{ toYaml .Values.storageSpec | nindent 4 }} diff --git a/charts/redis/templates/service.yaml b/charts/redis/templates/service.yaml index 1387d6a0..32e98cb8 100644 --- a/charts/redis/templates/service.yaml +++ b/charts/redis/templates/service.yaml @@ -3,22 +3,22 @@ apiVersion: v1 kind: Service metadata: - name: {{ .Values.name | default .Release.Name }}-external-service + name: {{ .Values.redisStandalone.name | default .Release.Name }}-external-service {{- if .Values.externalService.annotations }} annotations: {{ toYaml .Values.externalService.annotations | indent 4 }} {{- end }} labels: - app.kubernetes.io/name: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/name: {{ .Values.redisStandalone.name | default .Release.Name }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisStandalone.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: type: {{ .Values.externalService.serviceType }} selector: - app: {{ .Values.name | default .Release.Name }} + app: {{ .Values.redisStandalone.name | default .Release.Name }} redis_setup_type: standalone role: standalone ports: diff --git a/charts/redis/templates/servicemonitor.yaml b/charts/redis/templates/servicemonitor.yaml index 9c5d2f09..883f16b5 100644 --- a/charts/redis/templates/servicemonitor.yaml +++ b/charts/redis/templates/servicemonitor.yaml @@ -3,18 +3,18 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: - name: {{ .Values.name | default .Release.Name }}-prometheus-monitoring + name: {{ .Values.redisStandalone.name | default .Release.Name }}-prometheus-monitoring labels: - app.kubernetes.io/name: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/name: {{ .Values.redisStandalone.name | default .Release.Name }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Values.name | default .Release.Name }} + app.kubernetes.io/instance: {{ .Values.redisStandalone.name | default .Release.Name }} app.kubernetes.io/version: {{ .Chart.AppVersion }} app.kubernetes.io/component: middleware spec: selector: matchLabels: - app: {{ .Values.name | default .Release.Name }} + app: {{ .Values.redisStandalone.name | default .Release.Name }} redis_setup_type: standalone role: standalone endpoints: diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 88bc01e9..860db591 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -1,5 +1,6 @@ --- redisStandalone: + name: "" image: quay.io/opstree/redis tag: v7.0.12 imagePullPolicy: IfNotPresent @@ -19,9 +20,6 @@ redisStandalone: ignoreAnnotations: [] # - "redis.opstreelabs.in/ignore" -# Overwite name for resources -# name: "" - labels: {} # foo: bar # test: echo From 7cf14a0a6cdcc8a6129a71767e2a95b0935744bf Mon Sep 17 00:00:00 2001 From: EStork09 Date: Wed, 18 Oct 2023 12:06:40 +0000 Subject: [PATCH 5/6] Adjusted values.yaml to address linting report Signed-off-by: EStork09 --- charts/redis-cluster/values.yaml | 14 +++++++------- charts/redis-replication/values.yaml | 10 +++++----- charts/redis/values.yaml | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/charts/redis-cluster/values.yaml b/charts/redis-cluster/values.yaml index 1cd8755e..4e77a20d 100644 --- a/charts/redis-cluster/values.yaml +++ b/charts/redis-cluster/values.yaml @@ -38,7 +38,7 @@ redisCluster: # effect: "NoSchedule" nodeSelector: null # memory: medium - securityContext : {} + securityContext: {} pdb: enabled: false maxUnavailable: 1 @@ -63,7 +63,7 @@ redisCluster: # effect: "NoSchedule" nodeSelector: null # memory: medium - securityContext : {} + securityContext: {} pdb: enabled: false maxUnavailable: 1 @@ -126,7 +126,7 @@ sidecars: # value: "my-env-var-value" initContainer: - enabled: false + enabled: false image: "" imagePullPolicy: "IfNotPresent" resources: {} @@ -173,12 +173,12 @@ TLS: secret: secretName: "" -acl : - secret : +acl: + secret: secretName: "" -env : [] +env: [] # - name: VAR_NAME # value: "value1" -serviceAccountName : "" \ No newline at end of file +serviceAccountName: "" diff --git a/charts/redis-replication/values.yaml b/charts/redis-replication/values.yaml index 8a5671fd..4d4b0dbb 100644 --- a/charts/redis-replication/values.yaml +++ b/charts/redis-replication/values.yaml @@ -65,7 +65,7 @@ redisExporter: # value: "value1" initContainer: - enabled: false + enabled: false image: "" imagePullPolicy: "IfNotPresent" resources: {} @@ -113,7 +113,7 @@ podSecurityContext: runAsUser: 1000 fsGroup: 1000 -securityContext : {} +securityContext: {} affinity: {} # nodeAffinity: @@ -140,10 +140,10 @@ TLS: secret: secretName: "" -acl : - secret : +acl: + secret: secretName: "" -env : [] +env: [] # - name: VAR_NAME # value: "value1" diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index 860db591..d081e21d 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -61,7 +61,7 @@ redisExporter: # value: "value1" initContainer: - enabled: false + enabled: false image: "" imagePullPolicy: "IfNotPresent" resources: {} @@ -109,7 +109,7 @@ podSecurityContext: runAsUser: 1000 fsGroup: 1000 -securityContext : {} +securityContext: {} affinity: {} # nodeAffinity: @@ -127,7 +127,7 @@ tolerations: [] # value: "value" # effect: "NoSchedule" -serviceAccountName : "" +serviceAccountName: "" TLS: ca: ca.key @@ -136,10 +136,10 @@ TLS: secret: secretName: "" -acl : - secret : +acl: + secret: secretName: "" env : [] # - name: VAR_NAME - # value: "value1" \ No newline at end of file + # value: "value1" From 717efeea32853ef28a2238b4fca181c326160bfc Mon Sep 17 00:00:00 2001 From: EStork09 Date: Wed, 18 Oct 2023 12:14:59 +0000 Subject: [PATCH 6/6] Addressed linting errors Signed-off-by: EStork09 --- charts/redis-replication/values.yaml | 2 +- charts/redis/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/redis-replication/values.yaml b/charts/redis-replication/values.yaml index 4d4b0dbb..b2afb5ca 100644 --- a/charts/redis-replication/values.yaml +++ b/charts/redis-replication/values.yaml @@ -131,7 +131,7 @@ tolerations: [] # value: "value" # effect: "NoSchedule" -serviceAccountName : "" +serviceAccountName: "" TLS: ca: ca.key diff --git a/charts/redis/values.yaml b/charts/redis/values.yaml index d081e21d..e929a2eb 100644 --- a/charts/redis/values.yaml +++ b/charts/redis/values.yaml @@ -140,6 +140,6 @@ acl: secret: secretName: "" -env : [] +env: [] # - name: VAR_NAME # value: "value1"