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/valkey-cluster] Release valkey-cluster-7.2.7-debian-12-r1 #73517

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions bitnami/valkey-cluster/7.2/debian-12/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

FROM docker.io/bitnami/minideb:bookworm

ARG DOWNLOADS_URL="downloads.bitnami.com/files/stacksmith"
ARG TARGETARCH

LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2024-10-04T10:43:30Z" \
org.opencontainers.image.created="2024-10-22T21:31:16Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/valkey-cluster/README.md" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.ref.name="7.2.7-debian-12-r0" \
org.opencontainers.image.ref.name="7.2.7-debian-12-r1" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/valkey-cluster" \
org.opencontainers.image.title="valkey-cluster" \
org.opencontainers.image.vendor="Broadcom, Inc." \
Expand All @@ -29,12 +30,12 @@ RUN install_packages ca-certificates curl libgomp1 libssl3 procps
RUN mkdir -p /tmp/bitnami/pkg/cache/ ; cd /tmp/bitnami/pkg/cache/ ; \
COMPONENTS=( \
"wait-for-port-1.0.8-5-linux-${OS_ARCH}-debian-12" \
"valkey-7.2.7-0-linux-${OS_ARCH}-debian-12" \
"valkey-7.2.7-4-linux-${OS_ARCH}-debian-12" \
) ; \
for COMPONENT in "${COMPONENTS[@]}"; do \
if [ ! -f "${COMPONENT}.tar.gz" ]; then \
curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz" -O ; \
curl -SsLf "https://downloads.bitnami.com/files/stacksmith/${COMPONENT}.tar.gz.sha256" -O ; \
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz" -O ; \
curl -SsLf "https://${DOWNLOADS_URL}/${COMPONENT}.tar.gz.sha256" -O ; \
fi ; \
sha256sum -c "${COMPONENT}.tar.gz.sha256" ; \
tar -zxf "${COMPONENT}.tar.gz" -C /opt/bitnami --strip-components=2 --no-same-owner --wildcards '*/files' ; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"arch": "amd64",
"distro": "debian-12",
"type": "NAMI",
"version": "7.2.7-0"
"version": "7.2.7-4"
},
"wait-for-port": {
"arch": "amd64",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,17 @@ valkey_validate() {
[[ -z "$VALKEY_PASSWORD" ]] && empty_password_error VALKEY_PASSWORD
fi
if [[ -n "$VALKEY_REPLICATION_MODE" ]]; then
if [[ "$VALKEY_REPLICATION_MODE" =~ ^(slave|replica)$ ]]; then
if [[ -n "$VALKEY_MASTER_PORT_NUMBER" ]]; then
if ! err=$(validate_port "$VALKEY_MASTER_PORT_NUMBER"); then
print_validation_error "An invalid port was specified in the environment variable VALKEY_MASTER_PORT_NUMBER: $err"
if [[ "$VALKEY_REPLICATION_MODE" = "replica" ]]; then
if [[ -n "$VALKEY_PRIMARY_PORT_NUMBER" ]]; then
if ! err=$(validate_port "$VALKEY_PRIMARY_PORT_NUMBER"); then
print_validation_error "An invalid port was specified in the environment variable VALKEY_PRIMARY_PORT_NUMBER: $err"
fi
fi
if ! is_boolean_yes "$ALLOW_EMPTY_PASSWORD" && [[ -z "$VALKEY_MASTER_PASSWORD" ]]; then
empty_password_error VALKEY_MASTER_PASSWORD
if ! is_boolean_yes "$ALLOW_EMPTY_PASSWORD" && [[ -z "$VALKEY_PRIMARY_PASSWORD" ]]; then
empty_password_error VALKEY_PRIMARY_PASSWORD
fi
elif [[ "$VALKEY_REPLICATION_MODE" != "master" ]]; then
print_validation_error "Invalid replication mode. Available options are 'master/replica'"
elif [[ "$VALKEY_REPLICATION_MODE" != "primary" ]]; then
print_validation_error "Invalid replication mode. Available options are 'primary/replica'"
fi
fi
if is_boolean_yes "$VALKEY_TLS_ENABLED"; then
Expand Down Expand Up @@ -257,32 +257,29 @@ valkey_configure_replication() {
info "Configuring replication mode"

valkey_conf_set replica-announce-ip "${VALKEY_REPLICA_IP:-$(get_machine_ip)}"
valkey_conf_set replica-announce-port "${VALKEY_REPLICA_PORT:-$VALKEY_MASTER_PORT_NUMBER}"
valkey_conf_set replica-announce-port "${VALKEY_REPLICA_PORT:-$VALKEY_PRIMARY_PORT_NUMBER}"
# Use TLS in the replication connections
if is_boolean_yes "$VALKEY_TLS_ENABLED"; then
valkey_conf_set tls-replication yes
fi
if [[ "$VALKEY_REPLICATION_MODE" = "master" ]]; then
if [[ "$VALKEY_REPLICATION_MODE" = "primary" ]]; then
if [[ -n "$VALKEY_PASSWORD" ]]; then
valkey_conf_set masterauth "$VALKEY_PASSWORD"
valkey_conf_set primaryauth "$VALKEY_PASSWORD"
fi
elif [[ "$VALKEY_REPLICATION_MODE" =~ ^(slave|replica)$ ]]; then
elif [[ "$VALKEY_REPLICATION_MODE" = "replica" ]]; then
if [[ -n "$VALKEY_SENTINEL_HOST" ]]; then
local -a sentinel_info_command=("valkey-cli" "-h" "${VALKEY_SENTINEL_HOST}" "-p" "${VALKEY_SENTINEL_PORT_NUMBER}")
is_boolean_yes "$VALKEY_TLS_ENABLED" && sentinel_info_command+=("--tls" "--cert" "${VALKEY_TLS_CERT_FILE}" "--key" "${VALKEY_TLS_KEY_FILE}")
# shellcheck disable=SC2015
is_empty_value "$VALKEY_TLS_CA_FILE" && sentinel_info_command+=("--cacertdir" "${VALKEY_TLS_CA_DIR}") || sentinel_info_command+=("--cacert" "${VALKEY_TLS_CA_FILE}")
sentinel_info_command+=("sentinel" "get-master-addr-by-name" "${VALKEY_SENTINEL_MASTER_NAME}")
sentinel_info_command+=("sentinel" "get-master-addr-by-name" "${VALKEY_SENTINEL_PRIMARY_NAME}")
read -r -a VALKEY_SENTINEL_INFO <<< "$("${sentinel_info_command[@]}" | tr '\n' ' ')"
VALKEY_MASTER_HOST=${VALKEY_SENTINEL_INFO[0]}
VALKEY_MASTER_PORT_NUMBER=${VALKEY_SENTINEL_INFO[1]}
VALKEY_PRIMARY_HOST=${VALKEY_SENTINEL_INFO[0]}
VALKEY_PRIMARY_PORT_NUMBER=${VALKEY_SENTINEL_INFO[1]}
fi
wait-for-port --host "$VALKEY_MASTER_HOST" "$VALKEY_MASTER_PORT_NUMBER"
[[ -n "$VALKEY_MASTER_PASSWORD" ]] && valkey_conf_set masterauth "$VALKEY_MASTER_PASSWORD"
# Starting with Valkey 5, use 'replicaof' instead of 'slaveof'. Maintaining both for backward compatibility
local parameter="replicaof"
[[ $(valkey_major_version) -lt 5 ]] && parameter="slaveof"
valkey_conf_set "$parameter" "$VALKEY_MASTER_HOST $VALKEY_MASTER_PORT_NUMBER"
wait-for-port --host "$VALKEY_PRIMARY_HOST" "$VALKEY_PRIMARY_PORT_NUMBER"
[[ -n "$VALKEY_PRIMARY_PASSWORD" ]] && valkey_conf_set primaryauth "$VALKEY_PRIMARY_PASSWORD"
valkey_conf_set "replicaof" "$VALKEY_PRIMARY_HOST $VALKEY_PRIMARY_PORT_NUMBER"
fi
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ valkey_cluster_env_vars=(
VALKEY_AOF_ENABLED
VALKEY_RDB_POLICY
VALKEY_RDB_POLICY_DISABLED
VALKEY_MASTER_HOST
VALKEY_MASTER_PORT_NUMBER
VALKEY_PRIMARY_HOST
VALKEY_PRIMARY_PORT_NUMBER
VALKEY_PORT_NUMBER
VALKEY_ALLOW_REMOTE_CONNECTIONS
VALKEY_REPLICATION_MODE
Expand All @@ -41,7 +41,7 @@ valkey_cluster_env_vars=(
VALKEY_EXTRA_FLAGS
ALLOW_EMPTY_PASSWORD
VALKEY_PASSWORD
VALKEY_MASTER_PASSWORD
VALKEY_PRIMARY_PASSWORD
VALKEY_ACLFILE
VALKEY_IO_THREADS_DO_READS
VALKEY_IO_THREADS
Expand Down Expand Up @@ -108,8 +108,8 @@ export VALKEY_DATABASE="${VALKEY_DATABASE:-valkey}"
export VALKEY_AOF_ENABLED="${VALKEY_AOF_ENABLED:-yes}"
export VALKEY_RDB_POLICY="${VALKEY_RDB_POLICY:-}"
export VALKEY_RDB_POLICY_DISABLED="${VALKEY_RDB_POLICY_DISABLED:-no}"
export VALKEY_MASTER_HOST="${VALKEY_MASTER_HOST:-}"
export VALKEY_MASTER_PORT_NUMBER="${VALKEY_MASTER_PORT_NUMBER:-6379}"
export VALKEY_PRIMARY_HOST="${VALKEY_PRIMARY_HOST:-}"
export VALKEY_PRIMARY_PORT_NUMBER="${VALKEY_PRIMARY_PORT_NUMBER:-6379}"
export VALKEY_DEFAULT_PORT_NUMBER="6379" # only used at build time
export VALKEY_PORT_NUMBER="${VALKEY_PORT_NUMBER:-$VALKEY_DEFAULT_PORT_NUMBER}"
export VALKEY_ALLOW_REMOTE_CONNECTIONS="${VALKEY_ALLOW_REMOTE_CONNECTIONS:-yes}"
Expand All @@ -119,7 +119,7 @@ export VALKEY_REPLICA_PORT="${VALKEY_REPLICA_PORT:-}"
export VALKEY_EXTRA_FLAGS="${VALKEY_EXTRA_FLAGS:-}"
export ALLOW_EMPTY_PASSWORD="${ALLOW_EMPTY_PASSWORD:-no}"
export VALKEY_PASSWORD="${VALKEY_PASSWORD:-}"
export VALKEY_MASTER_PASSWORD="${VALKEY_MASTER_PASSWORD:-}"
export VALKEY_PRIMARY_PASSWORD="${VALKEY_PRIMARY_PASSWORD:-}"
export VALKEY_ACLFILE="${VALKEY_ACLFILE:-}"
export VALKEY_IO_THREADS_DO_READS="${VALKEY_IO_THREADS_DO_READS:-}"
export VALKEY_IO_THREADS="${VALKEY_IO_THREADS:-}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ARGS+=("--include" "${VALKEY_BASE_DIR}/etc/valkey.conf")

if ! is_boolean_yes "$ALLOW_EMPTY_PASSWORD"; then
ARGS+=("--requirepass" "$VALKEY_PASSWORD")
ARGS+=("--masterauth" "$VALKEY_PASSWORD")
ARGS+=("--primaryauth" "$VALKEY_PASSWORD")
else
ARGS+=("--protected-mode" "no")
fi
Expand Down
16 changes: 11 additions & 5 deletions bitnami/valkey-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,17 @@ services:
| `VALKEY_AOF_ENABLED` | Enable AOF | `yes` |
| `VALKEY_RDB_POLICY` | Enable RDB policy persitence | `nil` |
| `VALKEY_RDB_POLICY_DISABLED` | Allows to enable RDB policy persistence | `no` |
| `VALKEY_MASTER_HOST` | Valkey master host (used by slaves) | `nil` |
| `VALKEY_MASTER_PORT_NUMBER` | Valkey master host port (used by slaves) | `6379` |
| `VALKEY_PRIMARY_HOST` | Valkey primary host (used by replicas) | `nil` |
| `VALKEY_PRIMARY_PORT_NUMBER` | Valkey primary host port (used by replicas) | `6379` |
| `VALKEY_PORT_NUMBER` | Valkey port number | `$VALKEY_DEFAULT_PORT_NUMBER` |
| `VALKEY_ALLOW_REMOTE_CONNECTIONS` | Allow remote connection to the service | `yes` |
| `VALKEY_REPLICATION_MODE` | Valkey replication mode (values: master, slave) | `nil` |
| `VALKEY_REPLICATION_MODE` | Valkey replication mode (values: primary, replica) | `nil` |
| `VALKEY_REPLICA_IP` | The replication announce ip | `nil` |
| `VALKEY_REPLICA_PORT` | The replication announce port | `nil` |
| `VALKEY_EXTRA_FLAGS` | Additional flags pass to 'valkey-server' commands | `nil` |
| `ALLOW_EMPTY_PASSWORD` | Allow password-less access | `no` |
| `VALKEY_PASSWORD` | Password for Valkey | `nil` |
| `VALKEY_MASTER_PASSWORD` | Valkey master node password | `nil` |
| `VALKEY_PRIMARY_PASSWORD` | Valkey primary node password | `nil` |
| `VALKEY_ACLFILE` | Valkey ACL file | `nil` |
| `VALKEY_IO_THREADS_DO_READS` | Enable multithreading when reading socket | `nil` |
| `VALKEY_IO_THREADS` | Number of threads | `nil` |
Expand Down Expand Up @@ -234,7 +234,7 @@ Once all the Valkey nodes are running you need to execute command like the follo
valkey-cli --cluster create node1:port node2:port --cluster-replicas 1 --cluster-yes
```

Where you can add all the `node:port` that you want. The `--cluster-replicas` parameters indicates how many replicas you want to have for every master.
Where you can add all the `node:port` that you want. The `--cluster-replicas` parameters indicates how many replicas you want to have for every primary.

### Cluster Initialization Troubleshooting

Expand Down Expand Up @@ -364,6 +364,12 @@ If you detect any issue in the `docker-compose.yaml` file, feel free to report i

We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/containers/issues) or submitting a [pull request](https://github.com/bitnami/containers/pulls) with your contribution.

## Notable Changes

### Starting October 20, 2024

* All the references have been updated from `master/slave` to `primary/replica` to follow the upstream project strategy. Environment variables previously prefixed as `VALKEY_MASTER` or `VALKEY_SENTINEL_MASTER` use `VALKEY_PRIMARY` and `VALKEY_SENTINEL_PRIMARY` now.

## Issues

If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/containers/issues/new/choose). For us to provide better support, be sure to fill the issue template.
Expand Down
Loading