diff --git a/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd-env.sh b/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd-env.sh index ac7b3ba3b65b..005cc3a37e8b 100644 --- a/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd-env.sh +++ b/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd-env.sh @@ -34,6 +34,7 @@ etcd_env_vars=( ETCD_DISASTER_RECOVERY ETCD_ON_K8S ETCD_INIT_SNAPSHOT_FILENAME + ETCD_PREUPGRADE_START_DELAY ETCD_NAME ETCD_LOG_LEVEL ETCD_LISTEN_CLIENT_URLS @@ -90,6 +91,7 @@ export ETCD_START_FROM_SNAPSHOT="${ETCD_START_FROM_SNAPSHOT:-no}" export ETCD_DISASTER_RECOVERY="${ETCD_DISASTER_RECOVERY:-no}" export ETCD_ON_K8S="${ETCD_ON_K8S:-no}" export ETCD_INIT_SNAPSHOT_FILENAME="${ETCD_INIT_SNAPSHOT_FILENAME:-}" +export ETCD_PREUPGRADE_START_DELAY="${ETCD_PREUPGRADE_START_DELAY:-}" # etcd native environment variables (see https://etcd.io/docs/current/op-guide/configuration) export ETCD_NAME="${ETCD_NAME:-}" diff --git a/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd/preupgrade.sh b/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd/preupgrade.sh index 5bc98520b6cf..1ecdaf66f79a 100755 --- a/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd/preupgrade.sh +++ b/bitnami/etcd/3.6/debian-12/rootfs/opt/bitnami/scripts/etcd/preupgrade.sh @@ -37,6 +37,11 @@ endpoints_as_host_port() { read -r -a extra_flags <<<"$(etcdctl_auth_flags)" is_boolean_yes "$ETCD_ON_K8S" && extra_flags+=("--endpoints=$(endpoints_as_host_port)") + +if [[ -n "$ETCD_PREUPGRADE_START_DELAY" ]]; then + info "Waiting for $ETCD_PREUPGRADE_START_DELAY seconds before starting pre-upgrade checks" + sleep "$ETCD_PREUPGRADE_START_DELAY" +fi debug "Listing members" if ! current="$(etcdctl member list "${extra_flags[@]}" --write-out simple | awk -F ", " '{print $3 ":" $1}')"; then error "Unable to list members, are all members healthy?" diff --git a/bitnami/etcd/README.md b/bitnami/etcd/README.md index aa5f0b073b8f..74b96491e6af 100644 --- a/bitnami/etcd/README.md +++ b/bitnami/etcd/README.md @@ -195,6 +195,7 @@ Apart from providing your custom configuration file, you can also modify the ser | `ETCD_START_FROM_SNAPSHOT` | Whether etcd should start from an existing snapshot or not. | `no` | | `ETCD_DISASTER_RECOVERY` | Whether etcd should try or not to recover from snapshots when the cluste disastrously fails. | `no` | | `ETCD_ON_K8S` | Whether etcd is running on a K8s environment or not. | `no` | +| `ETCD_PREUPGRADE_START_DELAY` | Optional delay before starting the pre-upgrade hook (in seconds). | `nil` | | `ETCD_INIT_SNAPSHOT_FILENAME` | Existing snapshot filename to start the etcd cluster from. | `nil` | | `ETCD_NAME` | etcd member name. | `nil` | | `ETCD_LOG_LEVEL` | etcd log level. | `info` |