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

[bitnami/redis-cluster] support external host to cluster announcement preffered type #18028

Merged
merged 7 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions bitnami/redis-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
category: Database
licenses: Apache-2.0
apiVersion: v2
appVersion: 7.0.12
appVersion: 7.0.13
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
Expand All @@ -25,4 +25,4 @@ maintainers:
name: redis-cluster
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/redis-cluster
version: 8.6.12
version: 8.6.13
yo-ga marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions bitnami/redis-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ The command removes all the Kubernetes components associated with the chart and
| `cluster.nodes` | The number of master nodes should always be >= 3, otherwise cluster creation will fail | `6` |
| `cluster.replicas` | Number of replicas for every master in the cluster | `1` |
| `cluster.externalAccess.enabled` | Enable access to the Redis | `false` |
| `cluster.externalAccess.hostMode` | Set cluster preferred endpoint type as hostname | `false` |
| `cluster.externalAccess.service.type` | Type for the services used to expose every Pod | `LoadBalancer` |
| `cluster.externalAccess.service.port` | Port for the services used to expose every Pod | `6379` |
| `cluster.externalAccess.service.loadBalancerIP` | Array of load balancer IPs for each Redis® node. Length must be the same as cluster.nodes | `[]` |
Expand Down
11 changes: 10 additions & 1 deletion bitnami/redis-cluster/templates/redis-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ spec:
pod_index=($(echo "$POD_NAME" | tr "-" "\n"))
pod_index="${pod_index[-1]}"
ips=($(echo "{{ .Values.cluster.externalAccess.service.loadBalancerIP }}" | cut -d [ -f2 | cut -d ] -f 1))
{{- if .Values.cluster.externalAccess.hostMode }}
export REDIS_CLUSTER_ANNOUNCE_HOSTNAME="${ips[$pod_index]}"
{{- else }}
export REDIS_CLUSTER_ANNOUNCE_IP="${ips[$pod_index]}"
{{- end }}
export REDIS_NODES="${ips[@]}"
{{- if .Values.cluster.init }}
if [[ "$pod_index" == "0" ]]; then
Expand Down Expand Up @@ -148,7 +152,12 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.cluster.externalAccess.enabled }}
{{- if and .Values.cluster.externalAccess.enabled .Values.cluster.externalAccess.hostMode }}
- name: REDIS_CLUSTER_DYNAMIC_IPS
value: "yes"
- name: REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE
value: "hostname"
{{- else if .Values.cluster.externalAccess.enabled }}
- name: REDIS_CLUSTER_DYNAMIC_IPS
value: "no"
{{- else }}
Expand Down
4 changes: 4 additions & 0 deletions bitnami/redis-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,10 @@ cluster:
## @param cluster.externalAccess.enabled Enable access to the Redis
##
enabled: false
## @param cluster.externalAccess.hostMode Set cluster preferred endpoint type as hostname
## ref: https://github.com/redis/redis/pull/9530
##
hostMode: false
service:
## @param cluster.externalAccess.service.type Type for the services used to expose every Pod
## At this moment only LoadBalancer is supported
Expand Down
Loading