Skip to content
Open
Show file tree
Hide file tree
Changes from 5 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
8 changes: 6 additions & 2 deletions bitnami/redis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 21.2.10 (2025-07-11)
## 22.0.0 (2025-07-15)

* [bitnami/redis] Fix external service annotations ignored #33270 ([#33776](https://github.com/bitnami/charts/pull/33776))
* [bitnami/redis] Ensure that Redis resources are less than 63 chars ([#34803](https://github.com/bitnami/charts/pull/34803))

## <small>21.2.10 (2025-07-11)</small>

* [bitnami/redis] Fix external service annotations ignored #33270 (#33776) ([cd64f12](https://github.com/bitnami/charts/commit/cd64f12492a47b8e68154737dc75460de67c5bd1)), closes [#33270](https://github.com/bitnami/charts/issues/33270) [#33776](https://github.com/bitnami/charts/issues/33776) [#33270](https://github.com/bitnami/charts/issues/33270)

## <small>21.2.9 (2025-07-09)</small>

Expand Down
2 changes: 1 addition & 1 deletion bitnami/redis/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ maintainers:
name: redis
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/redis
version: 21.2.10
version: 22.0.0
18 changes: 9 additions & 9 deletions bitnami/redis/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ For read/write operations, first access the Redis&reg; Sentinel cluster, which i

Redis&reg; can be accessed on the following DNS names from within your cluster:

{{ printf "%s-master.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.redis }})
{{ printf "%s-replicas.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.redis }})
{{ printf "%s.%s.svc.%s" (include "redis.master.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read/write operations (port {{ .Values.master.service.ports.redis }})
{{ printf "%s.%s.svc.%s" (include "redis.replicas.fullname" .) (include "common.names.namespace" . ) .Values.clusterDomain }} for read-only operations (port {{ .Values.replica.service.ports.redis }})

{{- end }}
{{- else }}

Redis&reg; can be accessed via port {{ .Values.master.service.ports.redis }} on the following DNS name from within your cluster:

{{ template "common.names.fullname" . }}-master.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
{{ template "redis.master.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}

{{- end }}

Expand Down Expand Up @@ -133,11 +133,11 @@ To connect to your Redis&reg; server:
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.redis }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Read only operations
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }} -p {{ .Values.sentinel.service.ports.sentinel }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }} # Sentinel access
{{- else }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-master" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ printf "%s-replicas" (include "common.names.fullname" .) }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ include "redis.master.fullname" . }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ include "redis.replicas.fullname" . }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{- end }}
{{- else }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ template "common.names.fullname" . }}-master{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h {{ include "redis.master.fullname" . }}{{ if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}
{{- end }}

{{- if and (.Values.networkPolicy.enabled) (not .Values.networkPolicy.allowExternal) }}
Expand Down Expand Up @@ -173,20 +173,20 @@ To connect to your database from outside the cluster execute the following comma
{{- if contains "NodePort" .Values.master.service.type }}

export NODE_IP=$(kubectl get nodes --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ printf "%s-master" (include "common.names.fullname" .) }})
export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "redis.master.fullname" . }})
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $NODE_IP -p $NODE_PORT {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}

{{- else if contains "LoadBalancer" .Values.master.service.type }}

NOTE: It may take a few minutes for the LoadBalancer IP to be available.
Watch the status with: 'kubectl get svc --namespace {{ include "common.names.namespace" . }} -w {{ template "common.names.fullname" . }}'

export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ printf "%s-master" (include "common.names.fullname" .) }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ include "redis.master.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h $SERVICE_IP -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}

{{- else if contains "ClusterIP" .Values.master.service.type }}

kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ printf "%s-master" (include "common.names.fullname" .) }} {{ .Values.master.service.ports.redis }}:{{ .Values.master.service.ports.redis }} &
kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ include "redis.master.fullname" . }} {{ .Values.master.service.ports.redis }}:{{ .Values.master.service.ports.redis }} &
{{ if .Values.auth.enabled }}REDISCLI_AUTH="$REDIS_PASSWORD" {{ end }}redis-cli -h 127.0.0.1 -p {{ .Values.master.service.ports.redis }} {{- if .Values.tls.enabled }} --tls --cert /tmp/client.cert --key /tmp/client.key --cacert /tmp/CA.cert{{ end }}

{{- end }}
Expand Down
39 changes: 39 additions & 0 deletions bitnami/redis/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,45 @@ SPDX-License-Identifier: APACHE-2.0

{{/* vim: set filetype=mustache: */}}

{{/*
Return the proper Redis master fullname.

The 0000000000 is to take into account the 10-charaters hash that the StatefulSet
appends to the name of the StatefulSet in the pod's controller-revision-hash label.
A label value can only have 63 characters.
*/}}
{{- define "redis.master.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-master-0000000000" | len)) | int) | trimSuffix "-") "master" -}}
{{- end -}}

{{/*
Return the proper Redis replicas fullname
*/}}
{{- define "redis.replicas.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-replicas-0000000000" | len)) | int) | trimSuffix "-") "replicas" -}}
{{- end -}}

