- [Narrator] We're going to deploy
the PHB Guestbook application with a MongoDB database
into our cluster.
You can find this example in the Kubernetes documentation
at the URL below.
So let's go ahead into our terminal and try and run this.
First up, make sure we are in the 05_01 RealWorld directory.
And if you look in here we'll notice
that there are two files, the Readme and the guestbook.yml.
We're actually going to deploy the guestbook.yaml
but before we do that, let's see what's in there.
vi guestbook.yaml.
This file is a lot larger than any of the files
we've deployed so far.
It seems like it has a deployment of name Mongo.
It's linked to a container Mongo:4.2
and then we have a service associated with this
which is named Mongo.
You'll notice that there are these three dashes
and this three dash notation actually allows us to append
multiple Kubernetes resources,
like deployments and services, into one single file.
So as we go along,
we'll notice that we have another deployment.
In this case this is called the frontend,
it has some labels associated with that,
and the container that's deployed here is called guestbook
with the image of karthequian/gb-frontend:v5.
So, this looks like this is the actual application
or the user interface that we might end up using.
And there is a service associated with this deployment
named frontend as well.
And this is of a type LoadBalancer.
So that's the end of the file,
so it looks like we have two deployments and two services
that we want to deploy.
So, let's exit
and let's make sure that we have clean cluster first up.
So we'll do a get deployments,
no resources found in the default namespace.
That's great.
As well as kubectl get services,
this will just return the Kubernetes service that comes
default in minikube.
So we currently have a clean cluster, which is great.
So next up, let's go ahead and deploy our application.
Kubectl create -f guestbook.yaml.
So this says that it's created a deployment called Mongo,
a service Mongo, a deployment frontend
and service frontend.
Let's do a check real quick on the deployments.
Kubectl get deployments.
The frontend and Mongo deployments are online.
Ready three of three.
Ready one of one.
That looks good.
Let's take a look at our services.
Kubectl get services.
We now have three services here, the frontend service,
the Mongo service and the Kubernetes service
and frontend of type LoadBalancer.
Great, it looks like everything's online.
Let's see if we can actually access the web interface.
In order to do that, we can do a minikube service frontend,
and this creates the tunnel
and we have the guestbook application up and running here.
Great.
So let's type in some messages
and see if they reflect back to us.
Hi.
My name is Karthik.
And,
how do you pronounce
kubectl or kubectl, for example?
Great.
So there we have it, this is a larger application
than we've deployed in the past,
which involves multiple deployments and services
and we have it up and running in the Kubernetes cluster
as well as the interface that we see over here.