We are all complete with our config file scenario are going to apply this to our cluster.
To do so I'm going to go back over to my terminal and sign my Cade's directory.
I will do a cube Seitel apply dash f we're going to apply post dash SRB normal once I run that I should
see that the service was created I can then attempt to list out all the different services list running
inside my cluster with keeps TTL get services and that's gonna print out a default service of Cuban
is right there we can ignore that for right now and post stash SRB so that is a service that we just
created you'll notice that its type is not port and at the very end over here you'll notice that there
is a port.
Column 1 Port says four thousand and the other are just on the other side that colon.
Can be something like a thirty thousand port so you might have anything from a thirty thousand to thirty
one thousand or thirty two thousand.
This is going to be a randomly assigned port and that port is how are we going to actually access your
service.
Let me show you a quick diagram OK so really count that's just a moment ago.
So we had said that there is a target port that we used to access our container running inside the pod
there is a port that gets assigned to the node port service itself.
And finally there is a third thing here called a Node port.
Now the word node port is meant to designate a kind of port as opposed to the node ports service whatever.
We basically just call it node port.
This is a randomly assigned port that we use to actually get access to that service from outside of
our cluster so it's almost always going to start with thirty thousand or thirty one or thirty two but
it is going to be randomly assigned we can get that port by doing that.
Keeps Seitel get services and you're gonna see it listed right there.
We can also run a describe command on the postal service very similar to the cube Seitel describe deployments
and pods so we've seen previously so I could do a cube Seitel describe service host dash SRB if I run
that I will see node port right there and that is the note port that is assigned and again that is how
I'm going to actually access the service inside my browser so me show you one more diagram that's going
to kind of summarize all this stuff because there's really just so much stuff going on here I know this
is some nasty stuff so to actually access our post odd really comes down to whether you are using Docker
for Mac or Windows or you're using mini Q If you're using mini Q to access the service we just created
you are going to run a mini cube IP at your terminal that is going to print out an IP address.
You're then going to take that IP you're going to write it out essentially right here.
So maybe a something like 1 9 2 whatever whatever.
And then a colon and then the full port that you just saw back at the terminal.
This node port listed right there.
So it's probably not going to be 34 0 2 for you it's going to be probably something else.
So you would do something like 30 for 0 2 and then flash posts and that should get all the different
posts that are stored inside of our post application if you are on Docker from macro windows a little
bit easier.
It would be just a local host then a colon and then that note port.
So for me it'll be at thirty four O to flash posts now.
Quick reminder this entire node port thing is all about development or just for development purposes.
So this does not mean that your users are going to actually access your application at Port thirty four
or two.
Again this is just for development purposes all right.
So I can open up a new browser tab because I am running Docker for Mac and I just saw right there a
node port of 30 for 0 2.
I'm going to enter in local post thirty or two slash posts and then I will see an empty object right
there.
You'll see something very similar.
Remember anytime we make a get request for a post and point our actual post application is going to
send back all the posts have been created.
So because this is an empty object that is just saying no posts have been created yet.
Well I'd say creating the service was a little bit of a nightmare.
And actually getting this you are all put together was a nightmare.
But at least we now know how to run something or a container inside of our cluster and how to in some
way access it by visiting some address inside of our browser.
So this is a good step forward.
What we still have to figure out how to create that whereas it was my diagram right here how to create
a load balancer which is the better way of acts accessing stuff the node port.
And we also need to ultimately start to create some of these other pods or our other services.
And when I use the term services I'm talking about the comment service and our event bus and so on and
then get connections between all these different things using cluster IP services as well.
There's still a little bit of work to do but this is almost at the very end of the tunnel or end of
this phase of learning about this Cuban Nettie stuff.
So let's take a quick pause right here and continue in just a minute.