diff --git a/clusterctl/examples/google/generate-yaml.sh b/clusterctl/examples/google/generate-yaml.sh index 5ea7cafa0318..bb487ac9e881 100755 --- a/clusterctl/examples/google/generate-yaml.sh +++ b/clusterctl/examples/google/generate-yaml.sh @@ -21,7 +21,9 @@ set -o pipefail GCLOUD_PROJECT=$(gcloud config get-value project) ZONE=$(gcloud config get-value compute/zone) ZONE="${ZONE:-us-central1-f}" -CLUSTER_NAME=test1 +# Generate a somewhat unique cluster name, UUID is not an option as service-accounts are limited to 30 characters in length +# and have a 19 character prefix (i.e. 'machine-controller-') +CLUSTER_NAME=$(head -c11 < <(LC_ALL=C tr -dc 'a-zA-Z0-9' < /dev/urandom) | tr '[:upper:]' '[:lower:]') OUTPUT_DIR=out @@ -184,3 +186,5 @@ cat $ADDON_TEMPLATE_FILE \ | sed -e "s/\$CLUSTER_NAME/$CLUSTER_NAME/" \ | sed "s/\$LOADBALANCER_SA_KEY/$LOADBALANCER_SA_KEY/" \ > $ADDON_GENERATED_FILE + +echo -e "\nYour generated cluster name is '${CLUSTER_NAME}'" \ No newline at end of file