OpenShift - Create load balance service using the oc create service command

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

A service can be used to load balance requests across pods.

 

The oc create service command can be used to create these type of services.

  • clusterip
  • externalname
  • loadbalancer
  • nodeport

In this example, a load balancer service named lb-service is created.

~]$ oc create service loadbalancer lb-service --tcp=8080
service/lb-service created

 

The oc get services command should show the service has been created. In this example that the service is listening on port 8080.

~]$ oc get services
NAME         TYPE           CLUSTER-IP       EXTERNAL-IP                            PORT(S)          AGE
lb-service   LoadBalancer   10.14.52.14      <pending>                              8080:30632/TCP   51s

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.





Please enter c6342 in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |