mirror of
https://github.com/bitnami/containers.git
synced 2026-03-10 15:09:17 +08:00
[bitnami/redis] Added support for hostname announcement in cluster setup (#26832)
* feat(): Added support for hostname announcement in cluster Signed-off-by: Devesh Kumar <devesh.kumar@widas.in> * fix(): Fixed typo in readme file Signed-off-by: Devesh Kumar <devesh.kumar@widas.in> --------- Signed-off-by: Devesh Kumar <devesh.kumar@widas.in> Co-authored-by: Devesh Kumar <devesh.kumar@widas.in>
This commit is contained in:
@@ -87,10 +87,16 @@ redis_cluster_override_conf() {
|
||||
# Always set the announce-ip to avoid issues when using proxies and traffic restrictions.
|
||||
redis_conf_set cluster-announce-ip "$(get_machine_ip)"
|
||||
fi
|
||||
if ! is_empty_value "$REDIS_CLUSTER_ANNOUNCE_HOSTNAME"; then
|
||||
redis_conf_set "cluster-announce-hostname" "$REDIS_CLUSTER_ANNOUNCE_HOSTNAME"
|
||||
fi
|
||||
if ! is_empty_value "$REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE"; then
|
||||
redis_conf_set "cluster-preferred-endpoint-type" "$REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE"
|
||||
fi
|
||||
if is_boolean_yes "$REDIS_TLS_ENABLED"; then
|
||||
redis_conf_set tls-cluster yes
|
||||
redis_conf_set tls-replication yes
|
||||
fi
|
||||
fi
|
||||
if ! is_empty_value "$REDIS_CLUSTER_ANNOUNCE_PORT"; then
|
||||
redis_conf_set "cluster-announce-port" "$REDIS_CLUSTER_ANNOUNCE_PORT"
|
||||
fi
|
||||
|
||||
@@ -55,6 +55,8 @@ redis_cluster_env_vars=(
|
||||
REDIS_CLUSTER_ANNOUNCE_IP
|
||||
REDIS_CLUSTER_ANNOUNCE_PORT
|
||||
REDIS_CLUSTER_ANNOUNCE_BUS_PORT
|
||||
REDIS_CLUSTER_ANNOUNCE_HOSTNAME
|
||||
REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE
|
||||
REDIS_DNS_RETRIES
|
||||
REDIS_NODES
|
||||
REDIS_CLUSTER_SLEEP_BEFORE_DNS_LOOKUP
|
||||
@@ -132,6 +134,8 @@ export REDIS_CLUSTER_DYNAMIC_IPS="${REDIS_CLUSTER_DYNAMIC_IPS:-yes}"
|
||||
export REDIS_CLUSTER_ANNOUNCE_IP="${REDIS_CLUSTER_ANNOUNCE_IP:-}"
|
||||
export REDIS_CLUSTER_ANNOUNCE_PORT="${REDIS_CLUSTER_ANNOUNCE_PORT:-}"
|
||||
export REDIS_CLUSTER_ANNOUNCE_BUS_PORT="${REDIS_CLUSTER_ANNOUNCE_BUS_PORT:-}"
|
||||
export REDIS_CLUSTER_ANNOUNCE_HOSTNAME="${REDIS_CLUSTER_ANNOUNCE_HOSTNAME:-}"
|
||||
export REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE="${REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE:-ip}"
|
||||
export REDIS_DNS_RETRIES="${REDIS_DNS_RETRIES:-120}"
|
||||
export REDIS_NODES="${REDIS_NODES:-}"
|
||||
export REDIS_CLUSTER_SLEEP_BEFORE_DNS_LOOKUP="${REDIS_CLUSTER_SLEEP_BEFORE_DNS_LOOKUP:-0}"
|
||||
|
||||
@@ -180,8 +180,10 @@ The following env vars are supported for this container:
|
||||
| `REDIS_CLUSTER_CREATOR` | Set to `yes` if the container will be the one on charge of initialize the cluster. This node will also be part of the cluster. |
|
||||
| `REDIS_CLUSTER_REPLICAS` | Number of replicas for every master that the cluster will have. |
|
||||
| `REDIS_NODES` | String delimited by spaces containing the hostnames of all of the nodes that will be part of the cluster |
|
||||
| `REDIS_CLUSTER_ANNOUNCE_IP` | IP that the node should announce, used for non dynamic ip environents |
|
||||
| `REDIS_CLUSTER_ANNOUNCE_PORT` | Port that the node should announce, used for non dynamic ip environents. |
|
||||
| `REDIS_CLUSTER_ANNOUNCE_IP` | IP that the node should announce, used for non dynamic ip environments |
|
||||
| `REDIS_CLUSTER_ANNOUNCE_PORT` | Port that the node should announce, used for non dynamic ip environments. |
|
||||
| `REDIS_CLUSTER_ANNOUNCE_HOSTNAME` | Hostname that node should announce, used for non dynamic ip environments. |
|
||||
| `REDIS_CLUSTER_PREFERRED_ENDPOINT_TYPE` | Preferred endpoint type which cluster should use, options- ip, hostname|
|
||||
| `REDIS_CLUSTER_ANNOUNCE_BUS_PORT` | The cluster bus port to announce. |
|
||||
| `REDIS_CLUSTER_DYNAMIC_IPS` | Set to `no` if your Redis(R) cluster will be created with statical IPs. Default: `yes` |
|
||||
| `REDIS_TLS_ENABLED` | Whether to enable TLS for traffic or not. Defaults to `no`. |
|
||||
|
||||
Reference in New Issue
Block a user