We could also very easily delete deployment and service, which we just created using just one command.
Let's do that.
Go to the terminal and here enter k.
Delete this f.
Here will the name of the first file deployment yaml.
And here let's add this f option once again and type service dot yaml.
Let's go ahead and delete both deployment and service.
We'll check.
Get get SVC.
No service.
Get get deployment and load deployment.
Great.
Now let's do the following.
Let's try to create two deployments and let's connect them with each other, because it's very common
task when you want to connect different applications together, for example, connect front end to back
end or connect backend to database service and so on.
Therefore, now we will do following.
Let me draw a picture.
So similarly, as before, we will create web deployment and deploy it.
There are our Node.js Express Web application and here let me type web like that.
And also we will create one more deployment and we will name it and Gen X.
This ingenious deployment will run basic and Gen X image with no adjustments, and this Gen X deployment
will have corresponding service with cluster IP.
So let me draw here a line and here will be a cluster IP.
Let's start with capital C cluster IP like that.
And those two deployments, of course, are allocated in the Kubernetes cluster.
And this deployment will be also exposed, but it service will have type load balancer.
It means that we will be able to connect to it from outside using load balancer as IP address.
So here is a load balancer.
Now inside of the web application, we will create two endpoints.
First will be root endpoint same as before, which will return simply hello from the web server.
And one more endpoint here will be, let's say in Genesis and one connection will be made to Engine
X.
We will connect to engine service by using cluster IP or you will see that using engine x service name.
Like death.
So for one deployment, we will connect to another deployment and get response from one of the ports
which will be running engine X application.
And afterwards we will return back result to the client with the contents which we received from the
NGO and export.
So that's the plan.
And in such a way, we will actually connect to different deployments, web deployment and again, deployment.
Let's get started with that.