Kubernetes reconciliation loop

쿠버네티스 조정 루프

A controller repeatedly closes the gap between desired and actual state.

···
html
<div class="stage" data-phase="0"><div class="title">DESIRED 3 → ACTUAL</div><div class="row counters"><div class="panel">desired <b>3</b></div><div class="panel actual">actual <b>2</b></div></div><div class="row slots"><div class="panel">pod 1</div><div class="panel">pod 2</div><div class="panel missing">empty</div></div><div class="sub">controller compares and repairs</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)}.counters{justify-content:space-between}.counters .panel{width:45%;display:flex;justify-content:space-between}.slots{flex:1;justify-content:center}.slots .panel{width:29%;text-align:center}.missing{border-style:dashed!important;color:var(--muted)}.stage[data-phase="1"] .missing{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 15%,transparent)}.stage[data-phase="2"] .missing{border-style:solid!important;background:color-mix(in srgb,var(--accent) 18%,var(--surface));color:var(--accent)}.stage[data-phase="2"] .missing:before{content:'pod 3';}.stage[data-phase="2"] .missing{font-size:0}.stage[data-phase="2"] .missing:before{font-size:clamp(12px,2.5vmin,16px)}.stage[data-phase="2"] .actual b{font-size:0}.stage[data-phase="2"] .actual b:after{content:'3';font-size:clamp(12px,2.5vmin,16px);color:var(--accent)}
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()})

A Kubernetes controller reads a desired count, observes current resources, and creates or removes objects through the API to close the gap. It then observes again.

The demo loses one of three desired pods and fills the vacancy. Reconciliation is a repeating convergence process, not a single instant command.

When to use

Use it to understand recovery after pod failure and declarative operations.

Open as page ↗