Skip to content

DRA 1k node load testing #5788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 22 additions & 11 deletions scripts/ci-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,15 @@ KIND="${REPO_ROOT}/hack/tools/bin/kind"
KUSTOMIZE="${REPO_ROOT}/hack/tools/bin/kustomize"
make --directory="${REPO_ROOT}" "${KUBECTL##*/}" "${HELM##*/}" "${KIND##*/}" "${KUSTOMIZE##*/}"
KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-capz}"
WORKER_MACHINE_COUNT="${WORKER_MACHINE_COUNT:-2}"
EXTRA_NODES_PER_SCALEOUT="${EXTRA_NODES_PER_SCALEOUT:-200}"
export TOTAL_WORKER_MACHINE_COUNT="${WORKER_MACHINE_COUNT:-2}"
WORKER_MACHINE_COUNT=0
export KIND_CLUSTER_NAME
# export the variables so they are available in bash -c wait_for_nodes below
export KUBECTL
export HELM
export REPO_ROOT
export EXTRA_NODES_PER_SCALEOUT

# shellcheck source=hack/ensure-go.sh
source "${REPO_ROOT}/hack/ensure-go.sh"
Expand Down Expand Up @@ -95,7 +99,7 @@ setup() {
echo ''
)}"
export AZURE_RESOURCE_GROUP="${CLUSTER_NAME}"
if [ "${WORKER_MACHINE_COUNT}" -gt "10" ]; then
if [ "${TOTAL_WORKER_MACHINE_COUNT}" -gt "10" ]; then
export AZURE_LOCATION="${AZURE_LOCATION:-$(capz::util::get_random_region_load)}"
echo "Using AZURE_LOCATION: ${AZURE_LOCATION}"
else
Expand Down Expand Up @@ -181,16 +185,23 @@ wait_for_copy_kubeadm_config_map() {

# wait_for_nodes returns when all nodes in the workload cluster are Ready.
wait_for_nodes() {
echo "Waiting for ${CONTROL_PLANE_MACHINE_COUNT} control plane machine(s), ${WORKER_MACHINE_COUNT} worker machine(s), ${WINDOWS_WORKER_MACHINE_COUNT:-0} windows machine(s), and ${MONITORING_MACHINE_COUNT} monitoring machine(s) to become Ready"
while ((WORKER_MACHINE_COUNT < TOTAL_WORKER_MACHINE_COUNT)); do
WORKER_MACHINE_COUNT=$((WORKER_MACHINE_COUNT + EXTRA_NODES_PER_SCALEOUT))
WORKER_MACHINE_COUNT=$((WORKER_MACHINE_COUNT > TOTAL_WORKER_MACHINE_COUNT ? TOTAL_WORKER_MACHINE_COUNT : WORKER_MACHINE_COUNT))

# Ensure that all nodes are registered with the API server before checking for readiness
local total_nodes="$((CONTROL_PLANE_MACHINE_COUNT + WORKER_MACHINE_COUNT + WINDOWS_WORKER_MACHINE_COUNT + MONITORING_MACHINE_COUNT))"
while [[ $("${KUBECTL}" get nodes -ojson | jq '.items | length') -ne "${total_nodes}" ]]; do
sleep 10
done
"${KUBECTL}" --kubeconfig "${REPO_ROOT}/${KIND_CLUSTER_NAME}.kubeconfig" scale --namespace default machinepool/"${CLUSTER_NAME}"-mp-0 --replicas="${WORKER_MACHINE_COUNT}"

until "${KUBECTL}" wait --for=condition=Ready node --all --timeout=15m; do
sleep 5
echo "Waiting for ${CONTROL_PLANE_MACHINE_COUNT} control plane machine(s), ${WORKER_MACHINE_COUNT} worker machine(s), ${WINDOWS_WORKER_MACHINE_COUNT:-0} windows machine(s), and ${MONITORING_MACHINE_COUNT} monitoring machine(s) to become Ready"

# Ensure that all nodes are registered with the API server before checking for readiness
local total_nodes="$((CONTROL_PLANE_MACHINE_COUNT + WORKER_MACHINE_COUNT + WINDOWS_WORKER_MACHINE_COUNT + MONITORING_MACHINE_COUNT))"
while [[ $("${KUBECTL}" get nodes -ojson | jq '.items | length') -ne "${total_nodes}" ]]; do
sleep 10
done

until "${KUBECTL}" wait --for=condition=Ready node --all --timeout=15m > /dev/null; do
sleep 5
done
done
until "${KUBECTL}" get nodes -o wide; do
sleep 5
Expand Down Expand Up @@ -222,7 +233,7 @@ install_addons() {
# we need to wait a little bit for nodes and pods terminal state,
# so we block successful return upon the cluster being fully operational.
export -f wait_for_nodes
timeout --foreground 1800 bash -c wait_for_nodes
timeout --foreground 10800 bash -c wait_for_nodes
export -f wait_for_pods
timeout --foreground 1800 bash -c wait_for_pods
}
Expand Down
4 changes: 2 additions & 2 deletions templates/test/ci/cluster-template-prow-ci-version-dra.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions templates/test/ci/cluster-template-prow-ci-version-ipv6.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading