And welcome back into this video we'll be discussing about the upswept Life-cycle events.
Now, ops folks has basically fire events which occurred during the entire event lifecycle.
Now these events are set up, configured deploy and deploy and shut down.
Now, each of this event can be associated with a specific recipe of a cookbook, and those recipes
would be executed when these events are running.
So before we go ahead and understand more about this, let me show you how exactly it might look like
an obstacle.
So I'm in my office with a dashboard.
Now, let me click on the sample stack that we had created and I'll select the lead associated with
Norges.
Now, within this Norges clear, if you go to recipes, you see there are various events which are available
over here.
So these are set up, configure, deploy and deploy and shut down.
So let's say that during the setup stage you want to install certain packages, then you'll have to
specify the recipes or.
Now, currently in this Norges, you only have the recipe associated with the notice demo.
So very quickly, the editorial, let's understand it better.
So these are the various events now associated with the deploy event.
You have the Norges underscore demo recipe.
Now, we can understand this.
If I can quickly download this, let me download this.
Great.
So it has been downloaded.
And if I quickly open this up, we can see what you saw during the deploy.
You have Norges underscore demo.
So within this compressed file you have this Norges underscore demo directly.
So this is the recipe which will get configured during the deployed stage.
Now let's say that during the setup stage you want to install certain packages, maybe Apache or proxy,
then you can create a recipe here and you can specify the name of the recipe audio.
So you can say Apache.
And then this event will look into the repository, what it will look into the compressed file and it
will see the aperture directly.
And from there it will go ahead and do the things which you have mentioned within that recipe.
So this is what the events are.
Now, it is important for us to understand what each of these events mean and at what stage of the lifecycle
does each of these event occur.
So let's go ahead and understand that now this setup event typically occurs when the stated instance
has finished boarding up and is basically used for initial installation of software packages.
So let's say you want to install BHP and Apache, then you can specify those recipes within the setup
layer, because during the deploy layer you might want to push your application.
It might be a artifact in a street location.
So before you pull the binary or you pull the artifact, you need to make sure that you have all the
relevant packages installed which can run that binary.
So those prerequisites are those insolation of packages can be done at this site.
Upload the second one is that configure.
Now, this layer is basically run on instances on one of the following conditions.
The first is when the instances enter or leave the on line state.
Second is when you associate or disassociate the elastic IP of the instance.
And third is when you attach or detach elastic load balancer from the layer.
So one of the use case that I can tell you is of a cluster.
So let's assume that you have a big cluster of three instances.
Now you have one more instance created and that instance would be part of that cluster because cluster
is going slow.
So you decided to add a new instance.
So typically, we already know that when a new instance gets booted up, then the first layer that gets
executed is the setup layer.
So this set up layer might install the Mungerannie packages and the required dependencies.
Now, once the setup layer completes, the second layer is the configure layer.
Now, I do remember that the so you have set up here, you have to configure layer.
Now, one important part to remember is that configure layer gets executed on all of the instances which
are part of the stack and not only just the one instance.
This is very important to remember.
So let's say that the new instances added up.
Now, this configured layer will basically run on all the three instances.
Now, since this is a.
And a new instance has come up, it is important, for instance, one instance to an instance, three
to know that the instance Ford has come up these instances can add them within the cluster and you can
configure all the replication and other aspects.
And this is what the configure event is generally used for.
Another use case for configure event can be a reverse proxy.
Let's say a new instance has come up and you want to add the host name of that instance inside the reverse
proxy, otherwise that it was proximate not for the traffic.
So configure event can be used in such use cases as well.
Now, the third and the fourth event are the deploy and deploy deploy event basically allows us to define
when we want to deploy a new version of the application.
Now, we already saw that during the Norges stack there was a deploy and you had a node just underscored
demo which was presented and deployed now and deployed, allows us to delete the application or render
and deploy command to remove the application from a set of applications.
So as now, this can be done manually as well.
Now, let me quickly show you how you can do that.
So if you basically go to deployments and you click on deploy up over here.
So this is the node just up.
So you have deploy and deploy.
So both of the options are present for you.
Now in case if you want to deploy a specific app, you can do that directly from you.
And basically what happens is that when you run this, it creates a lifecycle.
So it already states that I'm deployed triggers and I'm deployed lifecycle event, which runs the on
deploy recipe to remove all the versions of the app from a specified instances.
Same goes with that deploy audio, which is used for deploying an app.
Now the last lifecycle event is shut down.
Now this event is basically executing when we inform ops folks to set the instance down before the instance
is terminated.
So let's say that instance is registered somewhere.
Let's say it's registered to a central satellite server or a space walk server now before it gets terminated.
What we want is we want the instance to be the destroyed itself from the central servers.
So you can specify the recipes, audio visual data, just at this instance before it is terminated.
So certain event is also pretty useful.
So that's about it at a high level overview about the Ops folks lifecycle event.
I hope this video has been informative for you and I look forward to seeing the next video.