LISA SHEN: Hi.
My name is Lisa Shen.
I'm a product manager in Google Cloud.
In this video, we're going to take a look
at how to set up an Anthos user cluster on bare metal
via the Google Cloud Console.
Anthos provides a unified platform
for managing Kubernetes clusters across hybrid and multi-cloud
environment.
These clusters can run on top of VMware vSphere
or on bare-metal servers.
Anthos is a software product that
extends Google Cloud Services and engineering best practices
to your environments.
So you can modernize applications faster
and establish operational consistency among them.
Anthos clusters on bare metal brings Google Kubernetes Engine
to your on-prem data centers.
With Anthos clusters on bare metal,
you can create, manage, and upgrade Kubernetes clusters
on your own hardware in the data center
or edge with best performance and flexibility.
You not only have direct control over the application scale,
security, and network latency, but also getting the benefit
of containerized applications through the GKE and Anthos
components.
You can use bmctl utility today to manage
the lifecycle operations of Anthos clusters on bare metal.
We have now announced a new feature
that allows you to create the bare-metal clusters
from the Google Console.
A new Google Cloud-hosted GKE on-prem API
is introduced to manage clusters from the Cloud.
Now, let's take a look at how to use
the Cloud Console to create an Anthos user
cluster on bare metal.
In the Google Cloud Console, select the Cloud project
that you want to create a cluster in.
This must be the same project that the admin
cluster is registered to.
Note that I have already set up Anthos admin cluster
before the video.
And I'm using a Google Cloud Compute Engine
instance to simulate the actual hardware service environment.
First, click Create a Cluster.
Click on Premises.
And then select Bare Metal.
And then you get to the cluster basics.
Now you'll need to enter the name for the user cluster.
And under Admin Cluster, select the desired admin cluster
from the list.
And in the GCP API Location field,
select a Google Cloud region from the list.
The GKE on-prem API runs in Google Cloud's infrastructure.
And then a console uses this API to create
a cluster in your data center.
To manage your clusters, the GKE on-prem API
must store metadata about your cluster state in the Google
Clouds region that you specify when creating the cluster.
And then the metadata lets GKE on-prem API manage the user
cluster lifecycle.
And it doesn't include any workload-specific data.
And then next, you need to select the Anthos clusters
on bare-metal version for your user cluster.
User cluster must be either in the same version as the admin
cluster or one minor version lower than the admin cluster.
And then let's click to continue to go to the networking
session.
In the networking session, we'll provide IP address
for various use.
We need to add a control plane node IP first.
And then in the Load Balancer section,
select the load balancer from the mode list
to set up for the cluster.
In this demo, we're going to use the MetalLB, the bundled load
balancers, which can run on a dedicated pool of worker loads
or on the same nodes as the control plane.
Here, we're going to just use the control plane node.
For the BL address pool, we're going to use the default name.
And then we're going to put in our IP address range.
In the Virtual IP section, we'll need
to add a control plane VIP.
First, let's copy and paste that IP address in here.
This is the VIP-owned load balancer for the user clusters
Kubernetes API server.
And we're going to leave the ingress VIP as it is.
In the Service and Pod CIDRs sections,
specify the Kubernetes service and Pod IP address range
inside a notation.
Note they cannot overlap with each other,
nor with any address outside the cluster that you want to reach
from inside the cluster.
So let's copy the service CIDR and Pod CIDRs here.
Now, let's move on to the Storage section.
Anthos clusters on bare metal provides block and file
storage interfaces.
They have default options.
But you can also customize the configurations.
In this demo, we're going to just take the default option.
The final section is the configuration
related to the node pools.
A node pool is a template for the groups of worker nodes
created in the cluster.
In the Worker Node section, let's enter the IP address
of the machine for the cluster to run.
And we're now done with the Configuration section.
Let's click Verify and then Create.
It takes 50 minutes or more to create a user cluster.
The console displays the status messages
as it verifies the settings and creates
the cluster in the data center.
Now let's fast-forward to the end of the user cluster
creation.
As you can see, the cluster is now created successfully.
And it's up and running.
Let's log into the cluster in the console
so we can view the details of the cluster.
We're going to just use the Google identity to log in here.
Once it's logged in, you can view
all the details of the cluster from the console.
Now let's go back to our workstation.
And we're going to use connect gateway
to interact with the user cluster with kubectl
and deploy a simple application.
We're going to use gcloud container fleet memberships
CLI to fetch cluster credentials used to interact
with the connect gateway.
First, we're going to get the cluster name.
The membership name is the same as the cluster
name in this case.
And then we'll get the user cluster credentials.
After we have the necessary credentials,
we can run commands using kubectl,
as you normally would for any Kubernetes clusters.
And you do not need to specify the name of the kubeconfig
file.
As you can see, we have a worker node
and a control plane node for our user cluster
that we just created.
Now let's deploy a simple "hello" applications
by creating a deployment.
Next, we're going to create a Kubernetes service, which
is a Kubernetes resource that lets you expose the application
to external traffic.
And we'll run the kubectl expose command.
Now, if we go back to the Google Cloud Console,
we can verify that the hello-server service
and workload that we've just created
are listed for this particular user cluster.
In the last section of the demo, I'll
show you how to access the user cluster
and run the application from the admin workstation.
First, we're going to ssh into the admin workstation
that I've set up prior to this video recording.
Now, in admin workstation we'll locate admin cluster context,
which is in the bmctl-workspace folder.
Next, we'll get the kubeconfig file for the user cluster
by using bmctl get credentials command.
With this command, a kubeconfig with user clusters credentials
are written to a file that is placed in the folder called
bm-cluster-1, which is the same as our user cluster name.
Now you can access the user cluster with kubectl
by pointing the kubeconfig file to the user cluster context.
Now, with the external IP we've obtained, with the kubectl get
service command, we can issue the curl command
to verify the hello-server is, indeed, up and running here.
This concludes my demo.
Be sure to check out our website above to learn more
about Anthos and its various deployment options,
including Anthos cluster on bare metal.
Thank you for watching the video.