LISA SHEN: Hi.
My name is Lisa Shen, and I'm a product manager
with Google Cloud.
Anthos provides a unified platform
for managing Kubernetes clusters across different clouds
and on prem.
These clusters can be running inside virtual machines
and instances, as well as on bare metal.
Anthos is a 100% software product
that extends Google Cloud Services and engineering
practices to your environments so you
can modernize the applications faster and establish
operational consistency across them.
Anthos manages not only Anthos GKE clusters
on prem and in multiple clouds, it also
manages any standard CNCF-compliant Kubernetes
clusters, such as AKS, EKS, and more.
Anthos is a great multi-cluster management tool
to manage, standardize, and secure
your clusters across multiple cloud environments
and Kubernetes vendors.
In this video, let's take a look at how to set up
Anthos attached cluster in GCP.
We'll use AWS EKS as example in the demo
and show you how to attach an EKS cluster
and manage it from the GCP Console with Anthos.
First, we're going to create an AWS EKS
cluster using the Terraform.
In this demo, we'll just follow the HashiCorp's Terraform
tutorial to provision an EKS cluster on AWS.
I have done the prerequisite setup prior to the recording
by getting the AWS CLI, kubectl, and other tools required
by the tutorial.
I've also provided AWS access credentials
in my Linux box via the AWS CLI.
Next step is to set up and initialize the Terraform
workspace.
I have downloaded EKS provision tutorial repo to my local disk.
And now let's cd to that directory.
Now, let's first initialize the Terraform workspace,
which will download and configure the providers
by running the terraform init.
Next, let's run the terraform apply and review
the planned action.
The terminal outputs indicates the plan is running
and what resources will be created.
And this terraform apply will provision
a total of 53 resources, including
VPCs, security groups, autoscaling groups,
EKS clusters, and so on.
So let's enter Yes.
This creation process should take about 10 minutes
to create an EKS cluster.
Now let's fast forward to the end of the cluster creation.
Upon successful application, the terminal
prints the outputs defined in the outputs.tf.
As you can see, a cluster called education-eks
has been created automatically.
And you can also verify the resources
created by these Terraform scripts via the AWS console
here.
Now let's take a look at how we attach the newly created EKS
cluster to Anthos and use GCP as the single pane of glass
management tool to monitor the cluster.
First, let's register the AWS EKS cluster
in the GCP environment.
With these commands, we retrieve the access credentials
for the cluster and configure it kubectl.
Next, let's get the current context,
which should be the cluster to register.
And we'll use gcloud container hub membership CLI
to do the cluster registration.
Registering the cluster outside of Google Cloud
installs Connect Agent in the cluster
to manage clusters connection to its fleet.
The Connect Agent needs an identity
to authenticate it to Google, which
can be Google Cloud Service account or the fleet workload
identity.
Connect allows you to connect any of your Kubernetes clusters
to Google Cloud.
And this enables access to cluster
and to workload management features, including
a unified user interface or Google Console
to interact with your cluster.
Now let's take a look at the GCP Console.
You can see the cluster right now
showing up in the GCP Console under the Anthos page.
But we still need to log in to the attached EKS cluster.
First, we're going to generate tokens
to log into the clusters in a GCP Cloud Console.
In the cloud shell, we're going to create Kubernetes service
account on the cluster and grant it the cluster admin role.
Next, we're going to get a token that we
can use to log into the cluster from the console.
Let's copy the token here.
And choose the token option and paste the token.
And now you have access to the AWS EKS cluster
as attached cluster.
You can interact with your clusters and workload
via the GCP Console or the CLI.
You can click on the cluster to view more details.
And that concludes the demo for setting up
an AWS EKS cluster as an Anthos attached cluster on GCP.
So while using Anthos attached cluster,
you get a single pane of glass management
for multiple Kubernetes clusters,
no matter where they are, with a centralized logging
and monitoring.
You will also get a consistent operating model with access
to GCP services across environments.
You can orchestrate and manage workloads
on the attached clusters, like native GCP Anthos clusters.
Anthos Configuration Management and Anthos Service Mesh
will work seamlessly on these attached clusters.
You can check out a step-by-step guide
of setting up an Anthos attached cluster in the GitHub site
here.
Thank you for watching the video.