Deploying and Managing Services Using Rancher Manager - Part I
35%
A NodePort for the Deployment
The ClusterIP can be used when we want other applications inside the same cluster to access our application (like a frontend application accessing a backend application or a database). However, if we want to access the application from the outside world, we can use a NodePort. Even if this is not what we are going to keep, it's good to know how to create a NodePort Service using the Rancher UI.
Follow these steps:
- First of all, make sure that your nodes have public IP addresses and that no firewall is blocking the traffic on the port we are going to use on each node. This is our case.
- Click on
Service Discoveryand thenServices. - Select
NodePortas the type of Service. - Choose
todo-app-namespaceas the namespace. - Choose a name for the Service, for example,
todo-app-nodeport. - In the
Service Portssection, fill in the following details: Name:http.Listening Port:5000.Target Port:5000.Node Port:30000.- In the
Selectorsection, add the following labels: app:todo-app.
Note that we can use any port number between 30000 and 32767 for the Node Port
End-to-End Kubernetes with Rancher, RKE2, K3s, Fleet, Longhorn, and NeuVector
The full journey from nothing to productionEnroll now to unlock all content and receive all future updates for free.