{{/*
Return the proper Redis sentinel fullname
*/}}
{{- define "redis.sentinel.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-node-0000000000" | len)) | int) | trimSuffix "-") "node" -}}
{{- end -}}
Comment on lines +8 to +31
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the Service also uses this helper, it could result in it being recreated for some users. Truncating the equivalent of 0000000000 is only strictly needed for the Statefulset in reality.


{{/*
Return the proper Redis headless fullname
*/}}
{{- define "redis.headless.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-headless" | len)) | int) | trimSuffix "-") "headless" -}}
{{- end -}}
Comment on lines +33 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea and see it as a good improvement. However, all our solutions use a simpler method

Suggested change
{{/*
Return the proper Redis headless fullname
*/}}
{{- define "redis.headless.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-headless" | len)) | int) | trimSuffix "-") "headless" -}}
{{- end -}}
{{/*
Return the proper Redis headless fullname
*/}}
{{- define "redis.headless.fullname" -}}
{{ printf "%s-headless" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
{{- end -}}

I'd follow that approach here (and the other methods) too.

However, the common.names.fullname function can be improve to truncate the strings the way you are suggesting.

https://github.com/bitnami/charts/blob/main/bitnami/common/templates/_names.tpl#L26

You can update that function to accept another string to perform the "sub" method. That way, that function can be added to other charts as well and the whole community will benefit from that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I think it's a good idea, it would also change the signature of common.names.fullname in a backward incompatible manner, no? Unless conditional logic is added to common.names.fullname to accept both the current and new signature with the custom string to use to calculate the additional truncation. I don't mind doing that, but before I do, I just want to make sure if we're agreeing on the approach of having common.names.fullname handle both signatures.

Copy link
Contributor

@jotamartos jotamartos Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simply suggested to improve the function to accept a new parameter to perform the "sub" method. The function won't do anything unless you set that new parameter. You can later update the function in the Redis' chart and increase the version to a new major so we avoid issues when updating between minor versions. Sounds good?


{{/*
Return the proper Redis metrics fullname
*/}}
{{- define "redis.metrics.fullname" -}}
{{- printf "%s-%s" ((include "common.names.fullname" .) | trunc ((sub 63 ("-metrics" | len)) | int) | trimSuffix "-") "metrics" -}}
{{- end -}}

{{/*
Return the proper Redis image name
*/}}
Expand Down
2 changes: 1 addition & 1 deletion bitnami/redis/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ data:
sentinel monitor {{ .Values.sentinel.masterSet }} {{ index .Values.sentinel.externalAccess.service.loadBalancerIP 0 }} {{ .Values.sentinel.service.ports.redis }} {{ .Values.sentinel.quorum }}
{{- end }}
{{- else }}
sentinel monitor {{ .Values.sentinel.masterSet }} {{ template "common.names.fullname" . }}-node-0.{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} {{ .Values.sentinel.service.ports.redis }} {{ .Values.sentinel.quorum }}
sentinel monitor {{ .Values.sentinel.masterSet }} {{ include "redis.sentinel.fullname" . }}-0.{{ include "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }} {{ .Values.sentinel.service.ports.redis }} {{ .Values.sentinel.quorum }}
{{- end }}
sentinel down-after-milliseconds {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.downAfterMilliseconds }}
sentinel failover-timeout {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.failoverTimeout }}
Expand Down
4 changes: 2 additions & 2 deletions bitnami/redis/templates/headless-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-headless" (include "common.names.fullname" .) }}
name: {{ include "redis.headless.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if or .Values.sentinel.service.headless.annotations .Values.commonAnnotations (include "redis.externalDNS.annotations" .) }}
Expand All @@ -33,6 +33,6 @@ spec:
targetPort: redis-sentinel
{{- end }}
{{- if .Values.sentinel.service.headless.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.sentinel.service.headless.extraPorts "context" $) | nindent 4 }}
{{- include "common.tplvalues.render" (dict "value" .Values.sentinel.service.headless.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
4 changes: 2 additions & 2 deletions bitnami/redis/templates/master/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
kind: {{ .Values.master.kind }}
metadata:
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
name: {{ include "redis.master.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: master
Expand All @@ -26,7 +26,7 @@ spec:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: master
{{- if (eq .Values.master.kind "StatefulSet") }}
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
serviceName: {{ include "redis.headless.fullname" . }}
{{- end }}
{{- if .Values.master.updateStrategy }}
{{- if (eq .Values.master.kind "Deployment") }}
Expand Down
2 changes: 1 addition & 1 deletion bitnami/redis/templates/master/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-master" (include "common.names.fullname" .) }}
name: {{ include "redis.master.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: master
Expand Down
2 changes: 1 addition & 1 deletion bitnami/redis/templates/metrics-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-metrics" (include "common.names.fullname" .) }}
name: {{ include "redis.metrics.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: metrics
Expand Down
8 changes: 4 additions & 4 deletions bitnami/redis/templates/replicas/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: {{ include "common.capabilities.statefulset.apiVersion" . }}
kind: {{ .Values.replica.kind }}
metadata:
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
name: {{ include "redis.replicas.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: replica
Expand All @@ -25,7 +25,7 @@ spec:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: replica
{{- if (eq .Values.replica.kind "StatefulSet") }}
serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
serviceName: {{ include "redis.headless.fullname" . }}
{{- end }}
{{- if .Values.replica.updateStrategy }}
updateStrategy: {{- toYaml .Values.replica.updateStrategy | nindent 4 }}
Expand Down Expand Up @@ -145,9 +145,9 @@ spec:
{{- if .Values.replica.externalMaster.enabled }}
value: {{ .Values.replica.externalMaster.host | quote }}
{{- else if and (eq (int64 .Values.master.count) 1) (eq .Values.master.kind "StatefulSet") }}
value: {{ template "common.names.fullname" . }}-master-0.{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
value: {{ template "redis.master.fullname" . }}-0.{{ template "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
{{- else }}
value: {{ template "common.names.fullname" . }}-master.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
value: {{ template "redis.master.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
{{- end }}
- name: REDIS_MASTER_PORT_NUMBER
{{- if .Values.replica.externalMaster.enabled }}
Expand Down
2 changes: 1 addition & 1 deletion bitnami/redis/templates/replicas/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-replicas" (include "common.names.fullname" .) }}
name: {{ include "redis.replicas.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: replica
Expand Down
14 changes: 7 additions & 7 deletions bitnami/redis/templates/scripts-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ data:

REDISPORT=$(get_port "$HOSTNAME" "REDIS")

HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
HEADLESS_SERVICE="{{ template "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"

if [ -n "$REDIS_EXTERNAL_MASTER_HOST" ]; then
REDIS_SERVICE="$REDIS_EXTERNAL_MASTER_HOST"
Expand Down Expand Up @@ -266,7 +266,7 @@ data:
. /opt/bitnami/scripts/libvalidations.sh
. /opt/bitnami/scripts/libfile.sh

HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
HEADLESS_SERVICE="{{ template "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
REDIS_SERVICE="{{ template "common.names.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"

get_port() {
Expand Down Expand Up @@ -441,7 +441,7 @@ data:
}

for node in $(seq 0 $(({{ .Values.replica.replicaCount }}-1))); do
hostname="{{ template "common.names.fullname" . }}-node-$node"
hostname="{{ template "redis.sentinel.fullname" . }}-$node"
{{- if .Values.sentinel.externalAccess.enabled }}
{{- if .Values.sentinel.externalAccess.service.loadBalancerIP }}
ips=($(echo "$REDIS_NODES" | tr " " "\n"))
Expand Down Expand Up @@ -472,7 +472,7 @@ data:
echo "sentinel announce-ip $REDIS_CLUSTER_ANNOUNCE_IP" >> /opt/bitnami/redis-sentinel/etc/prepare-sentinel.conf
else
echo "sentinel announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/prepare-sentinel.conf
fi
fi
{{- else }}
echo "sentinel announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis-sentinel/etc/prepare-sentinel.conf
{{- end}}
Expand Down Expand Up @@ -503,7 +503,7 @@ data:
. /opt/bitnami/scripts/libvalidations.sh
. /opt/bitnami/scripts/libos.sh

HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
HEADLESS_SERVICE="{{ template "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"

get_full_hostname() {
hostname="$1"
Expand Down Expand Up @@ -586,7 +586,7 @@ data:
[[ "$REDIS_ROLE" == "master" ]]
}

HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{- include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
HEADLESS_SERVICE="{{ template "redis.headless.fullname" . }}.{{- include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"

get_full_hostname() {
hostname="$1"
Expand Down Expand Up @@ -769,7 +769,7 @@ data:
}

REDISPORT=$(get_port "$HOSTNAME" "REDIS")
HEADLESS_SERVICE="{{ template "common.names.fullname" . }}-headless.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"
HEADLESS_SERVICE="{{ template "redis.headless.fullname" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}"

[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
Expand Down
4 changes: 2 additions & 2 deletions bitnami/redis/templates/sentinel/node-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ SPDX-License-Identifier: APACHE-2.0
apiVersion: v1
kind: Service
metadata:
name: {{ template "common.names.fullname" $ }}-node-{{ $i }}
name: {{ include "redis.sentinel.fullname" $ }}-{{ $i }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $.Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
Expand Down Expand Up @@ -61,7 +61,7 @@ spec:
protocol: TCP
targetPort: {{ $.Values.replica.containerPorts.redis }}
selector:
statefulset.kubernetes.io/pod-name: {{ template "common.names.fullname" $ }}-node-{{ $i }}
statefulset.kubernetes.io/pod-name: {{ include "redis.sentinel.fullname" $ }}-{{ $i }}
---
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion bitnami/redis/templates/sentinel/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: "{{ template "common.names.fullname" . }}-master"
name: "{{ include "redis.master.fullname" . }}"
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
Expand Down
Loading
Loading