Interview Prep/Jenkins/Platform: plugins, JCasC & Kubernetes agents

Agents on Windows VMs must run alongside Kubernetes pods. How do you manage them as code?

IntermediateScenarioPlatform: plugins, JCasC & Kubernetes agents
Answer

Situation read → Static agents need definitions and a connection method.

What I'd do →

  1. Define the nodes in JCasC (jenkins.nodes: - permanent: name, labelString, remoteFS, launcher: inbound with webSocket).
  2. Install the agent as a Windows service using the Jenkins agent service wrapper (WinSW) with -webSocket and the secret from a secure store.
  3. Build the VM image with Packer (JDK 21, build tools) and replace VMs instead of patching.
  4. Label them windows, EXCLUSIVE mode.

Why → Both node definition and machine setup become reproducible.

Interview tip → Mention the EC2 or Azure VM cloud plugins for ephemeral Windows agents.

All Jenkins questions Roadmap: Jenkins

More on Platform: plugins, JCasC & Kubernetes agents