[bitnami/clickhouse-keeper] Release clickhouse-keeper-25.3.2-debian-12-r5 (#79967)

Signed-off-by: Bitnami Bot <bitnami.bot@broadcom.com>
This commit is contained in:
Bitnami Bot
2025-04-08 10:15:32 +02:00
committed by GitHub
parent 06c35ff787
commit 35d2bfeb99
7 changed files with 72 additions and 24 deletions

View File

@@ -8,10 +8,10 @@ ARG TARGETARCH
LABEL com.vmware.cp.artifact.flavor="sha256:c50c90cfd9d12b445b011e6ad529f1ad3daea45c26d20b00732fae3cd71f6a83" \
org.opencontainers.image.base.name="docker.io/bitnami/minideb:bookworm" \
org.opencontainers.image.created="2025-04-07T15:08:18Z" \
org.opencontainers.image.created="2025-04-08T07:39:54Z" \
org.opencontainers.image.description="Application packaged by Broadcom, Inc." \
org.opencontainers.image.documentation="https://github.com/bitnami/containers/tree/main/bitnami/clickhouse-keeper/README.md" \
org.opencontainers.image.ref.name="25.3.2-debian-12-r4" \
org.opencontainers.image.ref.name="25.3.2-debian-12-r5" \
org.opencontainers.image.source="https://github.com/bitnami/containers/tree/main/bitnami/clickhouse-keeper" \
org.opencontainers.image.title="clickhouse-keeper" \
org.opencontainers.image.vendor="Broadcom, Inc." \

View File

@@ -46,6 +46,8 @@ unset clickhouse_keeper_env_vars
export CLICKHOUSE_KEEPER_BASE_DIR="${BITNAMI_ROOT_DIR}/clickhouse-keeper"
export CLICKHOUSE_KEEPER_VOLUME_DIR="/bitnami/clickhouse-keeper"
export CLICKHOUSE_KEEPER_CONF_DIR="${CLICKHOUSE_KEEPER_BASE_DIR}/etc"
export CLICKHOUSE_KEEPER_DEFAULT_CONF_DIR="${CLICKHOUSE_KEEPER_BASE_DIR}/etc.default"
export CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR="${CLICKHOUSE_KEEPER_VOLUME_DIR}/etc"
export CLICKHOUSE_KEEPER_CONF_FILE="${CLICKHOUSE_KEEPER_CONF_DIR}/keeper_config.xml"
export CLICKHOUSE_KEEPER_DATA_DIR="${CLICKHOUSE_KEEPER_VOLUME_DIR}/coordination"
export CLICKHOUSE_KEEPER_COORD_LOGS_DIR="${CLICKHOUSE_KEEPER_DATA_DIR}/logs"

View File

@@ -18,6 +18,17 @@ set -o pipefail
print_welcome_page
# We add the copy from default config in the entrypoint to not break users
# bypassing the setup.sh logic. If the file already exists do not overwrite (in
# case someone mounts a configuration file at /opt/bitnami/clickhouse-keeper/etc)
debug "Copying files from $CLICKHOUSE_KEEPER_DEFAULT_CONF_DIR to $CLICKHOUSE_KEEPER_CONF_DIR"
if [[ -w "$CLICKHOUSE_KEEPER_CONF_DIR" ]]; then
cp -nr "$CLICKHOUSE_KEEPER_DEFAULT_CONF_DIR"/. "$CLICKHOUSE_KEEPER_CONF_DIR"
else
error "The folder $CLICKHOUSE_KEEPER_CONF_DIR is not writable. This is likely because a read-only filesystem is used, please ensure you mount a writable volume on this path."
exit 1
fi
if [[ "$1" = "/opt/bitnami/scripts/clickhouse-keeper/run.sh" ]]; then
info "** Starting ClickHouse Keeper setup **"
/opt/bitnami/scripts/clickhouse-keeper/setup.sh

View File

@@ -19,7 +19,7 @@ set -o pipefail
ensure_user_exists "$CLICKHOUSE_DAEMON_USER" --group "$CLICKHOUSE_DAEMON_GROUP" --system
# Create directories
for dir in "$CLICKHOUSE_KEEPER_VOLUME_DIR" "$CLICKHOUSE_KEEPER_DATA_DIR" "$CLICKHOUSE_KEEPER_COORD_LOGS_DIR" "$CLICKHOUSE_KEEPER_COORD_SNAPSHOTS_DIR" "$CLICKHOUSE_KEEPER_CONF_DIR" "$CLICKHOUSE_KEEPER_LOG_DIR" "$CLICKHOUSE_KEEPER_TMP_DIR"; do
for dir in "$CLICKHOUSE_KEEPER_VOLUME_DIR" "$CLICKHOUSE_KEEPER_DATA_DIR" "$CLICKHOUSE_KEEPER_COORD_LOGS_DIR" "$CLICKHOUSE_KEEPER_COORD_SNAPSHOTS_DIR" "$CLICKHOUSE_KEEPER_CONF_DIR" "$CLICKHOUSE_KEEPER_DEFAULT_CONF_DIR" "$CLICKHOUSE_KEEPER_LOG_DIR" "$CLICKHOUSE_KEEPER_TMP_DIR"; do
ensure_dir_exists "$dir"
configure_permissions_ownership "$dir" -d "775" -f "664" -u "$CLICKHOUSE_DAEMON_USER" -g "root"
done
@@ -69,6 +69,6 @@ xmlstarlet ed -L -d "/clickhouse/logger/errorlog" "$CLICKHOUSE_KEEPER_CONF_FILE"
keeper_conf_set "/clickhouse/logger/console" "1"
keeper_conf_set "/clickhouse/logger/level" "information"
# Move the original keeper_config.xml, so users can skip initialization logic by mounting
# their own keeper_config.xml directly
mv "$CLICKHOUSE_KEEPER_CONF_FILE" "${CLICKHOUSE_KEEPER_CONF_DIR}/keeper_config.xml.original"
# Move all initially generated configuration files to the default directory
# so users can skip initialization logic by mounting their own configuration directly
mv "${CLICKHOUSE_KEEPER_CONF_DIR}"/* "$CLICKHOUSE_KEEPER_DEFAULT_CONF_DIR"/

View File

@@ -18,10 +18,7 @@ set -o pipefail
# Ensure 'daemon' user exists when running as 'root'
am_i_root && ensure_user_exists "$CLICKHOUSE_DAEMON_USER" --group "$CLICKHOUSE_DAEMON_GROUP"
# ClickHouse Keeper initialization, skipped if custom keeper_config.xml was mounted
if ! is_boolean_yes "$CLICKHOUSE_KEEPER_SKIP_SETUP" && [[ ! -f "$CLICKHOUSE_KEEPER_CONF_FILE" ]]; then
# Ensure ClickHouse Keeper environment settings are valid
keeper_validate
# Ensure ClickHouse Keeper is initialized
keeper_initialize
fi
# Ensure ClickHouse Keeper environment settings are valid
keeper_validate
# Ensure ClickHouse Keeper is initialized
keeper_initialize

View File

@@ -92,23 +92,59 @@ keeper_conf_set() {
fi
}
########################
# Copy configuration from the mounted folder to the etc folder
# In charts mounting directly in the configuration folder would not
# allow the use of multiple ConfigMaps and Secrets
# Globals:
# CLICKHOUSE_KEEPER_*
# Arguments:
# None
# Returns:
# None
#########################
keeper_copy_mounted_configuration() {
if ! is_mounted_dir_empty "$CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR"; then
info "Copying mounted configuration from $CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR"
# Copy first the files at the base of the mounted folder to go to ClickHouse
# base etc folder
find "$CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR" -maxdepth 1 \( -type f -o -type l \) -exec cp -L -r {} "$CLICKHOUSE_KEEPER_CONF_DIR" \;
# The ClickHouse override directories (etc/conf.d, etc/config.d and etc/users.d) do not support subfolders. That means we cannot
# copy directly with cp -RL because we need all override xml files to have at the root of these subfolders. In the Helm
# chart we want to allow overrides from different ConfigMaps and Secrets so we need to use the find command.
for dir in conf.d config.d users.d; do
if [[ -d "${CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR}/${dir}" ]]; then
find "${CLICKHOUSE_KEEPER_MOUNTED_CONF_DIR}/${dir}" \( -type f -o -type l \) -exec cp -L -r {} "${CLICKHOUSE_KEEPER_CONF_DIR}/${dir}" \;
fi
done
fi
}
########################
# Initialize ClickHouse Keeper
# Globals:
# CLICKHOUSE_KEEPER_*
# Arguments:
# None
# Returns:
# None
#########################
keeper_initialize() {
info "No injected configuration files found, creating default config files"
# Restore original keeper_config.xml
cp "${CLICKHOUSE_KEEPER_CONF_DIR}/keeper_config.xml.original" "$CLICKHOUSE_KEEPER_CONF_FILE"
# This fixes an issue where the trap would kill the entrypoint.sh, if a PID was left over from a previous run
# Exec replaces the process without creating a new one, and when the container is restarted it may have the same PID
rm -f "$CLICKHOUSE_KEEPER_PID_FILE"
# Logic based on the upstream ClickHouse Keeper container
# For the container itself we keep the logic simple. In the helm chart we rely on the mounting of configuration files with overrides
# ref: https://github.com/ClickHouse/ClickHouse/blob/master/docker/keeper/entrypoint.sh
keeper_conf_set "/clickhouse/keeper_server/server_id" "$CLICKHOUSE_KEEPER_SERVER_ID"
is_boolean_yes "${BITNAMI_DEBUG}" && keeper_conf_set "/clickhouse/logger/level" "debug"
keeper_copy_mounted_configuration
if is_boolean_yes "$CLICKHOUSE_KEEPER_SKIP_SETUP"; then
info "Skipping ClickHouse Keeper setup"
else
# Logic based on the upstream ClickHouse Keeper container
# For the container itself we keep the logic simple. In the helm chart we rely on the mounting of configuration files with overrides
# ref: https://github.com/ClickHouse/ClickHouse/blob/master/docker/keeper/entrypoint.sh
keeper_conf_set "/clickhouse/keeper_server/server_id" "$CLICKHOUSE_KEEPER_SERVER_ID"
is_boolean_yes "${BITNAMI_DEBUG}" && keeper_conf_set "/clickhouse/logger/level" "debug"
fi
# Avoid exit code of previous commands to affect the result of this function
true