You can add tags to your GC nodes by specifying them inside a node definition with the TagList attribute. Tags in GC are limited to lowercase letters, numbers and the dash ‘-‘ character. If an invalid tag is specified, CycleCloud will correct it for you by converting to lowercase and removing invalid characters before launching the instance:
[cluster Demo] [[node master]] TagList = demo, tagging, cycle-owned
This will result in three tags applied to the instance when it is launched (demo, tagging, and cycle-owned).
You can specify a VM as preemptible, meaning that it will be significantly cheaper but run the risk of being terminated at any time its compute resources are needed by the cloud provider. Preemptible VMs running in Google Compute Engine will run for no more than 24 hours. For details, please see the Google documentation:
[cluster Demo] [[nodearray execute]] Preemptible = true
You can configure the standard network device or attach additional devices with the network-interface element:
[cluster your_cluster] [[node simple]] MachineType = n1-standard-1 [[[network-interface]]] PublicIp = 198.51.100.1
This configures the first network device to use 198.51.100.1 as its public IP. (Note: this assumes that you have already allocated 198.51.100.1 in your cloud provider, and thus can use that IP.)
As an alternative to specifying a public IP manually, you can ask for one to be created for you with the AssociatePublicIpAddress parameter:
[[[network-interface]]] AssociatePublicIpAddress = true
This is set to true by default, if you want to have your nodes not be addressable by default, set this value to false.
You can assign a node to a specific network created in your project with the NetworkName parameter:
[[[network-interface]]] NetworkName = custom-network
You can assign a service account to a GC instance using GCP.ServiceAccountEmail and GCP.serviceAccountScopes attributes, both are required. For details, please see the Google Service Account documentation:
[cluster your_cluster] [[node simple]] MachineType = n1-standard-1 GCP.ServiceAccountEmail = email@example.com GCP.ServiceAccountScopes = https://www.googleapis.com/auth/compute, https://www.googleapis.com/auth/devstorage.full_control
Working with Google Cloud Volumes
CycleCloud supports configuring volumes for Google Cloud. For more information about CG volumes and how they differ from AWS, please see the official documentation.
GC Volume Types
Google Cloud uses three volume types:
- Standard Persistent Disk (HDD)
- SSD Persistent Disk (SSD)
- Local SSD
Persistent disks in read-write mode can only be attached to one instance at a time. However, disks in read-only mode can be attached to multiple instances simultaneously.
To attach an existing volume, you must know the URL of the volume. You can specify that it should be attached to an instance by setting SourceUrl in the [[[volume]]] block within your cluster template:
[[node master]] [[[volume example-vol]]] # 'example-vol' is the name of the volume within CycleCloud SourceUrl = /compute/v1/projects/my-project/zones/[ZONE]/disks/[DISK_NAME] # This is the URL of your GC volume
Local SSD/Instance Storage
Ephemeral disks are called “Local SSD” in Google Cloud. These are handled automatically for you by CycleCloud.