Let's continue.
And now let's modify type of the service which we create for our deployment, because now there was
a cluster IP which is available only from inside of the cluster.
Let's go here and let's delete the current service gate as well.
Hello.
Simply take its name.
Let's clear terminal and enter key delete.
SBC stands for service and paste.
Name of the service we would like to delete.
Service was deleted.
As get.
There was no such service anymore.
And if I try to connect again to deployment using cluster IP which we used before, I will definitely
get an error.
So I see no response.
Great.
Let's now create service again.
But now we will set its type to note port.
Let's use same command k expose deployment gate as web.
Hello.
And here will be type which will be set to note port in Pascal case notation note port.
And let's add here port option and port will be set to 3000 same port as we utilized before.
It is that port where our containers actually run express node just application.
Let's go ahead and create such service of type node port deployment was exposed let's list services
K get SBC and now there was again service with name gate as web hello it's type now is node port here
was again cluster IP and port.
But here I see port which was specified here using port option and also after column I see randomly
created port 32,142.
And now I am able to connect to deployment using node IP address.
I could get no IP address by entering mini cube IP.
We have only a single node recap and here was its IP in my case.
And I could take this IP, add this spot and I will connect to one of the ports in this deployment.
Let's do that.
Let me grab this IP.
Go to Web browser, for example.
Because now I will be able to connect to deployment from my computer.
Let me paste this IP and after colon I will add this port.
Like that.
So in my case, connections to -- is here.
So here was IP address.
It is IP address of the node and here was randomly generated port, which was created by Kubernetes
itself when we created a service for our deployment.
Let's go ahead and try to connect and I see a response from one of the ports.
Let's refresh.
And I see response from our report with our name refresh again.
And I see response from other port here.
That's how we are able to connect to our deployment using node port service.
Also, it is more simple way to get your URL for connection to this deployment by using mini cube.
Service Command.
Mini Cube.
Series and hear the name of the service, in our case, gay aids web.
Hello.
Let's enter and new tab in the web browser will be opened automatically and notice your well here,
same as a just used before IP address of the node and port, which was automatically generated by Kubernetes.
That's node prototype of the service.
Also here you could see this actual URL when you enter mini cube service eight as web.
Hello, here was actual URL and if you want to get only URL, you could add here option this this URL.
And you'll see only Earl.
And you could grab it and paste it anywhere you want.
So that's not broad service type.
And it exposed the deployment at the port of the node.
And here was this specific port in my example, in your case, this port will be completely different.