95643147c5
This change includes several interconnected features: * Migration to Deckhand-based configuration. This is integrated here, because new configuration data were needed, so it would have been wasted effort to either implement it in the old format or to update the old configuration data to Dechkand format. * Failing faster with stronger validation. Migration to Deckhand configuration was a good opportunity to add schema validation, which is a requirement in the near term anyway. Additionally, rendering all templates up front adds an additional layer of "fail-fast". * Separation of certificate generation and configuration assembly into different commands. Combined with Deckhand substitution, this creates a much clearer distinction between Promenade configuration and deployable secrets. * Migration of components to charts. This is a key step that will enable support for dynamic node management. Additionally, this paves the way for significant configurability in component deployment. * Version of kubelet is configurable & controlled via download url. * Restructuring templates to be more intuitive. Many of the templates require changes or deletion due to the migration to charts. * Installation of pre-configured useful tools on hosts, including calicoctl. * DNS is now provided by coredns, which is highly configurable. Change-Id: I9f2d8da6346f4308be5083a54764ce6035a2e10c
67 lines
1.6 KiB
Bash
Executable File
67 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -ex
|
|
|
|
GATE_DIR=$(realpath $(dirname $0))
|
|
pushd $GATE_DIR
|
|
|
|
ENV_PATH=$GATE_DIR/config-env
|
|
IMAGE_PROMENADE=${IMAGE_PROMENADE:-$1}
|
|
|
|
if [ ! -s $ENV_PATH ]; then
|
|
echo Environment variables for config substitution in $ENV_PATH are required.
|
|
exit 1
|
|
fi
|
|
|
|
if [ "x$IMAGE_PROMENADE" = "x" ]; then
|
|
echo IMAGE_PROMENADE environment variable must be supplied.
|
|
exit 1
|
|
fi
|
|
|
|
echo === Building assets for testing ===
|
|
echo Usinag image ${IMAGE_PROMENADE}.
|
|
|
|
echo === Cleaning up old data ===
|
|
rm -f config/*
|
|
rm -f promenade-bundle/*
|
|
|
|
echo === Validating test environment ===
|
|
env -i - $(cat default-config-env) env $(cat $ENV_PATH) $GATE_DIR/util/validate-test-env.sh
|
|
|
|
echo === Substituting variables into configuration ===
|
|
for template in config-templates/*; do
|
|
OUTPUT_PATH=config/$(basename $template)
|
|
env -i - $(cat default-config-env) env IMAGE_PROMENADE=$IMAGE_PROMENADE $(cat $ENV_PATH) envsubst < $template > $OUTPUT_PATH
|
|
|
|
cat $OUTPUT_PATH
|
|
echo
|
|
echo
|
|
done
|
|
|
|
echo === Generating certificates ===
|
|
docker run --rm -t \
|
|
-w /target \
|
|
-v $GATE_DIR:/target \
|
|
${IMAGE_PROMENADE} \
|
|
promenade \
|
|
generate-certs \
|
|
-o config \
|
|
config/*.yaml
|
|
|
|
echo === Building genesis and join scripts
|
|
docker run --rm -t \
|
|
-w /target \
|
|
-v $GATE_DIR:/target \
|
|
${IMAGE_PROMENADE} \
|
|
promenade \
|
|
build-all \
|
|
--validators \
|
|
-o promenade-bundle \
|
|
config/*.yaml
|
|
|
|
echo === Bundling assets for delivery ===
|
|
cp $GATE_DIR/final-validation.sh promenade-bundle
|
|
tar czf promenade-bundle.tgz promenade-bundle/*
|
|
|
|
echo === Done ===
|