A Job DSL seed in JCasC should create a folder per team from a YAML list. How do you structure it?
IntermediateScenarioPlatform: plugins, JCasC & Kubernetes agents
Answer
Situation read → Data-driven job generation.
What I'd do →
- Store
teams.yamlin the platform repo, mounted into the controller. - Job DSL script:
(When run from JCasC, read the file with plain Groovydef teams = new org.yaml.snakeyaml.Yaml().load(readFileFromWorkspace('teams.yaml')) teams.each { t -> folder(t.name) { displayName(t.display) } organizationFolder("${t.name}/repos") { /* github org config */ } }new File('/var/jenkins_config/teams.yaml').text.) - Apply folder permissions and credentials per team in the same script.
Why → Adding a team is a one-line YAML change reviewed in Git.
Interview tip → Mention Job DSL's removedJobAction for cleaning up deleted teams.
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