JEEVANA HEGDE: Hi, everyone.
I'm Jeevana Hegde, a customer engineer at Google Cloud,
and welcome back to the Technical Guide
for Startups, where we are creating a series of videos
for technical enablement to start, build, and grow
your businesses successfully and sustainably on Google Cloud.
In our previous video, we deep dived
into streamlining your application deployment.
And now we're onto the fourth stop,
which is all about deploying your microservices application
on Google Kubernetes Engine.
In this video, we're going to go over understanding
microservices and Kubernetes at a high level
and introduce you to Google Kubernetes Engine, or GKE,
and understand a few of its important features.
We will also be looking at a sample e-commerce application
architecture and see how it will be deployed
in the demonstration section.
We will finally end it with a customer success
story of an actual Google Cloud customer
and wrap up with some actionable next steps.
So without any further ado, let's get
right on to exploring the Google Cloud platform together.
Imagine you and your teammate have built out a fairly large,
complex application.
Now let's say you're done making some changes
to your part of the application, and your teammate
is still working on an entirely different part
of the same application.
Wouldn't it be convenient if you could just test out
your changes, or even deploy to the main application
while your teammate continues working on his part?
This sort of a planning approach can
be taken if you build out your architecture with microservices
as opposed to monoliths.
A monolithic application is a single unified unit,
whereas microservices architecture breaks it down
into a collection of smaller, independent units.
Containerization is a method of visualization
which separates the applications and services at the operating
level.
And microservices uses containerization to deliver
smaller, single-function modules that work in tandem
to create more agile and scalable applications.
And Kubernetes is excellent for containerization.
Moving on to Kubernetes.
Kubernetes can be summed up by two things.
One, it's an abstraction over infrastructure.
What I mean by this is that, when you install Kubernetes,
it handles the compute, networking, and storage
for your user workloads, so you don't
have to worry too much about the underlying environment,
and you'll be able to focus on your application.
And secondly, Kubernetes uses a declarative format
to orchestrate its containers.
What we mean by that is that you tell us what you want,
and not necessarily how to create it.
Kubernetes runs a control loop to ensure
that the current state always matches the desired
state, as mentioned, in your configuration files.
If it doesn't, Kubernetes is smart enough
to know what steps to take to keep them in alignment.
It might all seem a little complex.
In fact, it is.
But that's where Google Kubernetes Engine, or GKE,
comes in.
GKE is a managed service for running Kubernetes.
GKE essentially gives you an abstraction by providing you
with freedom with some configurations,
and also manages a lot of features
for your containerised applications.
So when we say managed, what we mean
by that is that it manages your auto-repair, auto-upgrade,
auto-scaling, auto-provisioning, and regional or
high-availability code plane.
It is also your amazing site reliability engineering team.
We have two modes in GKE, Standard and Autopilot.
Standard Mode is where you configure
the cluster's underlining infrastructure, giving you
the node configuration flexibility.
And Autopilot Mode is a step ahead,
where GKE provisions and manages your cluster's underlying
infrastructure, including nodes and node pools,
giving you an optimized cluster with hands-off experience.
Now let's quickly jump on to a demonstration
of configuring different aspects of a GKE cluster
in both Standard and Autopilot mode.
We start off by going to the Google Cloud console.
This is the dashboard.
We then move to the Navigation menu
and go to the Kubernetes Engine.
I suggest if you're not familiar with the Google Cloud console,
please watch the Getting Started on Google Cloud video
that we have for you in the description box below,
just to get a quick run-through of the Google Cloud console,
and then you can come back and continue this video.
Here, we already have a few of them pinned,
and we're going to go scroll down and go to the Kubernetes
Engine.
Once you click on Kubernetes Engine, this opens up.
You can then create a cluster by clicking on Create
here or here.
Like we discussed, we have Standard and Autopilot.
Let's start off with Standard.
Once you click on Configure, if this
is your first time creating a cluster,
you are given a quick tour of what tabs to click on
and a brief overview of what's in it.
I'm going to leave the cluster name as it is,
and then I can choose whether I want
a zonal or regional cluster.
I can also specify if I want to give
the default node locations.
I can then choose my control plane version,
whether I want it to be static or release channel.
In release channel, every time a new version is released,
the clusters are automatically upgraded, unlike in static.
When I leave it at release channel
and go here to default-pool, you can
see that the auto-upgrade and auto-release are blurred out.
This is because this is automatically taken
care of in release channel.
Now instead, if I go back and select Static version
and come back to default-pool, you
can see that you can choose whether you
want to auto-upgrade or auto-repair or not.
Well, let me leave it at release channel,
as it's a best practice, and come back to default-pool.
Now I'm going to leave my node pool name to default-pool,
as it is, leave the number of node as well to 3,
change the minimum number of nodes per zone
to be 1 and maximum to be 3, and just quickly look
at the other configurations and leave them as it is.
I can either create my node pool directly here, or go to Nodes
and change the configurations of the nodes
that I want in my node pool.
I can choose from the different families
here and change my machine type.
And maybe I want my machine typed to have, let's say,
two vCPUs and 8 GB RAM.
And maybe I also want my disk to have better performance,
so I'm going to change my boot disk to make it SSD.
I'm going to quickly look at the Security tab
here, leave them all to as it is.
Look at Metadata in case maybe I wanted
to add some Kubernetes label.
In cluster, I'm going to go to the automation tab and Enable
Vertical Pod Autoscaling.
I could enable auto-provisioning here as well,
but I'm going to not do that now.
Move to the next tab.
Then here in Networking, it's back to default,
which is my default network.
You'll learn more about VPC creation
in the upcoming videos, so stay tuned.
I can choose whether I want my cluster
to be public or private.
Then you can see that HTTP load balancing
has been enabled here.
This is for external load balancing.
You'll learn, again, more about this in the upcoming networking
video.
In the Security section here, I'm going to, let say,
disable my shielded GKE nodes.
Then in Metadata, here it's the cluster metadata, as opposed
to what we saw previously.
Then in the Features section, you
can see a bunch of other features which you can enable,
such as Cloud logging, Cloud monitoring, Anthos service
mesh, and so much more.
And finally, I'm clicking on Create.
For an actual application, you don't
have to run through all of these different tabs,
as the default values are already chosen for you.
Of course, you can configure them yourself as well.
And there you go.
We have a cluster which is created.
For configuring an Autopilot cluster,
it's much more straightforward.
As you can see, in the tool here,
it only gives you one thing that it talks about.
As you can see, a few of those features
that we saw earlier from the Standard
are already taken care of in the Autopilot mode.
Again, I'm going to leave the cluster name as is.
And the only option here is for your cluster to be regional.
This ensures high availability at all times.
You can choose a region, of course.
And additionally, you have some networking
and advanced options.
You can choose whether you want your cluster
to be public or private.
Let me just drop down the networking options here.
I can choose my network here, whether I
want it to be the default one or a network which I've created.
I can also choose my node subnet.
There's also a possibility for putting in different address
ranges.
If not, the defaults are taken.
Now I'm not going to change anything
here, and hide my networking options,
and go to Advanced Options.
This gives me a bunch of different options
for the tabs which we had seen earlier
in the Standard section.
I'm going to leave them all as it is and click on Create.
And there you go, your Autopilot cluster has been created.
Did you see how much of a difference
there is simply between Standard mode and Autopilot mode?
Now imagine you didn't have GKE, and you
had to do all this yourself only using Kubernetes.
Wouldn't it be so much more harder?
Moving on to my favorite section of this entire video.
Whether your application is a bow-wow doggy dog boutique,
or ouch, first aid please, health care application,
you can deploy your microservices application
on GKE.
For the purpose of this demo, we'll
be sampling an e-commerce application
with a simple and straightforward name.
Let's call it Online Boutique.
This sample application has gotten 11 microservices.
Let's quickly look at the architecture
so we get a clear picture of what
our application looks like.
As you can see, it's got a payment service,
an email service, the frontend service, a separate product
catalog service, and so on.
My point being, the application is broken down
and makes the maintenance, debugging, scalability
so much more easier.
In this application, the users access the website
through the internet, and they reach the frontend service.
They can then browse the items in the product catalog,
add them to their cart, and then purchase them.
In the backend, the application accesses a database.
Additionally, a recommendation service
helps recommend similar products, and so on.
This is the basic workflow in terms of the architecture.
Now let's move on to the demonstration.
As part of this demonstration, let's look at three steps.
First, let's begin by exploring the code briefly
from the GitHub repository.
Second, let's deploy the application
on GKE via the command line interface.
This, on Google Cloud, is the Cloud Shell.
And finally, let's test out the application once we deploy it.
Now quickly jumping onto the first part.
I'm going to the GitHub repository
of the online boutique store.
We can go to the source file, have
a look at the different microservice
files available here.
Then let's say I go to the cart service.
Go to the source file here and then click on Services.
We see the C# files here.
Let me go ahead and open one of these,
the cart service C# file.
You can see the code here.
Similarly, you can go back and look at these C# files to find
the code respectively in the microservices.
We also have a few Node.js, Python, and Java files.
This very simple and short run through
was essential so we get an idea to understand how
the code has been broken down.
Now that we have this in place, let's go ahead
and deploy this application on GKE.
You can deploy the application through the Google Cloud
console, like how we created a cluster earlier,
or we can use the command line interface.
Here, let's go over the latter.
To do so, simply activate Cloud Share and get started.
Start off by assigning your project
ID to the variable project ID.
Now for this particular project or project ID,
I'm enabling a few APIs.
Now let's go ahead and clone our GitHub repository.
Fun fact, you have something very
similar to your GitHub repository on Google Cloud
itself.
This is called the Cloud Source repositories.
You can store your code here just as you do on GitHub,
so everything stays on the platform.
Now let's go ahead and create our cluster.
As we already discussed, we can do this either in the Standard
mode or Autopilot mode.
Here let me go ahead and use the Autopilot mode.
Once we've created it, we then deploy our sample cluster.
Now let's ensure that all our parts are ready.
Once they all show that they're running,
we can pick the external IP address
so we can access the website and try
buying an item through the application.
Now let's enter the external IP address and test it out.
Yay, we have our website now.
Now we can scroll through and browse through items.
Let's add this watch to the cart and see
some product recommendations which I might like.
OK, great.
Let's also add this top now.
And as we can see, this e-commerce application
works perfectly.
And that brings us to the end of this demo.
Now let's look at a real-world Google Cloud
customer who benefited from the Google Kubernetes Engine.
Meitu is a popular photo editing application
which is a leading image processing and social media
platform in China driven by artificial intelligence.
GKE helped Meitu to simplify the workflow
and reduce the operational costs by 44%.
GKE's autoscaling features allowed
them to use small machines with a high bandwidth.
GKE gave the customers a very high rendering speed
of just a few seconds, which improved the customer
experience and made customers come back to them.
Additionally, Meitu uses Anthos to deploy and manage
containers all over the world, BigQuery
to analyze user behavior and get more accurate user insights,
and Firebase, which helps them reduce the split testing
time to 50% so that engineers can roll out
new features faster and gain bigger market share.
The Senior Vice President of Meitu talks about some
of the numbers here, which I mentioned earlier.
They were also able to automate their infrastructure management
and be much more productive.
Hopefully, that gave you a bit of a nudge.
So when are you getting started on the Google Cloud platform?
If this video interested you to learn more
about containerization, GKE, Autopilot versus Standard
and when to use which, don't forget to check the suggestions
we have for you in the description box below.
And that brings us to the end of the fourth stop, which
is the GKE video.
In the next video, you will learn more about the Compute
Engine, and you'll be learning how to configure Compute Engine
instances.
You will also be doing a sample application deployment
and end it with a customer success story,
just like we did in this video.
So stay tuned if you're looking into deploying
your applications on virtual machine instances.
Don't forget to like and subscribe
to our YouTube channel.
Hit the like button to stay up to date
and receive notifications every time we post a new video.
Bye for now, and we will see you very soon in our next video.