<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Go on homelab89</title>
    <link>https://blog.homelab89.com/tags/go/</link>
    <description>Recent content in Go on homelab89</description>
    <generator>Hugo</generator>
    <language>ko-KR</language>
    <lastBuildDate>Sun, 07 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.homelab89.com/tags/go/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Apps Walkthrough — backend &#43; hc &#43; graceful-drain.sh</title>
      <link>https://blog.homelab89.com/docs/istio/graceful-termination/apps-walkthrough/</link>
      <pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://blog.homelab89.com/docs/istio/graceful-termination/apps-walkthrough/</guid>
      <description>&lt;div class=&#34;callout abstract&#34;&gt;
&lt;div class=&#34;ct&#34;&gt;ABSTRACT&lt;/div&gt;
&lt;p&gt;graceful termination은 &amp;ldquo;Pod를 끈다&amp;quot;가 &lt;strong&gt;단일 행위가 아니라&lt;/strong&gt;, &lt;em&gt;서로 분리된 4개 신호(LB health, K8s readiness, Envoy listener, in-flight 요청)를 정해진 순서로 하나씩 끄는 것&lt;/em&gt;이라는 사실을 코드로 증명하는 문서다. 홈랩 실험의 두 Go 애플리케이션(&lt;code&gt;apps/backend&lt;/code&gt;, &lt;code&gt;apps/hc&lt;/code&gt;)과 preStop 훅(&lt;code&gt;apps/hc/graceful-drain.sh&lt;/code&gt;)을 &lt;strong&gt;라인 수준까지 추적&lt;/strong&gt;한다.
결론부터: backend는 끌 &lt;em&gt;대상&lt;/em&gt;(in-flight 요청)을 만들고, hc FSM은 &lt;em&gt;어떤 신호를 언제 끌지&lt;/em&gt;를 5-state로 인코딩하며, drain.sh는 그 &lt;em&gt;순서&lt;/em&gt;를 best-effort로 오케스트레이션한다. 세 파일은 같은 한 문제의 세 측면이다.
FSM/health 응답표·active=0 전략의 &lt;strong&gt;개요 정본&lt;/strong&gt;은 &lt;a href=&#34;../../docs/istio/graceful-termination/w2-hc-fsm/&#34;&gt;W2 — HC FSM&lt;/a&gt;, Envoy drain 메커니즘 상세는 &lt;a href=&#34;../../docs/istio/graceful-termination/envoy-drain-listeners/&#34;&gt;Envoy drain listeners&lt;/a&gt;에 둔다. 본 문서는 &lt;strong&gt;라인별 코드 추적&lt;/strong&gt;에 집중한다.&lt;/p&gt;</description>
    </item>
    <item>
      <title>W2. Backend &#43; hc &#43; drain.sh — Go 코드 메커니즘</title>
      <link>https://blog.homelab89.com/docs/istio/graceful-termination/w2-hc-fsm/</link>
      <pubDate>Sun, 07 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://blog.homelab89.com/docs/istio/graceful-termination/w2-hc-fsm/</guid>
      <description>&lt;div class=&#34;callout abstract&#34;&gt;
&lt;div class=&#34;ct&#34;&gt;ABSTRACT&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;머릿속에 담을 한 장&lt;/strong&gt;: health endpoint의 응답 코드는 LB의 backend pool membership을 제어하는 &lt;em&gt;원격 스위치&lt;/em&gt;다. hc 사이드카는 &lt;strong&gt;5-state FSM&lt;/strong&gt;(OPEN/DRAINING/CLOSING/CLOSED/FAULT)으로 이 스위치를 쥐고, drain.sh는 &amp;ldquo;active=0 확인 전까지 &lt;code&gt;/health_check.html&lt;/code&gt; 200 유지&amp;quot;로 스위치를 끄는 &lt;em&gt;시점&lt;/em&gt;을 모든 요청 완료 이후로 밀어내 HAProxy가 in-flight 연결을 끊지 않게 한다. 본 문서는 이 동작을 &lt;strong&gt;멘탈 모델/왜&lt;/strong&gt; 층에서 다루며, 라인별 정본 추적은 &lt;a href=&#34;../../docs/istio/graceful-termination/apps-walkthrough/&#34;&gt;코드 워크스루(apps-walkthrough)&lt;/a&gt;에 위임한다.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
