This page shows you how to try Google Distributed Cloud in High Availability (HA) mode using Virtual Machines (VMs) running on Compute Engine.
You can try out Google Distributed Cloud quickly and without having to prepare any hardware. Completing the steps on this page provides you with working test environment running on Compute Engine for your Google Distributed Cloud environment.
To try Google Distributed Cloud on Compute Engine VMs, complete the following steps:
- Create six VMs in Compute Engine
- Create a
vxlan
network between all VMs with L2 connectivity - Install prerequisites for Google Distributed Cloud
- Deploy an Google Distributed Cloud cluster
- Verify your cluster
Before you begin
The deployment requires the following resources:
- Six VMs to deploy Google Distributed Cloud
- One workstation that is logged into
gcloud
with Owner permissions for your project.
The steps in this guide are taken from the installation script in the anthos-samples repository. The FAQ section has more information on how to customize this script to work with some popular variations.
Create six VMs in Compute Engine
Complete these steps to create the following VMs:
- One admin VM used to deploy Google Distributed Cloud to the other machines.
- Three VMs for the three control plane nodes needed to run the Google Distributed Cloud control plane.
- Two VMs for the two worker nodes needed to run workloads on the Google Distributed Cloud cluster.
Setup environment variables:
export PROJECT_ID=PROJECT_ID export ZONE=ZONE export CLUSTER_NAME=CLUSTER_NAME export BMCTL_VERSION=1.12.9
Run the following commands to log in with your Google account and set your project as the default:
gcloud auth login gcloud config set project $PROJECT_ID gcloud config set compute/zone $ZONE
Create the
baremetal-gcr
service account:Enable Google Cloud APIs and services:
Give the
baremetal-gcr
service account additional permissions to avoid needing multiple service accounts for different APIs and services:Create the variables and arrays needed for all the commands on this page:
Use the following loop to create six VMs:
Use the following loop to verify that SSH is ready on all VMs:
Create a vxlan
network with L2 connectivity between VMs
Use the standard vxlan
functionality of Linux to create a network that
connects all the VMs with L2 connectivity.
The following command contains two loops that perform the following actions:
- SSH into each VM
- Update and install needed packages
Execute the required commands to configure the network with
vxlan
You now have L2 connectivity within the 10.200.0.0/24 network. The VMs have the following IP addresses:
- Admin VM: 10.200.0.2
- VMs running the control plane nodes:
- 10.200.0.3
- 10.200.0.4
- 10.200.0.5
- VMs running the worker nodes:
- 10.200.0.6
- 10.200.0.7
Install prerequisites for Google Distributed Cloud
The following tools are needed on the admin machine before installing Google Distributed Cloud:
bmctl
kubectl
- Docker
Run the following command to install the needed tools:
Run the following commands to ensure that
root@10.200.0.x
works. The commands perform these tasks:- Generate a new SSH key on the admin machine.
- Add the public key to all the other VMs in the deployment.
Deploy an Google Distributed Cloud cluster
The following code block contains all commands and configurations needed to complete the following tasks:
- Create the configuration file for the needed hybrid cluster.
- Run the preflight checks.
- Deploy the cluster.
Verify your cluster
You can find your cluster's kubeconfig
file on the admin machine in the bmctl-workspace
directory. To verify your deployment, complete the following steps.
SSH into the admin workstation:
gcloud compute ssh root@$VM_WS --zone ${ZONE}
Set the
KUBECONFIG
environment variable with the path to the cluster's configuration file to runkubectl
commands on the cluster.export clusterid=CLUSTER_NAME export KUBECONFIG=$HOME/bmctl-workspace/$clusterid/$clusterid-kubeconfig kubectl get nodes
Log in to your cluster from Google Cloud console
To observe your workloads on Google Distributed Cloud in the Google Cloud console, you must log in to your admin machine where the cluster's kubeconfig
file is stored.
Go to Logging in to a cluster from Google Cloud console to learn more.
Clean up
Connect to the admin machine to reset the cluster VMs to their state prior to installation and unregister the cluster from your Google Cloud Project:
gcloud compute ssh root@$VM_WS --zone ${ZONE} << EOF set -x export clusterid=CLUSTER_NAME bmctl reset -c \$clusterid EOF
List all VMs that have
abm
in their name:gcloud compute instances list | grep 'abm'
Verify that you're fine with deleting all VMs that contain
abm
in the name.After you've verified, you can delete
abm
VMs by running the following command:gcloud compute instances list --format="value(name)" | grep 'abm' | xargs gcloud \ --quiet compute instances delete