0
0
Jenkinsdevops~20 mins

Agent types (permanent, cloud) in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Jenkins Agent Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference between permanent and cloud agents in Jenkins

Which statement correctly describes the main difference between permanent and cloud agents in Jenkins?

APermanent agents are always online and managed manually, while cloud agents are created and destroyed automatically as needed.
BPermanent agents are created on-demand in the cloud, while cloud agents are physical machines always connected.
CPermanent agents run only on Windows, cloud agents run only on Linux.
DPermanent agents require no configuration, cloud agents require manual setup.
Attempts:
2 left
💡 Hint

Think about how Jenkins manages resources for builds in different environments.

💻 Command Output
intermediate
2:00remaining
Jenkins agent status command output

What is the output of the Jenkins CLI command java -jar jenkins-cli.jar -s http://jenkins.example.com list-agents when there is one permanent agent named build-node-1 online and one cloud agent named docker-agent-xyz offline?

ANo agents found
B
build-node-1 (offline)
docker-agent-xyz (online)
C
build-node-1 - cloud agent
docker-agent-xyz - permanent agent
D
build-node-1 (online)
docker-agent-xyz (offline)
Attempts:
2 left
💡 Hint

Check the status labels Jenkins uses for agents.

Configuration
advanced
2:00remaining
Jenkins cloud agent configuration snippet

Which Jenkins pipeline snippet correctly requests a cloud agent with label docker for a build step?

A
pipeline {
  agent { cloud { label 'docker' } }
  stages { stage('Build') { steps { echo 'Building...' } } }
}
B
pipeline {
  agent { label 'docker' }
  stages { stage('Build') { steps { echo 'Building...' } } }
}
C
pipeline {
  agent { docker { image 'jenkins/agent' } }
  stages { stage('Build') { steps { echo 'Building...' } } }
}
D
pipeline {
  agent any
  stages { stage('Build') { steps { echo 'Building...' } } }
}
Attempts:
2 left
💡 Hint

Look for the correct syntax to specify an agent by label.

Troubleshoot
advanced
2:00remaining
Troubleshooting cloud agent connection failure

A Jenkins cloud agent fails to connect and shows the error Connection refused. Which is the most likely cause?

AThe Jenkins user password is expired.
BThe Jenkins master is offline.
CThe cloud agent's firewall is blocking the Jenkins master port.
DThe cloud agent has no disk space left.
Attempts:
2 left
💡 Hint

Think about network connectivity between Jenkins master and agent.

Best Practice
expert
2:00remaining
Best practice for scaling Jenkins agents in cloud environments

What is the best practice to efficiently scale Jenkins agents in a cloud environment?

AUse ephemeral cloud agents that start on demand and terminate after the job completes.
BUse only permanent agents to avoid cloud costs.
CManually start and stop cloud agents as needed using the Jenkins UI.
DKeep a fixed number of permanent agents running 24/7 to handle all builds.
Attempts:
2 left
💡 Hint

Consider cost and resource efficiency in cloud environments.