Created
September 14, 2017 10:50
-
-
Save matti/faee168e4f8f1bad9460aa1bbe2f2796 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| set -e | |
| REGION=$1 | |
| NAME=$2 | |
| REVISION=$3 | |
| MACHINE_TYPE=$4 | |
| DISK_SIZE=$5 | |
| gcloud compute instance-templates create ${NAME}-i-$REVISION \ | |
| --machine-type ${MACHINE_TYPE} \ | |
| --boot-disk-type pd-ssd \ | |
| --boot-disk-size ${DISK_SIZE} \ | |
| --image-family=coreos-stable \ | |
| --image-project=coreos-cloud \ | |
| --restart-on-failure \ | |
| --maintenance-policy "MIGRATE" \ | |
| --region ${REGION} \ | |
| --metadata-from-file user-data=cloud-config.initial.yml | |
| gcloud compute instance-groups managed create ${NAME}-i-${REVISION} \ | |
| --size=3 \ | |
| --region=$REGION \ | |
| --template ${NAME}-i-${REVISION} \ | |
| --base-instance-name=i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment