← All CJE Flashcard Decks

Distributed Builds & Agent Management Flashcards

7 cards from real CJE practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Distributed Builds & Agent Management flashcards as text
  1. What is the purpose of the 'agent' directive in a Jenkins Declarative Pipeline?

    Answer: To specify where the entire pipeline or a specific stage should execute

    The 'agent' directive specifies the executor environment — such as a node label, Docker container, or Kubernetes pod — where the pipeline or an individual stage will run.

  2. What does 'agent none' at the top level of a Declarative Pipeline mean?

    Answer: No global agent is allocated; each stage must define its own agent directive

    'agent none' at the top level means Jenkins will not allocate a global workspace; instead, each stage is responsible for declaring its own 'agent' directive specifying where it should run.

  3. What is the Jenkins best practice regarding the number of executors on the controller node?

    Answer: Set it to 0 so the controller does not run builds and reserves resources for system management

    Best practice is to set the controller's executor count to 0, preventing it from running builds so its resources remain dedicated to managing jobs, agents, and the system.

  4. In a Declarative Pipeline using a Docker agent, what does the 'args' parameter in 'docker { image "..." args "..." }' specify?

    Answer: Additional flags passed directly to the 'docker run' command when starting the container

    The 'args' parameter passes additional command-line flags to 'docker run', allowing customization such as adding volume mounts (-v), environment variables (-e), or privileged mode (--privileged).

  5. What is a 'flyweight executor' in Jenkins?

    Answer: A lightweight executor on the controller used for administrative tasks like SCM polling and pipeline orchestration steps

    Flyweight executors run on the Jenkins controller and handle non-build operations such as SCM polling, pipeline step coordination, and trigger evaluation without consuming regular build executor slots.

  6. How can you configure a Declarative Pipeline to run different stages on different agents or node types?

    Answer: By defining an 'agent' directive at the individual stage level within the pipeline

    In a Declarative Pipeline with 'agent none' at the top level, each stage can define its own 'agent' directive, enabling different stages to execute on different nodes, labels, or container images.

  7. What does Jenkins Node Monitoring automatically check to determine whether an agent should be taken offline?

    Answer: Health metrics such as available disk space, clock difference from controller, and response time

    Jenkins Node Monitoring performs periodic health checks on agents including available disk space (tmp, swap, workspace), clock skew compared to the controller, and response time, taking the agent offline if thresholds are breached.