And now let's try to connect to our deployment using this service.
Let's grab this cluster IP and let's first try to connect to this cluster IP address from our local
computer, see URL and paste this IP address and after called let's also add port which we exposed.
It is external port for our deployment internally it will be proxy to port 80 on each container.
Let's try whether this works on our local computer or not.
C url and I see no response.
That's what I just told you.
Cluster IP address is not available outside of the Kubernetes cluster.
This behavior of the cluster?
IPI It is just internally available IP address, but you are able to access cluster IP from any node.
And let's try that.
Let's say to our node, let me go back to this command as a sage docker and the IP address of the Node
DC user.
And let's now try to connect to cluster IP from the node.
And here again, let's specify a port 88 and I see a result.
Welcome to again X.
And this response was provided by one of the posts in the deployment.
Of course, now from this output, I am not able to recognize which port exactly answered me, but this
answer was provided by one of the ports in the deployment.
I could try again, again, again, and I get answer from the ports in the deployment.
That's how it works.
Cluster IP is just single IP, which was created as a service for a particular deployment, and you
could utilize just a single IP in order to connect to any of the ports.
And behind the scenes, Kubernetes does all processing of the request to particular selected port,
and it balances a load across different ports in the deployment.
All right.
Let's close this connection.
And let's now also read details about particular service.
We get that there is command K get CVC short version four, get services and here is name of the service
which we created before.
Let's take this name and right now k describe.
Service and name of the service we would like to get the details about here with Gloucester IP, which
we just used in order to connect to this service.
Also there was external port and here was target port and here are three different end points.
Those end points indicate particular ports which are used for connections to this particular cluster
IP.
So load will be balanced across those three different ports.
And notice everywhere here port eight, it is target port for our service, the aid, this default port
where engine etc. is running.
So 88 and 80 also here you see type of the service cluster IP and selector here is also present up equals
sign and Jennings deployment.
And that's how this service is actually connected to particular ports.
All those ports also have particular label up and deployment and this label was created by Kubernetes
automatically.
We did not specify it because we just created the deployment using Create Deployment Command and we
created a service using exposed command.
Namespace here is default, same as for ports and deployment, which is called engine deployment.
All right.
That's it for this service.
And we exposed our deployment using cluster IP.
And cluster IP is only available inside of the Cuban in this cluster.