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 →
- Define the nodes in JCasC (
jenkins.nodes: - permanent: name, labelString, remoteFS, launcher: inbound with webSocket). - Install the agent as a Windows service using the Jenkins agent service wrapper (WinSW) with
-webSocketand the secret from a secure store. - Build the VM image with Packer (JDK 21, build tools) and replace VMs instead of patching.
- Label them
windows,EXCLUSIVEmode.
Why → Both node definition and machine setup become reproducible.
Interview tip → Mention the EC2 or Azure VM cloud plugins for ephemeral Windows agents.
More on Platform: plugins, JCasC & Kubernetes agents
You inherit a controller with 230 plugins, half unused, on a version two LTS lines behind. Plan the cleanup and upgrade.AdvancedAn admin changes a cloud setting in the UI, and it reverts after the next controller restart. Developers are confused. What is your policy?BeginnerYou must stand up a new Jenkins controller for a team in under an hour, identical to the existing ones. How?IntermediateBuilds wait 2–3 minutes before starting because new agent pods are slow to schedule. How do you speed up agent startup?AdvancedDevelopers need Docker image builds in Kubernetes agents, but the cluster runs containerd and security forbids privileged pods. What do you choose?AdvancedThe controller needs to provision agents in three Kubernetes clusters in different regions. How do you configure it?Advanced