The last video we discussed how we're going to add in this new event bus pod and then a cluster I.P.
service or both posts and event bus.
I know a lot of this stuff probably seems pretty crazy right now but I got some good news for you as
soon as we get through this.
The one last hurdle we're going to start to take a look at a tool that is going to automate wiring up
a lot of the stuff for us.
So it's gonna make life a lot easier.
You do have to go through all the stuff at least once by hand out just so you really understand what
is going on behind the scenes.
All right.
So we have to go through a couple of different steps.
And so just to make sure that everything is crystal clear put together a quick diagram to understand
the steps are about to go through to get the event plus and post working together that the first thing
we'll do is create an image for the event bus will then push that image up to Docker Hub will then create
a deployment or the event plus that deployment is going to create one pod for us automatically.
And that pod is going to be this thing right here after that pod comes into it exists existence.
We will then create a cluster I.P. service for the event bus and for posts.
And so that's going to be that thing and that thing.
And again these cluster IP services are going to teach these pods how to access each other inside the
cluster after that we're gonna do just one last additional little step to wire this stuff up altogether
so let's get started with step number one right now.
We're going to build an image for the event bus to get started going to flip back over to my terminal
I'm going to change into my event bus directory and inside there I'll build a new image.
So we'll do a docker build dash t even greater event dash bus and then don't forget the dot at the very
end that indicates we want to use the current working directory where all the source code inside the
image so we'll run that.
And as you'll see that image gets built very very quickly okay.
That's step number one step number two.
We're going to push that image off to Docker Hub so that the deployment can very easily pull down that
image when it decides that it's time to create the pod to back inside the event plus directory.
We'll do a docker push your Docker I.D. slash event dash bus that's going to take the image that we
just built and throw it up to Docker Hub.
It's a pretty small image.
So it'll just take a little minute or two.
All right after that's all done.
We're then going to create a deployment for the event plus the deployment that we're going to create
is gonna be just about identical in nature to the post deployment that we already put together.
So really just going to copy paste all that configuration we already wrote out here is going to change
one or two names to refer to event bus as opposed to post to create the deployment itself.
Don't forget we're always going to create a config file to back inside my editor.
I'm going to find that in Fred directory.
Inside there is chaos inside of chaos.
I'll make a new directory called event dash bus dash devil not yellow
0 then open up the post deployment file because I'm not kidding.
We're really just going to copy paste all this stuff inside of the post deployment file I'm going to
copy everything go back over to the event plus deployment file and paste I'm not going to go through
and everywhere that I see the word posts I'm going to replace it with event bus so here's number one
right here.
Here's to here's three
or and five.
Inside of the event bus deployment file I should now be able to do a find I'll look for posts and I
should have zero results.
So make sure you replaced every instance of posts with event plus instead of then save the file and
we'll go ahead and apply this configuration file to Cuban net is using cubes TTL so back at my terminal
it looks like I've finished pushing up the event plus image.
That's great.
I'm going to change back over to my key aides directory and inside there I've got my event plus deployment
file that we just created.
So we'll do a cube TTL.
Apply dash f event plus double dot demo.
So looks like we've got the deployment created and that should automatically create the pod for us.
Let's just list out all of our different pods and make sure that it actually was created.
I'll do a cube GTL.
Get pods and sure enough there's my event bus board right there.
So looks like it is up and running.
It's all the look that looks great right now.
We have no effective way to really have any communication between this event plus pod and the Post pod
and so that is why we need to come back and add in these cluster IP services.
Again they technically can communicate but the IP address assigned to these pods is variable and we
can't really predict it ahead of time.
The cluster IP services are going to give us a well known.
Very easy to predict.
You are all that we can type in anytime we want to have our event bus communicate over the posts or
anytime we want post to communicate over to event bus let's take a quick pause right here.
When we come back the next video we're going to create a cluster IP service for posts and one for event
plus as well.