#!/bin/bash # Step 03: Apply the source Etcd application, wait for the operator-side # EtcdCluster to become Available, then write a sentinel key that the backup # captures and the restore round-trips. The sentinel is the in-cluster # witness that the snapshot actually round-tripped through S3. set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "$SCRIPT_DIR/00-helpers.sh" print_header "Step 03: Provision source Etcd '${ETCD_NAME}' and write sentinel" # The chart pins the release name to "etcd"; ETCD_NAME must equal "etcd". kubectl apply -f - < "$SCRIPT_DIR/.sentinel.env" echo "export SENTINEL_VAL=${SENTINEL_VAL}" >> "$SCRIPT_DIR/.sentinel.env" chmod 600 "$SCRIPT_DIR/.sentinel.env" log_success "Etcd '${ETCD_NAME}' Ready; sentinel written and cached in $(basename "$SCRIPT_DIR")/.sentinel.env." echo -e "\n${GREEN}${BOLD}Next:${NC} ./04-create-backupjob.sh"