How we can create and use a node port service, which should serve as a Load Balancer b/w two VMs created in the OCP?
you can add service name and port and the end you have to add nodeport:loudBalancer
Refer guided exercise Kubernetes Networking Objects topic.
@Razi You can do that by following the below steps :
1. Edit the VirtualMachine manifest to add the label for service creation. Add label: key to the spec.template.metadata.labels
2. Create a Service manifest to expose the VM. The label: key label applied in step 1 above must match the label in the spec.selector attribute of the Service manifest.
3. Specify type of service as NodePort.
4. Specifies a collection of network ports and protocols that you want to expose from the virtual machine. Create the manifest using either web UI or CLI ( oc create -f ... ).
5. Restart the VM to apply changes.
Refer this video ( though it used ClusterIP but you can get an idea on how to do it via web UI ) : https://www.youtube.com/watch?v=JhCznR-bU2M
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.