Created
October 29, 2020 06:04
-
-
Save 0xjjpa/0c09407682aec5d1a26c6ebe80404dc1 to your computer and use it in GitHub Desktop.
gcloud scripts to deploy virtual machines as containers
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
#!/bin/bash | |
# Requires gcloud | |
# Create generic VM with a given container and a static IP while creating a disk | |
INSTANCE_NAME=basodino-develop-bootstrap-hoprd-1-17-6-02 | |
DISK_NAME=$INSTANCE_NAME | |
SERVER_TAGS=hopr-node,grpc-server,web-client,envoy-server | |
DOCKER_IMAGE=gcr.io/hoprassociation/hoprd:1.17.6 | |
IP= | |
gcloud compute instances create-with-container $INSTANCE_NAME \ | |
--zone=europe-west6-a --machine-type=e2-medium \ | |
--network-interface=address=$IP,network-tier=PREMIUM,subnet=default \ | |
--metadata=google-logging-enabled=true --maintenance-policy=MIGRATE \ | |
--create-disk name=$DISK_NAME,size=10GB,type=pd-ssd,mode=rw \ | |
--container-mount-disk mount-path="/app/db" | |
--tags=$SERVER_TAGS \ | |
--boot-disk-size=10GB --boot-disk-type=pd-standard \ | |
--container-image=$DOCKER_IMAGE --container-restart-policy=always |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment