A cloud agent in Jenkins is a virtual machine or container that Jenkins provisions dynamically in the cloud (like EC2 or Azure) to run build jobs. It helps scale build capacity on demand.
Click to reveal answer
beginner
Name two popular cloud providers Jenkins can provision agents from.
Amazon EC2 (Elastic Compute Cloud) and Microsoft Azure are two popular cloud providers Jenkins can use to provision agents dynamically.
Click to reveal answer
intermediate
What Jenkins plugin is commonly used to provision EC2 agents?
The 'Amazon EC2 Plugin' is commonly used in Jenkins to provision EC2 instances as build agents automatically.
Click to reveal answer
intermediate
How does Jenkins authenticate to Azure to provision agents?
Jenkins uses Azure service principal credentials (client ID, secret, tenant ID) to authenticate and provision Azure virtual machines as agents.
Click to reveal answer
beginner
Why use cloud agent provisioning instead of static agents?
Cloud agent provisioning allows Jenkins to create agents only when needed, saving costs and resources by not running idle machines all the time.
Click to reveal answer
Which Jenkins plugin helps provision EC2 instances as build agents?
AAmazon EC2 Plugin
BAzure VM Agents Plugin
CDocker Plugin
DKubernetes Plugin
✗ Incorrect
The Amazon EC2 Plugin is designed specifically to provision EC2 instances as Jenkins agents.
What credentials does Jenkins need to provision Azure agents?
ASSH key only
BAWS access key and secret
CGitHub personal access token
DAzure service principal credentials
✗ Incorrect
Jenkins uses Azure service principal credentials (client ID, secret, tenant ID) to authenticate and create Azure VMs.
What is a key benefit of using cloud agent provisioning in Jenkins?
AAgents run only when needed, saving cost
BAgents never need updates
CAgents are always offline
DAgents use physical hardware only
✗ Incorrect
Cloud agents are created on demand, so you pay only for what you use.
Which cloud provider is NOT typically used for Jenkins cloud agents?
AAmazon EC2
BMicrosoft Azure
CLocal desktop
DGoogle Cloud Platform
✗ Incorrect
Local desktops are not cloud providers and are not used for dynamic cloud agent provisioning.
What is the first step to enable EC2 agent provisioning in Jenkins?
ACreate a Jenkins pipeline
BInstall the Amazon EC2 Plugin
CWrite a Dockerfile
DConfigure GitHub webhook
✗ Incorrect
You must install the Amazon EC2 Plugin to enable EC2 agent provisioning.
Explain how Jenkins provisions a cloud agent on EC2.
Think about the plugin, authentication, instance launch, and lifecycle.
You got /5 concepts.
Describe the steps to configure Jenkins to provision agents on Azure.
Focus on authentication, plugin, and VM template setup.
You got /6 concepts.
Practice
(1/5)
1. What is the main purpose of cloud agent provisioning in Jenkins?
easy
A. To dynamically create and use cloud machines as Jenkins agents
B. To manually configure Jenkins agents on local machines
C. To backup Jenkins configuration files to the cloud
D. To monitor Jenkins job execution times
Solution
Step 1: Understand Jenkins agent provisioning
Jenkins can create agents dynamically in the cloud to run jobs without manual setup.
Step 2: Identify the purpose of cloud provisioning
Cloud agent provisioning automates creating cloud machines (like EC2 or Azure VMs) as Jenkins agents.
Final Answer:
To dynamically create and use cloud machines as Jenkins agents -> Option A
What happens when 4 jobs are triggered simultaneously?
medium
A. Jenkins throws an error due to instance cap mismatch
B. 4 agents will be created ignoring the instance cap
C. All 4 jobs run on a single agent
D. Only 3 agents will be created; the 4th job waits in queue
Solution
Step 1: Understand instanceCapStr meaning
The 'instanceCapStr' limits the max number of EC2 agents Jenkins can create to 3.
Step 2: Analyze job triggering behavior
When 4 jobs start, Jenkins creates only 3 agents due to the cap; the 4th job waits in the queue.
Final Answer:
Only 3 agents will be created; the 4th job waits in queue -> Option D
Quick Check:
Instance cap limits agents = jobs queue if exceeded [OK]
Hint: Instance cap limits agents; extra jobs queue [OK]
Common Mistakes:
Assuming Jenkins ignores instance cap
Thinking all jobs run on one agent
Expecting an error when cap exceeded
4. You configured an Azure cloud agent in Jenkins but agents never start. Which is the most likely cause?
medium
A. Instance cap set to zero
B. Jenkins master is offline
C. Incorrect Azure VM image name or ID
D. Idle timeout set too high
Solution
Step 1: Check Azure VM image configuration
If the VM image name or ID is wrong, Jenkins cannot provision agents on Azure.
Step 2: Evaluate other options
Jenkins master offline stops all jobs, but question focuses on agent provisioning. Instance cap zero means no agents, but usually agents would not start at all. Idle timeout affects termination, not start.
Final Answer:
Incorrect Azure VM image name or ID -> Option C
Quick Check:
Wrong VM image blocks agent start [OK]
Hint: Check VM image name first if agents don't start [OK]
Common Mistakes:
Ignoring VM image correctness
Blaming idle timeout for start issues
Assuming Jenkins master offline without checking
5. You want to optimize Jenkins cloud agents on EC2 to reduce cost. Which combination of settings is best?
hard
A. Set instance cap high and idle termination to 60 minutes
B. Set instance cap low and idle termination to 5 minutes
C. Disable instance cap and idle termination
D. Set instance cap low and disable idle termination
Solution
Step 1: Understand instance cap effect
A low instance cap limits max running agents, controlling cloud costs.