Files
my-rook-config/tests/scripts/multus/test-210-stretch-overlap.sh
T
Blaine Gardner 0c721e05d5 multus: allow node profiles in validation test
Add the ability to specify node profiles in the multus validation test.

This addresses a few points of early feedback on the validation tool.
Statements below critique the tool's behavior before this patch.
1. The tool assumes all daemons are on public and cluster network, which
   means users who have a significantly smaller cluster net (a
   design choice) cannot run a single test to determine if Rook is
   likely to install correctly.
2. The tool does not have placement options to select only a subset of
   Kubernetes nodes to run validation on.
3. Users of multus seem to have a dedicated pool of storage nodes more
   often than the average Rook install. This makes sense for security-
   and perforance-minded users. The tool cannot run a single test to
   verify storage-only and general-workload nodes at one time.

These points are addressed by allowing users to specify configurations
for different "NodeTypes."

Each NodeType config has options for selecting the number of OSDs as
well as the number of other (non-OSD) Ceph daemons. This limits the
unnecessary exhaustion of cluster network addresses from critique 1.

Each NodeType config has its own placement (critique 2).

Users can define as many NodeTypes as needed to test the network for
their planned CephCluster. Specifically, this allows the tool to test
storage-only nodes and generalized-workload nodes at the same time. An
arbitrary number of NodeTypes are allowed to support even more highly
specialized cluster setups, such as multiple tiers of storage nodes
where some storage-only nodes may run more OSDs than others.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
2023-10-04 15:26:35 -06:00

28 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -xeuo pipefail
CONFFILE="stretch-overlap.yaml"
NAMESPACE="stretch-overlap"
OUTFILE="overlap-test.log"
kubectl create namespace "$NAMESPACE"
sed \
-e "s|namespace:.*|namespace: $NAMESPACE|" \
-e 's|publicNetwork:.*|publicNetwork: "default/public-net"|' \
-e 's|clusterNetwork:.*|clusterNetwork: "default/cluster-net"|' \
tests/scripts/multus/stretch.yaml >"$CONFFILE"
cat "$CONFFILE"
# Nodes do not yet have taints, which means worker and storage node type pods should overlap
# this is an important error condition to check because it ensures the test is valid
if ./rook --log-level DEBUG multus validation run --config "$CONFFILE" 2>&1 | tee "$OUTFILE"; then
echo "Test was supposed to fail"
exit 1
fi
# Check that node overlap error is present
grep 'RESULT: multus validation test failed: multus validation test failed: node types must not overlap: node type "worker-nodes" has overlap with node type "storage-nodes"' "$OUTFILE"
# should be resources left running for debugging
[[ -n "$(kubectl --namespace "$NAMESPACE" get pods --no-headers 2>/dev/null | grep -v Terminating)" ]]