From df2e38798c109aa4de4e67cd27eb62e526f7f8b0 Mon Sep 17 00:00:00 2001 From: Naga Ravi Chaitanya Elluri Date: Tue, 1 Aug 2023 16:19:23 -0400 Subject: [PATCH] Add node disruptions support in prow --- prow/node-disruptions/prow_run.sh | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 prow/node-disruptions/prow_run.sh diff --git a/prow/node-disruptions/prow_run.sh b/prow/node-disruptions/prow_run.sh new file mode 100644 index 0000000..b33fc95 --- /dev/null +++ b/prow/node-disruptions/prow_run.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +set -ex + +ls + +# Source env.sh to read all the vars +source env.sh +source common_run.sh +checks + +export KUBECONFIG=$KRKN_KUBE_CONFIG + +# Cluster details +echo "Printing cluster details" +oc version +cat $KRKN_KUBE_CONFIG +oc config view +echo "Printing node info" +for node in $(oc get nodes | awk 'NR!=1{print $1}'); do oc get node/$node -o yaml; done + +# Move kraken from root dir to tmp to avoid permissions issues in prow until fixed in base image +cp -r /root/kraken /tmp/kraken +krkn_loc=/tmp/kraken + +# Substitute config with environment vars defined +if [[ "$CLOUD_TYPE" == "vmware" || "$CLOUD_TYPE" == "ibmcloud" ]]; then + envsubst < $krkn_loc/scenarios/plugin_node_scenario.yaml.template > $krkn_loc/scenarios/node_scenario.yaml + export SCENARIO_TYPE="plugin_scenarios" + export ACTION=${ACTION:="$CLOUD_TYPE-node-reboot"} +else + envsubst < $krkn_loc/scenarios/node_scenario.yaml.template > $krkn_loc/scenarios/node_scenario.yaml +fi +envsubst < config.yaml.template > node_scenario_config.yaml + +# Run Kraken +cat $krkn_loc/scenarios/node_scenario.yaml +cat node_scenario_config.yaml +python3.9 $krkn_loc/run_kraken.py --config=node_scenario_config.yaml