This lab was developed with our partner, Redis. Your personal information may be shared with Redis, the lab sponsor, if you have opted-in to receive product updates, announcements, and offers in your Account Profile.
GSP938
Overview
In this lab you will learn how to create Compute Engine VMs on Google Cloud with L2 connectivity through the use of vxlan built-in functionality in Linux. You'll be using the Compute Engine VMs to simulate Google Distributed Cloud Virtual (GDCV) on Bare Metal in high-availability mode which requires L2 connectivity. The deployment will consist of 4 VMs to deploy GDCV on Bare Metal, 1 x workstation, 1 x control plane nodes and 2 x worker nodes. Then you'll install Cloud Service Mesh and Knative on the GKE on Bare Metal cluster, followed by deploying Redis Enterprise for GKE and a Serverless application. Finally, this guide will show you how to run a simple load test on the serverless application to realize the elasticity of Knative backed by a Redis datastore.
What you'll learn
In this lab, you will:
Create a GDCV for Bare Metal cluster
Install Cloud Service Mesh and Knative
Deploy Redis Enterprise cluster
Create a Redis Enterprise database
Create a Knative serverless service (incrementing a Redis counter)
Run a load test against the Knative serverless application
Setup and requirements
Before you click the Start Lab button
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.
How to start your lab and sign in to the Google Cloud console
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method.
On the left is the Lab Details pane with the following:
The Open Google Cloud console button
Time remaining
The temporary credentials that you must use for this lab
Other information, if needed, to step through this lab
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
Note: If you see the Choose an account dialog, click Use Another Account.
If necessary, copy the Username below and paste it into the Sign in dialog.
{{{user_0.username | "Username"}}}
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
{{{user_0.password | "Password"}}}
You can also find the Password in the Lab Details pane.
Click Next.
Important: You must use the credentials the lab provides you. Do not use your Google Cloud account credentials.
Note: Using your own Google Cloud account for this lab may incur extra charges.
Click through the subsequent pages:
Accept the terms and conditions.
Do not add recovery options or two-factor authentication (because this is a temporary account).
Do not sign up for free trials.
After a few moments, the Google Cloud console opens in this tab.
Note: To access Google Cloud products and services, click the Navigation menu or type the service or product name in the Search field.
Activate Cloud Shell
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
Continue through the Cloud Shell information window.
Authorize Cloud Shell to use your credentials to make Google Cloud API calls.
When you are connected, you are already authenticated, and the project is set to your Project_ID, . The output contains a line that declares the Project_ID for this session:
Your Cloud Platform project in this session is set to {{{project_0.project_id | "PROJECT_ID"}}}
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
(Optional) You can list the active account name with this command:
gcloud auth list
Click Authorize.
Output:
ACTIVE: *
ACCOUNT: {{{user_0.username | "ACCOUNT"}}}
To set the active account, run:
$ gcloud config set account `ACCOUNT`
(Optional) You can list the project ID with this command:
gcloud config list project
Output:
[core]
project = {{{project_0.project_id | "PROJECT_ID"}}}
Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.
Task 1. Create an Anthos bare metal cluster
In Cloud Shell, set the following environment variables for the scripts in this lab:
You should see 4 VMs have been provisioned in your Google Cloud console like the following:
Click Check my progress to verify the objective.
Create instances
Wait for SSH to be ready on all VMs:
for vm in "${VMs[@]}"
do
while ! gcloud compute ssh root@$vm --zone={{{ project_0.default_zone|(zone) }}} --command "echo SSH to $vm succeeded"
do
echo "Trying to SSH into $vm failed. Sleeping for 5 seconds. zzzZZzzZZ"
sleep 5
done
done
At the prompt asking if you want to continue (Y/n), type Y.
Press Enter key a few times to set an empty passphrase.
Create a vxlan with L2 connectivity between all VMs:
i=2
for vm in "${VMs[@]}"
do
gcloud compute ssh root@$vm --zone ${ZONE} << EOF
apt-get -qq update > /dev/null
apt-get -qq install -y jq > /dev/null
set -x
ip link add vxlan0 type vxlan id 42 dev ens4 dstport 0
current_ip=\$(ip --json a show dev ens4 | jq '.[0].addr_info[0].local' -r)
echo "VM IP address is: \$current_ip"
for ip in ${IPs[@]}; do
if [ "\$ip" != "\$current_ip" ]; then
bridge fdb append to 00:00:00:00:00:00 dst \$ip dev vxlan0
fi
done
ip addr add 10.200.0.$i/24 dev vxlan0
ip link set up dev vxlan0
systemctl stop apparmor.service
systemctl disable apparmor.service
EOF
i=$((i+1))
done
After you are done you now have L2 connectivity when using the 10.200.0.0/24 network. The VMs will now have the following IP addresses:
Admin Workstation: 10.200.0.2
3 x control plane: 10.200.0.3,4,5
3 x worker nodes: 10.200.0.6,7,8
Click Check my progress to verify the objective.
Add L2 connectivity
11. Prepare the workstation machine for needed software components for this lab:
Click Check my progress to verify the objective.
Install software components
12. Create SSH key for the Admin workstation machine and add corresponding public key to the rest of the VMs:
gcloud compute ssh root@$VM_WS --zone ${ZONE} << EOF
set -x
ssh-keygen -t rsa -N "" -f /root/.ssh/id_rsa
sed 's/ssh-rsa/root:ssh-rsa/' ~/.ssh/id_rsa.pub > ssh-metadata
for vm in ${VMs[@]}
do
gcloud compute instances add-metadata \$vm --zone ${ZONE} --metadata-from-file ssh-keys=ssh-metadata
done
EOF
Click Check my progress to verify the objective.
Create and add ssh keys
From the Navigation menu, find Operations section, and select Monitoring > Overview, this will create a monitoring workspace which is required by the script in the next step.
Go to Google Cloud Console and view the Anthos bare metal server under Compute > Kubernetes Engine > Clusters section. You should see the cluster has been authenticated and logged on using your Google Cloud login.
If not, follow the on-screen instructions below to log into the Anthos bare metal server:
Click on the three dots on the right side of your cluster.
Click Log in.
In the pop up window, select Use your Google identity to log-in and click Login.
Your cluster should now be authenticated.
Task 2. Install Cloud Service Mesh and Knative
In this section you will deploy Cloud Service Mesh on the bare metal cluster. You will:
Install Cloud Service Mesh kit
Configure certs
Create cacerts secret
Set network annotation for istio-system namespace
Configure Cloud Service Mesh Configuration File
Configure Validation Web Hook
First, run the following script to install the Cloud Service Mesh:
Now you will deploy the Redis Enterprise Operator and Redis Enterprise cluster using the command line.
Run the following script to deploy a Redis Enterprise cluster. First, it will deploy Redis Enterprise Operator for Kubernetes and then followed by Redis Enterprise cluster:
The deployment will take about 10 minutes to complete. Once it is complete, you should see this line: statefulset.apps/redis-enterprise 1/1 5m after running the following script:
Remain inside the Admin workstation machine and run the following to verify the Knative service is up and running and view the status of the "redisconf" Knative service:
You should see a similar output like the following from the curl command:
Task 6. Run a load test against the Knative serverless application
In the existing Cloud Shell terminal, run the following command to view the status of redisconf Knative service:
watch kubectl get deployment
You will notice the number of pods for redisconf deployment will increase when executing the load-test in a new terminal window.
Open another terminal (Cloud Shell) by clicking (+) right after the current terminal tab and get inside the Admin workstation machine by running the following commands:
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated December 27, 2023
Lab Last Tested February 21, 2022
Copyright 2025 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
Labs create a Google Cloud project and resources for a fixed time
Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
On the top left of your screen, click Start lab to begin
Use private browsing
Copy the provided Username and Password for the lab
Click Open console in private mode
Sign in to the Console
Sign in using your lab credentials. Using other credentials might cause errors or incur charges.
Accept the terms, and skip the recovery resource page
Don't click End lab unless you've finished the lab or want to restart it, as it will clear your work and remove the project
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one
Use private browsing to run the lab
Use an Incognito or private browser window to run this lab. This
prevents any conflicts between your personal account and the Student
account, which may cause extra charges incurred to your personal account.
In this lab you will learn how to create Compute Engine VMs on Google Cloud to simulate GDVC on Bare Metal (BM) in high-availability mode, install Anthos Service Mesh and Knative on the GKE on Bare Metal cluster, deploy Redis Enterprise for GKE and a Serverless application, then run a load test.