- [Instructor] To get a little more variety
in Docker deployment let's go deploy
a basic web application using Google's
hosted Kubernetes option.
I'm gonna start here at
the Google Kubernetes Engine Quickstart guide.
Quickly move through here.
I'm gonna head on over.
Create a new project.
Let's call it learning.
Select.
Click on learning.
All right.
Click on Kubernetes Engine.
Once this is ready you might get a question
about enabling Kubernetes Engine.
Click enable if it shows you that.
If you've already used Kubernetes Engine
then it doesn't display it.
One other tip while we're waiting here,
if you're logged into multiple Google accounts,
it can be very confusing
when you switch between project tabs,
which one's connecting to which account,
and following links can sometimes jump accounts.
It's much easier if you're only logged
into one Google account
or if the account that you use for Google Cloud Services
is the default account.
Okay now that the project is finished creating
I'm back at the project dashboard
and I'm gonna go ahead and click on
activate Google Cloud Shell.
This just provides a very convenient
virtual pre-configured environment for using Kubernetes.
Well, almost pre-configured.
Now back to the Quickstart guide.
I need to go...
gcloud config set project
to the project ID which
is printed right above it, conveniently.
All right.
Set zone.
And I'm going to choose the example zone of us-west1-a.
Now I'm gonna use the Google Cloud console
to create a Kubernetes cluster.
Cluster create.
Control l clears the screen in this setting as well.
Cloud create cluster.
I'll call it learning.
Okay, and creating the cluster does take a few minutes.
Okay, now that my cluster's up, let's use it.
I'm gonna configure the login credentials
in my cloud shell here to use that cluster.
Gcloud container clusters get credentials learning.
Okay.
Now that I've created the service,
let's expose it to the internet.
Initially services, when they're created,
are created within the Kubernetes network.
And then if you want to attach a pipe
to them from the internet you create
a load balancer that will direct traffic
into and out of the service.
You could do that with kubectl expose.
In this case ran kubectle expose deployment
hello-server, the name of the service I just created,
and I'd like to use a loadBalancer to direct traffic
to it from port 80 on the web to port 8080
within the service.
Now let's take a look and see if it's ready.
Kubectl get service hello-server.
Ah, there we see it's up, it's ready,
and it has an external IP address of this one right here.
All right.
Let's open a new tab.
Set in and see if it worked.
Ta da.
There is a lot more to Google Kubernetes Engine.
This has been a sample to help guide your choices
as you choose where to go next in learning Docker.
So one more thing before we go.
Let's just clean that up
so that I don't get billed too much for it.
Control l to clear.
Delete the hello service.
And I can shut down the cluster that I used to run it.
Yes, I am sure.
All right, now that's all cleaned up.