Hi all.
I can’t find anywhere but i vaguely remember there was an option for Nomad to pick and/or tag one task allocation when spinning it up as “primary” one. I may be wrong or just dreamed about it
We have an monolithic app that supports multiple deployments but only one of those deployments is allowed to run some processing. I know this can be solved in other way by changing how app works but currently we have to deploy it by only one allocation knowing it can run processing.
Is there a way besides creating 2 separate tasks (we still want to be able to run just 1 allocation of that task and not 2 tasks)?
thank you
Hi @dsmoljanovic,
i vaguely remember there was an option for Nomad to pick and/or tag one task allocation when spinning it up as “primary” one
I wonder if you are referring to the task leader parameter? This unfortunately does not work in your setup unless each instance of your application is a separate task with a group.
Is there a way besides creating 2 separate tasks (we still want to be able to run just 1 allocation of that task and not 2 tasks)?
I am not sure I understand the desired goal here. Multiple tasks can be run within a single task group; each task group forms a single allocation on a client.
Thanks,
jrasell and the Nomad team
Sorry I wasn’t more clear.
We are migrating one app to nomad.
That app, besides the standard processing, has additional behaviour for which only 1 allocation should be allowed to do. That 1 allocation currently has in the config a flag “primary”. Other allocations are identical but they don’t have it and are running all besides that additional behaviour.
If we are doing canary deployments nomad will bring up another “primary” and during that short period they will conflict. In previous we would bring the canary instance with new version and removed primary flag, then do another canary deployment putting “primary” flag back; to avoid 2 allocations with “primary”.
I was just wondering if there is a nicer way with nomad (beside telling devs to rewrite stuff )