Recall & Review
beginner
What is the purpose of labels in Jenkins agent selection?
Labels help Jenkins identify and select the right agent (worker) to run a job based on the agent's capabilities or characteristics.
Click to reveal answer
beginner
How do you assign a label to a Jenkins agent?
In Jenkins, go to the agent's configuration page and enter the label(s) in the 'Labels' field. Multiple labels can be separated by spaces.
Click to reveal answer
intermediate
What happens if a Jenkins job specifies a label that no agent has?
The job will remain in the queue and wait until an agent with the specified label becomes available or the label is corrected.
Click to reveal answer
intermediate
How do you specify a label for agent selection in a Jenkins Pipeline script?
Use the 'agent' directive with 'label' inside the pipeline block, for example:
pipeline { agent { label 'linux' } stages { ... } }Click to reveal answer
intermediate
Can a Jenkins agent have multiple labels? Why is this useful?
Yes, an agent can have multiple labels. This allows flexible job assignment because jobs can request any one of the labels that match the agent's capabilities.
Click to reveal answer
What is the main use of labels in Jenkins agent selection?
✗ Incorrect
Labels help Jenkins pick the right agent to run a job based on matching labels.
Where do you assign labels to a Jenkins agent?
✗ Incorrect
Labels are assigned on the agent's configuration page to describe its capabilities.
What happens if no agent matches the label specified in a Jenkins job?
✗ Incorrect
The job waits in the queue until an agent with the matching label is free.
How do you specify an agent label in a Jenkins Pipeline script?
✗ Incorrect
The 'agent' directive with 'label' specifies which agent label to use in a pipeline.
Why might an agent have multiple labels?
✗ Incorrect
Multiple labels let an agent serve different types of jobs by matching various label requests.
Explain how Jenkins uses labels to select agents for running jobs.
Think about how Jenkins finds the right worker for a task.
You got /4 concepts.
Describe how to assign and use labels in a Jenkins Pipeline script.
Focus on both the agent setup and pipeline syntax.
You got /3 concepts.