Skip to content

Instantly share code, notes, and snippets.

@juan-lee
Created February 28, 2023 17:05
Show Gist options
  • Save juan-lee/5004d743bdd835ee2d3ff8c0dad1f9a3 to your computer and use it in GitHub Desktop.
Save juan-lee/5004d743bdd835ee2d3ff8c0dad1f9a3 to your computer and use it in GitHub Desktop.
#!/bin/bash
# optional argument handling
if [[ "$1" == "version" ]]
then
echo "1.0.0"
exit 0
fi
if [ -z "$1" ]; then
echo "Please specify node name"
exit 1
fi
node="$1"
node_id=$(kubectl get no "${node}" -o json | jq -r '.spec.providerID' | cut -c 9-)
az vmss delete --ids "${node_id}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment