GitOps 조정

GitOps reconciliation

Git에 기록한 원하는 상태와 실행 환경의 차이를 감지해 동기화합니다.

···
html
<div class="stage" data-phase="0"><div class="title">GIT ↔ CLUSTER</div><div class="row sides"><div class="panel">Git<br><b>replicas: 3</b></div><div class="diff">≠</div><div class="panel live">live<br><b>replicas: 2</b></div></div><div class="drift">drift detected</div></div>
css
.stage{width:min(94vw,760px);height:min(88vh,330px);padding:clamp(9px,2.6vmin,20px);border:1px solid var(--line);border-radius:14px;background:var(--surface);font:600 clamp(12px,2.5vmin,16px)/1.3 "Pretendard Variable",Pretendard,-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo",sans-serif;display:flex;flex-direction:column;gap:clamp(6px,1.7vmin,12px);overflow:hidden;position:relative}.stage *{min-width:0}.stage .title{color:var(--accent);font-weight:800}.stage .sub{color:var(--muted)}.stage .row{display:flex;align-items:center;gap:clamp(5px,1.6vmin,12px)}.stage .panel{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(6px,1.6vmin,12px)}.stage .mono{font-family:ui-monospace,SFMono-Regular,monospace;font-size:clamp(12px,2.5vmin,15px)}.stage .grow{flex:1}.stage .on{color:var(--accent)}.sides{flex:1;justify-content:center}.sides .panel{width:39%;text-align:center}.sides b{color:var(--accent)}.diff{font-size:clamp(22px,5vmin,38px);color:var(--accent-3)}.drift{text-align:center;color:var(--accent-3)}.stage[data-phase="1"] .diff{animation:turn .6s ease}.stage[data-phase="2"] .diff{font-size:0}.stage[data-phase="2"] .diff:after{content:'=';font-size:clamp(22px,5vmin,38px);color:var(--accent)}.stage[data-phase="2"] .live b{font-size:0}.stage[data-phase="2"] .live b:after{content:'replicas: 3';font-size:clamp(12px,2.5vmin,16px)}.stage[data-phase="2"] .drift{font-size:0}.stage[data-phase="2"] .drift:after{content:'synced';font-size:clamp(12px,2.5vmin,16px);color:var(--accent)}@keyframes turn{to{transform:rotate(180deg)}}
js
const stage=document.querySelector('.stage');let phase=0;function advance(){phase=(phase+1)%3;stage.dataset.phase=String(phase)}const timer=setInterval(advance,1200);stage.addEventListener('pointerdown',()=>{clearInterval(timer);advance()})

GitOps는 배포 설정의 정본을 Git에 두고 컨트롤러가 실제 환경과 비교하게 합니다. 사람이 직접 환경을 바꿔도 다음 조정에서 차이가 발견됩니다.

데모는 Git의 복제 수 3과 환경의 복제 수 2를 비교한 뒤 빠진 파드를 채웁니다. 무조건 덮어쓰는 정책은 긴급 조치를 지울 수 있으므로 변경 경로와 권한을 함께 설계해야 합니다.

언제 쓰나

여러 환경의 배포 설정을 리뷰 가능한 이력으로 유지할 때 사용합니다.

페이지로 열기 ↗