Let's hide them by the terminal and let's now go to service the YAML configuration file.
And here let's also speed up the process for creation of the service configuration file and type service
and Kubernetes extension will offer us this option and this spec will be created automatically.
Client is a service API version is v one here.
It differs from API version for deployment kind metadata name sets name for this service.
Let's enter a name gate as web.
Hello.
And also here let's modify selector and selector will be up Golden Gate as web hello as well.
By the way, if you hover mouse over any of the keys in this configuration file, you could find hyperlinks
to documentation for each particular key.
For example, key name URL is here or if you hover mouse over a kind, you could also find hyperlinks
here for API version for kind and metadata, for instance.
All right, what is left here in this service is modification of the port section here.
I see that port and target port were out of populated before we utilized we exposed actually same port
3000, which is the port where our express web server is running.
And now we could try different port expose port 3000 which is targeted port to port, let's say.
Thought.
They thought you like that.
And it means that target bought 3000 will be exposed to external port 3030.
Also notice that in this specification there was no type for this service.
And let's say that we want to create a load balance or service for that.
Let's go to documentation.
Let's find documentation for service here.
Kubernetes API service.
Resources.
Serious.
And here, let's click on service specification here, hero selector ports.
And also below you could find type of the service type, either cluster IP which is default or external
name or node port or load balancer.
Lets set type to load balancer.
Let's go back to our configuration file and here in spec, let's set type to load balancer like that.
That's it for this service specification.
Let's save changes in this file and let's apply this using same command as before.
Cube still apply disk f stands for file and hero type service dot yaml.
I am still inside of the gate eight folder, so let's apply a service yaml file.
Applied gay get as we see.
And now I see that new service with type load balancer was created.
And no.
Similarly, as before I could open a connection to our deployment using command meaning service k8s
web.
Hello.
Let's go ahead.
And Page will be opened.
Refreshed and they got response from another port.
It means that now everything works as before.
There is now service and deployment and we created everything using declarative approach, using configuration
files.
Here is file for service and here is file for deployment.