Jenkins CI/CD Archi: Distributed Agent

๐Ÿ’ก Jenkins CI/CD Archi: Distributed Agent โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for Jenkins CI/CD Archi: Distributed Agent.

Operation

Pipelines
Credential
Pipeline Sample
Container Debugging
groovy
// container๋‚ด breakPoint์—์„œ ์•„๋ž˜ ๋ฌธ๊ตฌ ์ถ”๊ฐ€
input message: "pod๋ฅผ ์œ ์ง€ ์ค‘์ž…๋‹ˆ๋‹ค. ๋””๋ฒ„๊น… ํ›„ 'Proceed'๋ฅผ ๋ˆ„๋ฅด์„ธ์š”."
Scripting
groovy
// ํžˆ์Šคํ† ๋ฆฌ ์ œ๊ฑฐ
def jobName = "All-in-one"
def job = Jenkins.instance.getItemByFullName(jobName)
job.getBuilds().each { it.delete() }
Documentation
Rollback from PV
bash
# ์ข…๋ฃŒ
kubectl scale sts jenkins --replicas=0

# 1. ์šด์˜ ํด๋”๋กœ ์ด๋™
cd /srv/k8s-mgnt/deploy-system-jenkins-pvc-6e30ccbc-5f18-4032-a5ad-be96e9e65465
# 2. ํ˜„์žฌ ์ž˜๋ชป๋œ ๋ฐ์ดํ„ฐ ์‚ญ์ œ (ํด๋” ์ž์ฒด๋Š” ๋‚จ๊ฒจ๋‘๊ณ  ๋‚ด์šฉ๋ฌผ๋งŒ ์‚ญ์ œ)
# ๋งŒ์•ฝ์˜ ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•ด ์šด์˜ ํด๋”๋„ ๋ฐฑ์—…ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด mv๋ฅผ ์“ฐ์„ธ์š”.
rm -rf ./*
# 3. ๋ฐฑ์—…๋ณธ ๋ฐ์ดํ„ฐ ๋ณต์‚ฌ (์ „์ฒด ํŒŒ์ผ ๋ฐ ์ˆจ๊น€ ํŒŒ์ผ ํฌํ•จ)
cp -arp ../archived-deploy-system-jenkins-pvc-73bb7dd5-3e8f-4905-8be4-cf1be17298b4/. ./

# ์‹œ์ž‘
kubectl scale sts jenkins --replicas=1

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *