KASLIN FIELDS: Hello, I'm Kaslin Fields,
and I'm a developer advocate at Google Cloud.
Today, I'll be walking through the basics
to get started with Anthos on Bare Metal.
Let's get going.
Anthos is a platform made up of a variety
of products all designed with enterprise use cases in mind.
One key factor of enterprise ecosystems
is that they often span hybrid and multi cloud environments.
The Anthos platform is designed to give a consistent user
experience across platforms.
You can expect that products with Anthos in the name
will have features and capabilities designed
for hybrid and multi cloud environments.
Today I'll be talking about Anthos
on Bare Metal, which is a tool you
can use to incorporate your on-prem environments
into the Anthos platform.
Anthos on Bare Metal gives you the Google provided
consistent experience and useful tools and features
of Anthos for you to run on your own self-managed hardware.
We know that every environment is different,
so there are a variety of supported configurations, which
you can learn more about in the documentation.
The install process with Anthos on Bare Metal
includes an integrated pre-flight check
to ensure your system meets requirements.
The installer itself allows you to declaratively deploy Anthos
components onto your own on-prem systems.
Anthos on Bare Metal can be deployed
on either physical or virtual infrastructure
and supports a variety of Linux distributions,
such as Red Hat Enterprise Linux, CentOS, or Ubuntu.
Anthos on Bare Metal comes with an out-of-the-box Kubernetes
networking stack, including load balancing and overlay
networking.
There are some basic requirements
around networking for the hardware you're
using to run your Anthos on Bare Metal cluster, which
you can learn more about in the documentation.
Integration with the container storage interface
allows for integration with your on-prem storage infrastructure.
Anthos on Bare Metal provides tooling to perform smooth
in-place upgrades and includes out-of-the-box integration with
Cloud Operations, formerly known as Stackdriver for System,
as well as application logs and metrics,
as well as the potential to integrate with other
observability tools.
While Anthos is largely centered around Kubernetes,
we know not every workload may be able to run in containers.
So Anthos can also make use of Kubevirt.
Kubevirt is an open source project
allowing Kubernetes to manage virtual machines
like it manages containers.
There are a number of prerequisites
your environment will need to meet in order to be
used with Anthos on Bare Metal.
Here, you can see a description of the hardware environment
I'll be using in this demo.
I'll be using three Intel Next Unit of Computing nodes,
or Intel NUCs.
I've imaged each of these to be running Ubuntu 20.04.1 server.
There are a few Linux distributions
which meet the current requirements for Anthos
on Bare Metal.
Be sure to check the documentation
for the latest operating system and hardware requirements.
I've upgraded to my NUCs to have 32 gigabytes of RAM each.
These will be the nodes where the Kubernetes cluster,
and, therefore, any workloads, will be run.
The other NUC is to be used as an admin workstation.
This can be any Linux workstation.
I'll use this node to SSH into the others
to do any configuration and to run the bmctl command, which
is the command line tool for Anthos on Bare Metal.
There are also a number of prerequisites to set up
on the Google Cloud side.
You will need a project and sufficient privileges
on that project to configure Anthos on Bare Metal.
You will also need to configure a few service
accounts for things like logging and monitoring,
and to connect to your Bare Metal cluster to Anthos in GCP.
Now let's take a look at the process
to set up an Anthos on Bare Metal
cluster on this configuration.
In order to create a cluster for Anthos on Bare Metal,
we'll need YAML file to describe our Kubernetes cluster.
We can create a convenient base file
using the command bmctl create config -c and giving it
a cluster name.
There are several components that
will need updating in the created file.
I've already created one and configured it
for my environment.
Let's take a closer look.
If you're familiar with Kubernetes YAML manifests,
this probably looks familiar to you.
At the top of this file we have a variety
of key file paths, which we will need
for a cluster installation.
Then we begin blocks declaring API objects.
The first interesting one here is the cluster definition.
You can see here that we can define a cluster type.
Anthos on Bare Metal offers various architecture
configurations that can be useful in multi cluster
environments, or a single cluster environments,
such as at the edge.
We will use GKE connect to register
this cluster with Anthos.
Here, we define the information for our cluster's control
plane.
In my case, as this is just a demo environment,
I will be using a single machine for my control plane.
For high availability, you would generally want three.
Here, I have the IP my admin workstation will use to connect
to the control plane node.
Next, I need to specify the IP ranges Kubernetes will use
to create pods and services.
There is also a load balancer component needed for Anthos
on Bare Metal.
This can run on the control plane nodes,
or as a separate machine or set of machines.
In my demo environment, I will be using my control plane node
also as my load balancer, so here
I specify a virtual IP on my network
to be used for the load balancer.
I also specify a range of IPs for use by the load balancer
to expose my services.
If you're using a proxy, you'll need
to add some configuration here.
I'm not, so I'll leave this all commented out.
Here, we see some information used for logging and metrics.
And here at the bottom of the file
is the definition of our worker node pool.
The machines in this pool are where workloads will actually
be run.
As I mentioned, in my case, I have only one.
Now I'm going to use bmctl, the Anthos Bare Metal command line
tool, to deploy the cluster I've defined.
To do that, I'll run bmctl create cluster -c
and give it a cluster name.
This will take a few minutes to complete.
Now we've successfully deployed our cluster.
We can confirm that we can connect
to our cluster using kubectl.
We can see in the output of our cluster creation
the Kubeconfig file we'll need to use
to connect to the cluster.
Running this command shows me the nodes
of my two-node demo cluster.
I'll also go ahead and export my Kubeconfig
so I don't have to specify it in each command.
The Bare Metal command line tool not only created the cluster,
but also connected the cluster to Anthos in Google Cloud,
so we should be able to see our cluster in the Anthos
dashboard in the Google Cloud console, as well.
Here in the Google Cloud console,
we will go to the Anthos dashboard.
And here in the Anthos dashboard,
you can see that, in the cluster status box,
it lists one healthy cluster.
If we click View Clusters, we can see our cluster here.
This is the cluster we just created
on a set of Intel NUC hardware.
And now we can see and manage it in Google Cloud.
Now let's deploy an app to our cluster.
For this demo, I'm going to use a very simple Hello World app.
If we look at our deployment YAML file,
you can see that I'm defining a Kubernetes deployment here
with three replicas and using a Hello app container image.
Now, to create my deployment, I'll
run kubectl create -f and give it my deployment file.
You can see that the deployment has been created.
Now we can check it with kubectl get deploy.
You can see our deployment is up with three ready pods.
Now I'll create a service using the my-service.yaml file.
You can see that this is a service of type load
balancer, which we'll be able to reach on port 80.
We'll create this with kubectl create -f and give it
the file name.
And we can take a look at our service with kubectl
get svc, or service.
Using my service's external IP provided by the load balancer,
I can run a curl command on that IP
to see that my app is running properly.
Here you can see in our output that my application
is running as I expect.
In this demo, we walked through the requirements
to create an Anthos on Bare Metal Cluster,
saw some of the benefits you get from Anthos in Google Cloud,
and deployed an application to our on-prem cluster.
Check out Google Cloud for more on running
enterprise-grade, hybrid, and multi cloud
architectures with Anthos.