diff --git a/samples/kind-lb/README.md b/samples/kind-lb/README.md index 4f329363a0c1..10704278b5be 100644 --- a/samples/kind-lb/README.md +++ b/samples/kind-lb/README.md @@ -1,7 +1,10 @@ # Create a KinD cluster with an external load balancer -This bash script sets up a k8s cluster using kind and metallb. +This bash script sets up a k8s cluster using kind and metallb on Linux. + +WARNING: when it runs in an environment other than Linux, it will only +produce an error message. The following dependencies must be installed before running the script: 1. kubectl diff --git a/samples/kind-lb/setupkind.sh b/samples/kind-lb/setupkind.sh index ccecdf9647f2..cf8828fed7d2 100755 --- a/samples/kind-lb/setupkind.sh +++ b/samples/kind-lb/setupkind.sh @@ -5,6 +5,13 @@ # set -e +# This script can only produce desired results on Linux systems. +ENVOS=$(uname 2>/dev/null || true) +if [[ "${ENVOS}" != "Linux" ]]; then + echo "Your environment is not supported by this script." + exit 1 +fi + # Check prerequisites REQUISITES=("kubectl" "kind" "docker") for item in "${REQUISITES[@]}"; do