Last active
September 7, 2021 14:25
-
-
Save alevz257/1bb0e93df1a7a5d9b88c77b56f1c287b to your computer and use it in GitHub Desktop.
This file contains 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
gcloud beta compute --project=<project_id> instance-templates create hello-world-envoy \ | |
--machine-type=e2-medium \ | |
--subnet=projects/<project_id>/regions/asia-southeast2/subnetworks/<subnet> \ | |
--network-tier=PREMIUM \ | |
--metadata=startup-script=\#\!\ /bin/bash$'\n'apt-get\ update$'\n'apt-get\ install\ apache2\ -y$'\n'a2ensite\ default-ssl$'\n'a2enmod\ ssl$'\n'vm_hostname=\"\$\(curl\ -H\ \"Metadata-Flavor:Google\"\ \\$'\n'http://169.254.169.254/computeMetadata/v1/instance/name\)\"$'\n'echo\ \"Page\ served\ from:\ \$vm_hostname\"\ \|\ \\$'\n'tee\ /var/www/html/index.html \ | |
--maintenance-policy=MIGRATE \ | |
--service-account=<service_account> \ | |
--scopes=https://www.googleapis.com/auth/cloud-platform \ | |
--region=asia-southeast2 \ | |
--tags=http-server,https-server \ | |
--image=debian-9-stretch-v20210817 \ | |
--image-project=debian-cloud \ | |
--boot-disk-size=10GB \ | |
--boot-disk-type=pd-balanced \ | |
--boot-disk-device-name=hello-world-envoy \ | |
--reservation-affinity=any \ | |
--service-proxy=enabled |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment