'Openshift deploy backend and frontend separately

I have an app on openshift. Currently backend and frontend are mixed up in a single WAR archive. Though I want to separate frontend and backend into 2 projects and deploy them seperately on the same node.

I haven't found anything in the openshift docs or on google.

Is there any way to accomplish that, or do I need to deploy backend and frontend separately onto 2 nodes?



Solution 1:[1]

You can use what is called a "node selector" to ensure a given object, in your case a deployment, is placed onto a specific node.

This behavior is outlined in the documentation.

As per your request, this would allow you to split up your deployment, but have it land on the same node. However, it is not a pattern I would recommend. Relying on a specific node to exist, is not very failure tolerant. As such your frontend and backend should rather communicate via a service for example. This way, it doesn't matter where on your cluster frontend or backend are.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rick Rackow