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

Your controller runs on Kubernetes. A node drain for an upgrade kills the controller pod mid-day. How do you make maintenance safe?

AdvancedScenarioPlatform: plugins, JCasC & Kubernetes agents
Answer

Situation read → Single-replica StatefulSet is disrupted by drains.

What I'd do →

  1. Add a PodDisruptionBudget with maxUnavailable: 0 so drains block until an operator acts.
  2. Schedule maintenance windows: quiet-down via API, wait for builds, then drain.
  3. Set a long terminationGracePeriodSeconds and a preStop hook that calls /safeExit if desired.
  4. Put the controller on a dedicated node pool upgraded separately.

Why → The controller is a stateful singleton; it needs explicit handling during cluster operations.

Interview tip → Mention that build pods also need PDB thinking or tolerance to eviction.

All Jenkins questions Roadmap: Jenkins

More on Platform: plugins, JCasC & Kubernetes agents