I have a frontend instance (Angular app on nginx), which proxies calls to backend under a specific domain (let's say backend-app
). Everything's easy when there is only one instance of both backend and frontend - I name the Service backend-app
and DNS resolves to the correct backend Deployment.
Let's say I have another version of backend which I would like to test before merging to master. As nginx configuration of frontend instance is hardcoded to proxy to backend-api
, creating another Service under the same name for a newer version of backend doesn't work.
I considered these options:
Any other opinions/suggestions you might have?
Are you using open shift. If yes then you can divide load between services by percentage using route.
Check blue/green and canary deployment options for more details
add label name:backend-1 to backend1 pod
add label name:backend-2 to backend2 pod
create a service using backend-1 selector.
to test against other backend, say backend2, all you have to do is edit the service yaml file and update the selector. you can toggle this way to test between backend1 and backend2