Agent use limited to certain pipelines

I have the following situation.
I have a jenkins master and several agents.

I would like one of these agents to be dedicated only to certain projects (those in a specific folder specifically) and its use to be forbidden to all other pipelines.
Is there any way to achieve this?

On the agent/pod template level, I don’t think there is such a setting. There are labels, but this will not prohibit jobs from other folders to use the nodes.

On cloud level this might be possible though. In the “advanced” section of your cloud settings you can find this:

I never tried it, but it seems you can then “enable” the configuration of your folder(s):


Thank you for your response.
My Jenkins instance is not cloud and I don’t use Kubernetes Plugin.
I understand that therefore there’s no way to do what I would like to do in my case.


You could try label the agent and choose Usage option like this:

And from the pipeline you specify the label you want to use

Hi, thank you @daotoan-hd for your response.
We already use the option “Only build jobs with label expression matching this node”
however, anyone who knows labels can use the agent instead our goal is to prevent unauthorized pipelines from being executed.

You could use Role-Based Strategy Role-based Authorization Strategy.
Add add Node Role

I haven’t use this feature before. But I believe this could help you with your need

1 Like

Thank you very much @daotoan-hd
I will try it then let you know

1 Like