#!/bin/bash


NODES=$(kubectl get node --show-labels -o wide | grep "arch=arm64" | awk '{ print $1 }')

CMD="kubectl cordon "
for n in ${NODES}; do
  CMD+=" $n "
done

echo $CMD
$CMD

echo Sleeping
sleep 10

CMD="kubectl drain "
for n in ${NODES}; do
  CMD+=" $n "
done

echo $CMD
$CMD