11장. Jenkins controller와 agent를 분리한다
controller에서 build를 실행하지 않는다. agent label, executor, workspace, network egress, tool image를 workload별로 분리한다. production network에 접근 가능한 agent는 untrusted branch를 실행하지 않아야 한다. Jenkins plugin은 controller code execution 권한에 가까우므로 설치 수와 update review를 관리한다.
agent { label 'linux-container' }
options { disableConcurrentBuilds(abortPrevious: true) }
static agent는 drift와 credential 잔존, ephemeral agent는 startup·cache 비용이 있다. 어느 쪽이든 job 사이 workspace cleanup과 process 종료를 확인한다. Docker socket mount는 host root에 준하는 위험이 있으므로 대안을 검토한다.
controller backup에는 job config뿐 아니라 credential metadata, plugin 목록, encryption key, shared library 참조와 restore drill이 필요하다. backup 성공 로그보다 새 환경 restore 시간으로 RTO를 증명한다.