diff --git a/scripts/01-system-assigned-managed-identity.sh b/scripts/01-system-assigned-managed-identity.sh index 63204fb..3c53ebc 100755 --- a/scripts/01-system-assigned-managed-identity.sh +++ b/scripts/01-system-assigned-managed-identity.sh @@ -1,5 +1,20 @@ #!/bin/bash +# Check prerequisites +missing=0 +for tool in az kubectl; do + if ! command -v "$tool" >/dev/null 2>&1; then + echo "Error: required tool '$tool' is not installed or not in PATH." >&2 + missing=1 + fi +done +if [ "$missing" -ne 0 ]; then + echo "Please install the missing tool(s) and re-run the script." >&2 + echo " az: https://learn.microsoft.com/cli/azure/install-azure-cli" >&2 + echo " kubectl: https://kubernetes.io/docs/tasks/tools/ (or: az aks install-cli)" >&2 + exit 1 +fi + # Variables # Azure Kubernetes Service (AKS) cluster @@ -82,9 +97,9 @@ registering_extensions=() ok=0 # Print the menu -echo "====================================" -echo "Run Docker Container (1-3): " -echo "====================================" +echo "======================================" +echo "Select Network Plugin and Policy (1-3): " +echo "======================================" options=( "Azure Network Plugin + Azure Network Policy" "Azure Network Plugin + Cilium Network Policy" diff --git a/scripts/01-user-assigned-managed-identity.sh b/scripts/01-user-assigned-managed-identity.sh index f2c87cc..40240a8 100755 --- a/scripts/01-user-assigned-managed-identity.sh +++ b/scripts/01-user-assigned-managed-identity.sh @@ -1,5 +1,20 @@ #!/bin/bash +# Check prerequisites +missing=0 +for tool in az kubectl; do + if ! command -v "$tool" >/dev/null 2>&1; then + echo "Error: required tool '$tool' is not installed or not in PATH." >&2 + missing=1 + fi +done +if [ "$missing" -ne 0 ]; then + echo "Please install the missing tool(s) and re-run the script." >&2 + echo " az: https://learn.microsoft.com/cli/azure/install-azure-cli" >&2 + echo " kubectl: https://kubernetes.io/docs/tasks/tools/ (or: az aks install-cli)" >&2 + exit 1 +fi + # Variables # Azure Kubernetes Service (AKS) cluster