Why should you not run builds on the Jenkins controller?
BeginnerConceptJenkins
Answer
The controller holds credentials, job configuration and the scheduler. A build running there executes arbitrary code with access to JENKINS_HOME, so a malicious or buggy Jenkinsfile can read secrets or crash the whole server. Heavy builds also starve the UI and scheduler. Set "Number of executors" to 0 on the built-in node and run everything on agents.
More on Jenkins
What is Jenkins and how is its architecture organised?BeginnerWhat are executors, nodes and labels in Jenkins?IntermediateHow do inbound (JNLP/WebSocket) and SSH agents connect to the controller?IntermediateWhat is a Jenkinsfile and where does it live?BeginnerDeclarative versus Scripted Pipeline: what are the differences?IntermediateWhat does the `post` section in a declarative pipeline do?Beginner