We have a server that is our local docker test environment, were we deploy smaller test stuff. For that, it is already registered with Octopus as a target (listening tentacle).
Since this server already has the docker environment installed, we also want to use it as a worker to run specific containers we need for deployment.
Can a target be a worker as well, preferably without using different instances and all that?
Thank you for contacting Octopus Support and welcome back to the forums!
Great question on whether a listening tentacle that has already been registered with Octopus can also be used as a worker.
You can indeed have multiple instances on a target, you can have them set to deployment targets or workers (you would need separate instances for a worker and a deployment target):
It would depend on what your deployment target is doing though, a worker is meant to take tasks from the Octopus server to lessen the load of the Octopus server. If you have a few deployments set to use that worker its resources will be tied up performing deployments for the Octopus Server.
We have some documentation on workers here if you have not seen it yet.
The main differences between the two are outlined here.
If you then add on a deployment target and start using that to deploy a few projects that server could get overwhelmed quite quickly.
If, however, you have the deployment target on the worker so you can just run a runbook for example daily that makes sure a service has started on the worker then that would not produce many overheads and would not add to the load of the tasks the worker instance is performing.
Ideally the worker should just be used to offload work from the Octopus server so if you can avoid using it as a deployment target that would ensure a more sufficient worker.
I hope that helps answer your question, let me know if you have any more questions off of the back of my response and I would be happy to answer them for you,
It turns out you can have the same instance registered as a worker and a deployment target, I just re-checked our documentation and it does state you can but is not recommended:
A listening Tentacle can be registered as both a worker and a deployment target. We don’t recommend it, but it is possible.
My comments about the worker and deployment target are still relevant, ideally we do not recommend having both on one box unless the deployment target is just used for basic deployments to that target so it does not interfere with the worker tasks it has to perform.
If you use the same instance your deployments to the deployment target may take precedence over the worker deployments which you might not want since the worker deployments will probably be more of a priority for you.
You could use our deployment mutex variable but that does increase the worker load and therefore use more of the hosts RAM and CPU.
I hope that helps clear up the confusion I may have created by saying you cannot have a worker and a deployment target on the same instance, you can, its just not recommended.
Let me know if you have any other questions,
thanks for your quick and detailed reply.
I gave me a lot to read (and think! ) about, so we’ll see if we proceed with our original plan or come up with a better solution.
Thanks again for your time and help,
No worries at all its what we are here for, if you need any advise on your plan let us know and we can see if it would work or if there would be an alternative way for you to design it.