OK, so this is what we saw in the last demo.
So we deployed parts and services to keep it really simple and we were able to access our application
from a browser.
But deploying applications as just part has its own challenges.
Deploying parts doesn't help us scale our application easily if we wanted to add more instances of a
particular service.
And if you wanted to update the application like an image that was using the application, then your
application will have to be taken down by the new pod is created.
So that that may result in a net downtime.
So the right approach is to use deployments to deploy an application.
So let us now improvise our setup using deployments.
So we choose deployments over replica sets as deployments automatically creator of the gussets as required.
And it can have it can help us perform rolling updates and rollbacks and maintain a record of revisions
and record the cause of change, as we have seen in the previous demos.
So deployments are the way to go.
So we will add more pods if required for the front and applications like voting app and result app by
the by creating a deployment and setting the cost to three.
We'll initially start off with just one replicas for all for each of these components.
And later, we'll see how easy it is to scale them to three or more.
Right.
So we will also encapsulate the databases and the worker applications within deployments.
So let's take a look at that now.
So here I am in the Visual Studio Code.
And this is the project directory, which has all the parts and service definition files.
So let's create a new file for the deployments.
So we'll start with the voting app itself.
So I'll name this file as a wedding app, dash deploy Yamal and I'm going to use the split screen function
so that I can open the port and the deployment definition file side by side.
So let's create the deployment file for the building, the application by using the PA definition file
as the template.
So let's start with the API version and it will be apps slash.
We won the kind.
We'll be deployment.
And let's add the metadata.
The name of the deployment would be wedding app dash deploy and we'll add some labels.
Next, let's add the specked section.
And so it has already pre populated a couple of entries for us.
So we should be specifying the number of replicas.
And for all our part, we're just going to stick to one replica to begin with.
And since we are on a single note cluster to save some resources and under the selector section, I'm
going to add the labels from the pod.
So we use the match labels option and then we will copy and paste the labels over from the pod definition
file.
And now under the template section, I'm just going to copy everything from the metadata to the end
of the file and then paste it under the template section, once done, we fix the formatting.
All right.
So that looks good.
So let's proceed with the next deployment, which will be the red this deployment.
Sorry again I open.
Red is the red is part definition file.
And just like before we create a new file called Red, is that deployed on Yamal?
And then we will copy the contents of the voting app depending on file.
Just to get started.
And we will change the name of the deployment to readies deploy.
And the same for labels as well.
So we'll stick to replica one.
And we will copy the labels from the pod definition file for Redis.
And then we copy over the template from the parts and then paste it and then fix the formatting.
So that's done.
And we will proceed with the post, Chris Cual, the deployment.
Let's copy the reduce deployment file and open the post Chris Paul definition file for reference and
let's make the changes to the names and labels and update the selector labels with the ones on the pod.
And then move over the definition under the template section.
And then we fix the formatting.
OK.
So that looks all right.
Next, let's proceed with the workers.
So we're going to close this.
Let's create a worker app deployment file.
And we will copy and paste that template and update the name.
And let's copy the labels from the pod definition file and put it under The Selecter section and the
same as before.
Let's copy the pod manifest file and pasted under the template section.
So that's the deployment for worker.
And now we are left with one for the result app.
So again, we close these two.
And here is our result app.
We will create a new file result app deployed on YAML and we copy and paste a template again and we
update the name and labels and the template as we did before.
So we are now done with all our deployment definition files, and I'm going to get rid of all of this.
So here is all the new deployment files that we re created.
And now let's head back to our terminal and create these deployments along with the services.
So before we do that, let's make sure that there are no parts and services running in the cluster.
So we have cleaned up everything that was created for the previous demonstration.
So there are no parts or services other than the default component is one.
And now let's refresh and make sure that all our deployment files have been created.
So here we have the five new deployments that we created and the services will remain the same.
So we'll first start with the loading up deployment.
So we'll create it using the cube to create command and passing the voting deployment file as input.
And let's also create the service and let's do a quick check on the deployment and make sure that it's
running.
So, yes, we see that it is in R running state.
So now let's create the ready is deployment and followed by the ready service.
And similarly, let's create the post stress deployment and the post service.
And let's make sure that everything is up.
So we see that all the parts are up.
The deployments are running one out of one part, which means that the ports are up and running.
And let's check the service.
So we have the DB service.
We have the ready service and the voting service greater so far.
So now let's clear the screen and we create the worker deployment.
Remember, the worker does not have a service, so let's make sure that everything is running as as
expected.
And we see that the worker part of the deployment is running as well.
So finally, we create the result up deployment and the result app service.
And we now see that everything is running as expected.
So let's change this.
Two deployments, comma, SBC, so we have all the the five deployments in a running state and we have
four services.
So now let's get the orals for our two front end services.
So we'll use mini queue service and the name of the service that you are, a red flag.
And let's do the same for the result service as well.
And we get that you are El's with the ports.
Thirty thousand four and thirty thousand five.
So now I'm going to launch the Web browser and we'll try to access these applications.
So let's look at the first you RL, which is the voting app itself.
And let's get the vote.
And let me open another window here, which will go to thirty thousand five.
And you can see that the result is shown as expected.
So now I'm going to scale up the deployments are on the current scale command and specify the number
of replicas.
Two, three to add two more replicas for the wedding application.
So when we on the get DEPLOYMENT'S command, we see that there are three parts for the voting app right
now.
Now, if we now go to the euro and refresh the page, each time we see that the page is served by a
new pot each time.
So we see how easy it is to scale our applications with deployments.
Well, that's it for this demo.
I will see you in the next.