- [Instructor] Now that we've looked at docker orchestration
from a theoretical perspective, let's just have a brief tour
of using one of these systems.
Here I am in the Amazon Web Services console,
in the EKS service, where I've already configured a cluster.
So I'd like to show you what it looks like
to use an existing cluster
to deploy something with Kubernetes.
So here in the console, I see that I have a cluster,
but I don't see anything else.
With Kubernetes, you do essentially all of your interaction
with it through the command line.
So here I am in my command line.
I'm gonna run kubectl get services.
And I see that my cluster isn't running anything.
It's running only its own management service.
Now, let's go ahead and deploy something
to give you an idea of what it looks like.
Over here on the Getting Started page for EKS,
I've already gone through the steps
of setting up the cluster and getting the authentication
to work between my computer and this cluster.
And down here at the bottom,
we have launching an application.
Let's go straight to the fun part.
Everything in Kubernetes has a replication controller
and a service, the replication controller's job is
to make sure that this service is up when it needs to be.
So we're essentially going to create a bunch of services.
First, we'll create a replication controller for each,
then we'll create the actual service.
So I'm gonna start by copying this command here,
which is going to call kubectl apply
and then a path to a controller definition.
And we see it created the redis-master controller.
And now, I'm gonna create a redis service,
kubectl apply, and then again,
we just pass a path to a configuration file.
In this case, the configuration file is on the web,
but it could just as easily be sitting on my computer.
Okay, we've created one of the services.
Create the next replication controller.
And the next one.
This project has a few services that all work together
to provide a sample guestbook application,
the classic Kubernetes example.
And then I'm going to repeat the process a couple more times
with the rest of the services in this application.
And now, let's see if it worked.
I'm gonna ask Kubernetes what services are running.
Ah, and there we go.
Now, because my screen is narrow,
it's cutting off the full DNS name
of my service there, so I'm gonna run it again
with the wide option so that I can get the whole thing.
Okay, let me just open up a new tab here,
paste in the DNS name that was created for my service,
and add the port number, 3000.
And this may take a minute to operate
because the DNS name may still be propagating
across the internet, so you might get a DNS not resolved
for the first five minutes or so.
And then it usually picks up right after that.
And there we have it, our guestbook service is running.
Let me sign in.
Arthur is here.
So now that I've got that running, tried it out,
I'm gonna go back to the command line.
And I'm gonna delete it so that
I don't run up too much of an Amazon bill.
So again, I used the kubectl command
to delete all of the things I just created.
I'm gonna delete the redis-master, redis-slave,
the overall guestbook app, and then
I'm gonna delete its backing data stores,
the redis-master and the redis-slave
and the service for the guestbook itself.
Clean it all up.
And now I can see my cluster is back to running nothing.