This manual method is acceptable in smaller-scale environments, but it becomes less efficient as the environment grows, since the same steps must be repeated for each new node. The Jenkins Swarm Plugin helps with part of this: new workers register themselves, so capacity is quick to add. It does not fix a mismatch between an agent and its Jenkinsfile.
Every replica gets the same default labels (swarm Docker), so scaling gives you more identical workers. Workers with different labels or images would need separate services. This implementation differs from a typical Jenkins deployment in a few ways.
Credentials are Docker secrets rather than environment variables. Workers connect over WebSocket, so the controller does not publish a separate agent port.





