<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>minicloud Blog</title>
        <link>https://docs.devandre.sbs/blog</link>
        <description>minicloud Blog</description>
        <lastBuildDate>Sat, 21 Nov 2026 00:00:00 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <item>
            <title><![CDATA[A Database Console for Twenty Databases — Why I Deleted Adminer and Picked DBeaver]]></title>
            <link>https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases</link>
            <guid>https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases</guid>
            <pubDate>Sat, 21 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The platform grew to ~20 PostgreSQL instances plus MariaDB and ClickHouse across many namespaces. A single in-cluster web SQL console (Adminer) stopped being the right answer. Here is the tool comparison I ran, why a local client beat a hosted one, and the three Kubernetes-specific details that make it safe.]]></description>
            <content:encoded><![CDATA[<p>The platform quietly crossed a line: it now runs <strong>~20 PostgreSQL instances</strong> (CloudNativePG clusters with
dev/prod pairs, plus a few plain StatefulSets), <strong>3 MariaDB</strong> databases, and a <strong>ClickHouse</strong> store — spread
across a couple of dozen namespaces. The question stopped being <em>"how do I open a SQL console?"</em> and became
<em>"how do I give myself a console over twenty-plus databases without turning that console into a liability?"</em></p>
<p>I had been using <strong>Adminer</strong> — a single in-cluster web SQL UI behind SSO. It was fine at three databases.
At twenty-three, across dev and prod, it was the wrong shape. This post is the comparison I actually ran
and the decision I landed on.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-was-wrong-with-the-thing-i-already-had">What was wrong with the thing I already had<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#what-was-wrong-with-the-thing-i-already-had" class="hash-link" aria-label="Direct link to What was wrong with the thing I already had" title="Direct link to What was wrong with the thing I already had" translate="no">​</a></h2>
<p>Adminer is a lovely 400 KB PHP file. But as <em>the</em> database cockpit for a multi-namespace cluster it has
three structural problems:</p>
<ol>
<li class=""><strong>It's a standing attack surface.</strong> A web UI that can reach several databases' namespaces is, by
definition, a permanent pod + ingress + a set of NetworkPolicy holes into DB namespaces. One
misconfiguration and every database it can see is a browser tab away.</li>
<li class=""><strong>Every tab looks identical.</strong> There is no visual difference between <code>claims (dev)</code> and
<code>claims (PROD)</code>. The only thing standing between a careless <code>DELETE</code> and production is your own
attention. That is not a control.</li>
<li class=""><strong>Two engines only.</strong> Adminer does PostgreSQL and MySQL/MariaDB. It does not speak ClickHouse — so it
was never going to be the <em>one</em> tool anyway.</li>
</ol>
<p>None of these are Adminer's fault. They're what happens when you ask a single-file web console to be an
enterprise-wide database cockpit.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-field-i-compared">The field I compared<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#the-field-i-compared" class="hash-link" aria-label="Direct link to The field I compared" title="Direct link to The field I compared" translate="no">​</a></h2>
<p>I wanted one tool for every SQL engine, dev/prod safety I could <em>see</em>, and — the part that matters on a
self-hosted cluster — <strong>no new thing to run and secure</strong>. Here's how the candidates scored against <em>this</em>
setup (not in the abstract):</p>
<table><thead><tr><th>Tool</th><th>Shape</th><th>Engines it covers here</th><th>Dev/Prod guardrail</th><th>Cluster footprint</th><th>Cost</th><th>Verdict</th></tr></thead><tbody><tr><td><strong>Adminer</strong></td><td>in-cluster web UI</td><td>PostgreSQL, MariaDB</td><td>none (identical tabs)</td><td><strong>permanent</strong> pod + ingress + netpol holes</td><td>FOSS</td><td><strong>retired</strong></td></tr><tr><td>pgAdmin / phpMyAdmin</td><td>web or desktop, single-engine</td><td>one engine each</td><td>per-tool</td><td>web = footprint; desktop = none</td><td>FOSS</td><td>one tool <em>per engine</em> — wrong for 4 engines</td></tr><tr><td><strong>DBeaver CE</strong></td><td>local desktop</td><td><strong>PostgreSQL, MariaDB, ClickHouse, SQLite</strong> (+ any JDBC)</td><td><strong>connection-type colour + read-only default</strong></td><td><strong>zero</strong> (runs on my laptop)</td><td>free (Apache-2.0)</td><td><strong>chosen</strong></td></tr><tr><td>DBeaver PRO</td><td>local desktop</td><td>+ Redis, MongoDB, Cassandra…</td><td>same</td><td>zero</td><td>paid</td><td>not needed yet — free companions cover those</td></tr><tr><td>TablePlus</td><td>local desktop</td><td>many</td><td>per-connection colour</td><td>zero</td><td>paid</td><td>polished, but no edge over CE <em>for this</em></td></tr><tr><td>Beekeeper Studio</td><td>local desktop</td><td>PostgreSQL, MySQL…</td><td>some</td><td>zero</td><td>FOSS + paid tier</td><td>lighter, but no native ClickHouse</td></tr></tbody></table>
<p>Two columns decided it: <strong>"engines it covers here"</strong> and <strong>"cluster footprint."</strong> DBeaver CE is the only
free tool that speaks all three of my SQL engines in one window <em>and</em> adds nothing to the cluster — it's a
desktop app that talks over my own <code>kubectl</code>. TablePlus and Beekeeper are genuinely nice; they just didn't
beat <em>free + all-my-engines + zero-footprint</em> on this particular board.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="head-to-head-adminer-vs-dbeaver-factor-by-factor">Head-to-head: Adminer vs DBeaver, factor by factor<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#head-to-head-adminer-vs-dbeaver-factor-by-factor" class="hash-link" aria-label="Direct link to Head-to-head: Adminer vs DBeaver, factor by factor" title="Direct link to Head-to-head: Adminer vs DBeaver, factor by factor" translate="no">​</a></h3>
<p>Zooming into the two that actually ran here — the incumbent and its replacement:</p>
<table><thead><tr><th>Factor</th><th>Adminer (in-cluster web app)</th><th>DBeaver (local desktop + k8s tunnel)</th></tr></thead><tbody><tr><td><strong>Security &amp; attack surface</strong></td><td>runs inside Kubernetes, exposed via Ingress + SSO; one misconfiguration puts every database it can reach behind a browser tab</td><td><strong>zero cluster footprint</strong> — nothing deployed; access is strictly my own kubeconfig RBAC</td></tr><tr><td><strong>Prod vs dev safety</strong></td><td>every tab looks identical — easy to run a <code>DELETE</code> on <code>ktayl-core-prod</code> thinking it's dev</td><td><strong>Production connections render red, open read-only</strong>, and confirm on execute</td></tr><tr><td><strong>Managing 23+ instances</strong></td><td>retype host/user/secret on each login, or hardcode creds into config</td><td>connections saved in <strong>Production / Development folders</strong>; passwords pulled from each DB's Secret per session, kept in the encrypted local store</td></tr><tr><td><strong>ClickHouse support</strong></td><td>none — can't open <code>langfuse-clickhouse</code> at all</td><td>full, in the same window as Postgres and MariaDB</td></tr><tr><td><strong>Feature depth</strong></td><td>table browser + a raw SQL box</td><td>autocomplete, ER diagrams, visual <code>EXPLAIN</code> plans, cross-DB export, multi-tab query history</td></tr></tbody></table>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-one-case-where-adminer-would-still-make-sense">The one case where Adminer would still make sense<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#the-one-case-where-adminer-would-still-make-sense" class="hash-link" aria-label="Direct link to The one case where Adminer would still make sense" title="Direct link to The one case where Adminer would still make sense" translate="no">​</a></h3>
<p>To be fair to the 400 KB file: there <em>is</em> a scenario it wins — <strong>emergency, browser-only access from a
device with no <code>kubectl</code> and no laptop</strong> (say, a non-developer teammate reaching a database behind Authentik
SSO from a phone). If that need ever becomes real, the right answer is a <em>scoped</em> Adminer pointed at
<strong>non-prod only</strong> — not the cluster-wide console it had drifted into being. Today that need doesn't exist,
so the standing attack surface wasn't worth keeping on the bet that it might.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-non-sql-stores-go-to-purpose-built-companions">The non-SQL stores go to purpose-built companions<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#the-non-sql-stores-go-to-purpose-built-companions" class="hash-link" aria-label="Direct link to The non-SQL stores go to purpose-built companions" title="Direct link to The non-SQL stores go to purpose-built companions" translate="no">​</a></h3>
<p>The honest limit: DBeaver CE does not cover <strong>Redis/Valkey</strong> (~11 of them), <strong>OpenSearch</strong> (sanctions
screening), or <strong>Qdrant</strong> (RAG vectors). Rather than buy PRO for Redis, I let each specialist tool do its
job — <strong>RedisInsight</strong>, <strong>OpenSearch Dashboards</strong> (already web-based), and <strong>Qdrant's</strong> built-in
<code>:6333/dashboard</code>. A "single pane of glass" that's worse at every pane isn't worth the licence.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-decision-move-the-console-to-the-client">The decision: move the console to the client<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#the-decision-move-the-console-to-the-client" class="hash-link" aria-label="Direct link to The decision: move the console to the client" title="Direct link to The decision: move the console to the client" translate="no">​</a></h2>
<p>The reframing that made it click: <strong>a database console is an attack surface, and the cheapest attack
surface is the one that doesn't exist.</strong> A local client over <code>kubectl port-forward</code> has <em>zero</em> standing
footprint. Access is bounded by my own kubeconfig RBAC — there is no shared, always-on service with broad
database reach for anyone to find. Deleting Adminer didn't just swap tools; it removed a permanent pod, an
ingress, an SSO integration, and a fistful of cross-namespace NetworkPolicy holes.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="three-kubernetes-details-that-make-it-actually-safe">Three Kubernetes details that make it actually safe<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#three-kubernetes-details-that-make-it-actually-safe" class="hash-link" aria-label="Direct link to Three Kubernetes details that make it actually safe" title="Direct link to Three Kubernetes details that make it actually safe" translate="no">​</a></h2>
<p>Pointing a desktop client at in-cluster databases is only as good as the wiring. Three things matter:</p>
<p><strong>1. Tunnel to the <code>-rw</code> Service, never a pod.</strong> CloudNativePG clusters expose <code>&lt;cluster&gt;-rw</code>, which always
tracks the current primary. Forward to that and a failover is invisible to you; forward to a pod and you'll
be reading a replica — or nothing — after the next switchover.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl --context minicloud-oidc -n ktayl-core-prod \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  port-forward svc/ktayl-core-cnpg-rw 55438:5432</span><br></div></code></pre></div></div>
<p><strong>2. Credentials are pulled per session — never stored in the connection file.</strong> The generated connection
set carries hosts, ports and database names, but <strong>no passwords</strong>. Each password is read from the
database's own Kubernetes Secret at connect time, into the client's encrypted store:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl --context minicloud-oidc -n ktayl-core-prod get secret ktayl-core-cnpg-app \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -o jsonpath='{.data.password}' | base64 -d</span><br></div></code></pre></div></div>
<p>A connection file that leaks is a map, not a key.</p>
<p><strong>3. Production is red and read-only by default.</strong> This is the control Adminer couldn't give. Every <code>*-prod</code>
connection is tagged <code>Production</code> — the client paints its tabs <strong>red</strong> and opens them <strong>read-only</strong>, with a
confirm prompt on execute. Writing to production is a deliberate toggle, not an accident of which tab had
focus. Dev connections stay plain.</p>
<p>The whole thing is generated from one source-of-truth table (port · namespace · <code>-rw</code> service · engine ·
env · secret), so the tunnels, the connection file, and the docs never drift.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-id-tell-myself-three-databases-ago">What I'd tell myself three databases ago<a href="https://docs.devandre.sbs/blog/a-database-console-for-twenty-databases#what-id-tell-myself-three-databases-ago" class="hash-link" aria-label="Direct link to What I'd tell myself three databases ago" title="Direct link to What I'd tell myself three databases ago" translate="no">​</a></h2>
<p>Not <em>"pick DBeaver."</em> The transferable lesson is the question order: <strong>start from the attack surface and the
blast radius, not the feature list.</strong> The best console for twenty databases turned out to be the one that
runs nowhere, stores no passwords, and makes production visibly dangerous to touch. The feature comparison
only mattered <em>after</em> those constraints had already thrown out most of the field.</p>]]></content:encoded>
            <category>databases</category>
            <category>postgresql</category>
            <category>mariadb</category>
            <category>clickhouse</category>
            <category>kubernetes</category>
            <category>cnpg</category>
            <category>security</category>
            <category>tooling</category>
            <category>dbeaver</category>
        </item>
        <item>
            <title><![CDATA[Database Isolation Is Not Operational Isolation — When Postgres Apps Should Share a Cluster]]></title>
            <link>https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation</link>
            <guid>https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation</guid>
            <pubDate>Sat, 21 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Browsing the platform's databases, I noticed two Postgres servers host many databases — Backstage 13, the AI server 6. That raised the real design question: when should apps share a Postgres cluster, and when should they get their own? The answer turns on a distinction that's easy to miss — separate databases isolate access, not operations, and especially not recovery.]]></description>
            <content:encoded><![CDATA[<p>While wiring up a desktop SQL client across the platform's ~20 Postgres instances, I hit a small surprise:
two servers host <strong>many</strong> databases at once. <strong>Backstage</strong> keeps <strong>13</strong> of them (one per plugin —
<code>backstage_plugin_catalog</code>, <code>_auth</code>, <code>_scaffolder</code>, …); the shared <strong>AI</strong> server keeps <strong>6</strong> (one per tool
— <code>openwebui</code>, <code>litellm</code>, <code>ragdb</code>, <code>vaultwarden</code>, <code>flowise</code>, <code>mlflow</code>). Everything else uses one database
per server.</p>
<p>That's a UI curiosity. But it forced the actual design question behind it: <strong>when should apps share a
Postgres cluster, and when should each get its own?</strong> The answer rests on a distinction that's easy to
collapse — and expensive when you do.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-server-many-databases">One server, many databases<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#one-server-many-databases" class="hash-link" aria-label="Direct link to One server, many databases" title="Direct link to One server, many databases" translate="no">​</a></h2>
<p>First, the mental model, because it trips people up. A Postgres <strong>server</strong> (one running instance, one
host<!-- -->:port<!-- -->, one login) is a <em>container</em> for many <strong>databases</strong>:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Server/instance   (one pod, one host:port, one superuser login)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   └── Databases          ← there can be many</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         └── Schemas</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">               └── Tables</span><br></div></code></pre></div></div>
<p>The server is an apartment building; each database is an apartment. The <code>postgres</code> superuser is the master
key — but you still choose <strong>which apartment</strong> to walk into. (Connect to the wrong one — the empty default
<code>postgres</code> database — and you'll swear the data is gone. It isn't; you're in the wrong room.)</p>
<p>Backstage and the AI server hold many apartments on purpose: Backstage runs in <em>database-per-plugin</em> mode,
and the AI server consolidates several small tools onto one instance instead of running six separate
Postgres deployments on a resource-tight cluster. Consolidation is a <em>good</em> instinct here. The question is
how far to take it — and that's where the two kinds of isolation matter.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-distinction-database-isolation--operational-isolation">The distinction: database isolation ≠ operational isolation<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#the-distinction-database-isolation--operational-isolation" class="hash-link" aria-label="Direct link to The distinction: database isolation ≠ operational isolation" title="Direct link to The distinction: database isolation ≠ operational isolation" translate="no">​</a></h2>
<p>Putting two apps on one cluster with separate databases and roles gives you <strong>database isolation</strong>. It does
<strong>not</strong> give you <strong>operational isolation</strong>. They are different things:</p>
<table><thead><tr><th></th><th><strong>Database isolation</strong> (separate DB + role)</th><th><strong>Operational isolation</strong> (separate cluster)</th></tr></thead><tbody><tr><td>What it controls</td><td><strong>access</strong> — what each app can read/write</td><td><strong>blast radius</strong> — CPU, memory, storage I/O, a cluster-wide outage or upgrade</td></tr><tr><td>Apps on one cluster still share</td><td>—</td><td>all of the above, <strong>plus one backup/PITR recovery boundary</strong></td></tr></tbody></table>
<p>A role scoped to its own database means LiteLLM can't read Open WebUI's rows. Good. But both still contend
for the same CPU, memory and disk I/O, both go down in the same cluster outage, both move together on an
upgrade — and, the part that bites hardest, <strong>both live inside the same physical-backup boundary.</strong></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-recovery-boundary-is-the-one-people-miss">The recovery boundary is the one people miss<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#the-recovery-boundary-is-the-one-people-miss" class="hash-link" aria-label="Direct link to The recovery boundary is the one people miss" title="Direct link to The recovery boundary is the one people miss" translate="no">​</a></h2>
<p>A CloudNativePG physical backup + point-in-time recovery restores the <strong>whole cluster</strong> — not a single
database. So "restore only <code>litellm</code> to yesterday 14:00" is not a one-liner. It's:</p>
<ol>
<li class="">restore the <strong>entire</strong> cluster to a <strong>temporary</strong> instance at that timestamp,</li>
<li class=""><code>pg_dump</code> the <code>litellm</code> database out of it,</li>
<li class="">load it back into the live cluster.</li>
</ol>
<p>Separate databases do <strong>not</strong> buy you separate recovery. A <strong>dedicated cluster</strong> does. That single fact
reorders a lot of "just put it on the shared one" decisions.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="so-where-does-each-app-go">So where does each app go?<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#so-where-does-each-app-go" class="hash-link" aria-label="Direct link to So where does each app go?" title="Direct link to So where does each app go?" translate="no">​</a></h2>
<p>The rule I landed on: <strong>consolidate low-risk workloads, isolate the recovery-critical ones.</strong></p>
<table><thead><tr><th>Workload</th><th>Placement</th><th>Why</th></tr></thead><tbody><tr><td>Open WebUI · Flowise · LiteLLM · MLflow</td><td><strong>Shared</strong> cluster, DB + role per app</td><td>low-risk; share capacity and maintenance; isolate <em>access</em>, not operations</td></tr><tr><td>Retrieva · <code>ragdb</code></td><td>Shared if indexing is light; <strong>dedicated</strong> if it contends</td><td>bulk ingest + vector-index builds fight interactive queries for CPU/disk</td></tr><tr><td>Backstage (13 plugin DBs)</td><td><strong>One</strong> cluster for all of them</td><td>keep separate only if the dev portal must survive an AI/workplace DB incident</td></tr><tr><td><strong>Authentik</strong></td><td><strong>Dedicated</strong></td><td>an auth outage blocks many services and complicates every other recovery</td></tr><tr><td><strong>Vaultwarden</strong></td><td><strong>Dedicated</strong>, off the AI cluster</td><td>break-glass credentials need a recovery path independent of AI workloads</td></tr></tbody></table>
<p>Two of those are non-negotiable on a platform you have to <em>recover</em>: the thing that authenticates everything
(Authentik) and the thing that holds break-glass credentials (Vaultwarden) must not share a failure or
recovery boundary with a pile of experimental AI tools.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="a-correction-to-the-usual-hand-wave">A correction to the usual hand-wave<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#a-correction-to-the-usual-hand-wave" class="hash-link" aria-label="Direct link to A correction to the usual hand-wave" title="Direct link to A correction to the usual hand-wave" translate="no">​</a></h2>
<p>"One database per server" is a simplification. One Postgres <strong>instance accepts many logins</strong>, and a CNPG
cluster runs a <strong>primary plus replicas</strong>. For shared hosting the discipline is: <strong>one role per app, scoped
to its own database, with a per-role <code>connectionLimit</code></strong> so one chatty app can't exhaust the cluster's
connections. Use the superuser as a <em>separate admin login</em> only when you deliberately want to browse across
databases.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="dont-argue-it--measure-it">Don't argue it — measure it<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#dont-argue-it--measure-it" class="hash-link" aria-label="Direct link to Don't argue it — measure it" title="Direct link to Don't argue it — measure it" translate="no">​</a></h2>
<p>The honest move isn't to declare a policy; it's to prove one. Before migrating more workloads onto the
shared cluster, I'd:</p>
<ol>
<li class=""><strong>Consolidate the lightweight <em>dev</em> databases</strong> first (lowest stakes).</li>
<li class=""><strong>Run one restore drill:</strong> recover <code>litellm</code> into a <em>temporary</em> cluster <strong>while the live shared cluster
keeps serving</strong> the other tools. That's the whole thesis under test — can you recover one app without
taking down its neighbours?</li>
<li class=""><strong>Measure the Longhorn PVC + replica footprint actually eliminated.</strong> On a cluster whose real
bottleneck is storage-replica rebuilds, that number — not the count of databases DBeaver shows — is what
tells you whether to consolidate further.</li>
</ol>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-line-worth-keeping">The line worth keeping<a href="https://docs.devandre.sbs/blog/database-isolation-vs-operational-isolation#the-line-worth-keeping" class="hash-link" aria-label="Direct link to The line worth keeping" title="Direct link to The line worth keeping" translate="no">​</a></h2>
<p><strong>Separate databases isolate access. Only a separate cluster isolates operations — and recovery.</strong> Decide
placement on the second one: <em>if I had to restore this app alone, at 3am, while everything else kept
running, would today's layout let me?</em> If yes, share freely. If no, it has earned its own cluster.</p>]]></content:encoded>
            <category>databases</category>
            <category>postgresql</category>
            <category>cnpg</category>
            <category>backup</category>
            <category>disaster-recovery</category>
            <category>architecture</category>
            <category>dora</category>
            <category>carnets</category>
        </item>
        <item>
            <title><![CDATA[Closing the Books: an Auditable Period Close — and Why the 'Lock' Is a Polite Fiction]]></title>
            <link>https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production</link>
            <guid>https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production</guid>
            <pubDate>Thu, 19 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Shipping the ktayl-core finance module — GL reconciliation and an auditable period close — to production. The interesting part wasn't the code; it was discovering that a 'period lock' can't physically exist without breaking the architecture, and what an honest close does instead.]]></description>
            <content:encoded><![CDATA[<p>The insurance monolith (<code>ktayl-core</code>) could already turn a bound policy into cash and post it to the general
ledger — premium → invoice → payment → double-entry Journal Entries in ERPNext. What it couldn't do was
answer the question an auditor actually asks: <strong>"does the ledger agree with what you billed this month, and
is the period closed?"</strong></p>
<p>That's the <code>finance</code> module, now live in production. Two capabilities: a <strong>reconciliation</strong> (the billing
subledger's posted total vs the GL, the drift between them, and the count of <em>stuck</em> postings) and a
<strong>period close</strong> — lock a month, with a tamper-evident record of who closed it and the figures they attested.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-interesting-problem-you-cannot-actually-lock-the-books">The interesting problem: you cannot actually lock the books<a href="https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production#the-interesting-problem-you-cannot-actually-lock-the-books" class="hash-link" aria-label="Direct link to The interesting problem: you cannot actually lock the books" title="Direct link to The interesting problem: you cannot actually lock the books" translate="no">​</a></h2>
<p>My first instinct was the obvious one: closing a period should <em>prevent</em> new postings landing in it. A hard
lock — billing checks "is this period closed?" before it writes.</p>
<p>That's architecturally impossible here, and the reason is a good one. <code>finance</code> already depends on <code>billing</code>
(it reads the ledger view). A hard lock would make <code>billing</code> depend on <code>finance</code> — a <strong>dependency cycle</strong>,
which the Spring Modulith boundary test (<code>ApplicationModules.verify()</code>) rejects at build time, by design.
Billing must stay oblivious to finance.</p>
<p>At first this felt like the tooling getting in my way. It wasn't — it was the tooling telling me my mental
model of "a close" was wrong. On an <strong>asynchronous</strong> subledger (billing posts to the GL via a drained
outbox), a "lock" is a fiction anyway: there's always a posting in flight. Real finance closes don't pretend
otherwise. They <strong>attest and detect</strong>:</p>
<ul>
<li class="">You may only close a period whose subledger is <strong>settled</strong> (no pending/failed postings) and <strong>reconciled</strong>
(zero drift, or an explicit <code>force</code> + a written reason). The close records that attested state, immutably.</li>
<li class="">After close, a <code>postCloseMovement</code> signal <strong>detects</strong> anything that moves — the sanctioned response is a
<em>reopen → adjust → re-close</em>, exactly how a human finance team handles a late entry.</li>
</ul>
<p>So the close is a <strong>control, not a padlock</strong> (I wrote it up as ADR-019). The module boundary didn't block a
good design; it refused a dishonest one.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="minor-units-immutable-audit-and-a-boundary-you-cant-cheat">Minor units, immutable audit, and a boundary you can't cheat<a href="https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production#minor-units-immutable-audit-and-a-boundary-you-cant-cheat" class="hash-link" aria-label="Direct link to Minor units, immutable audit, and a boundary you can't cheat" title="Direct link to Minor units, immutable audit, and a boundary you can't cheat" translate="no">​</a></h2>
<p>The unglamorous disciplines are what make it trustworthy: money is integer eurocents end to end (never a
float); the closing audit is <strong>append-only</strong> (rows are written, never updated or deleted — the attested
snapshot <em>is</em> the evidence); and <code>finance</code> reaches into <code>billing</code> only through a published <code>ledger-view</code>
interface, never its tables. 222 tests, including the full close lifecycle against a real Postgres.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-bonus-production-verification-earned-its-keep-again">The bonus: production verification earned its keep (again)<a href="https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production#the-bonus-production-verification-earned-its-keep-again" class="hash-link" aria-label="Direct link to The bonus: production verification earned its keep (again)" title="Direct link to The bonus: production verification earned its keep (again)" translate="no">​</a></h2>
<p>Promoting to prod, the deploy went clean — pods healthy, migrations applied, endpoints gated — but the
ArgoCD app flipped <strong>Degraded</strong>. Not my change: <em>every</em> app was degraded. A power event earlier that day had
left the external-secrets operator unable to reach the API server from the one flaky node it happened to sit
on, so all 126 ExternalSecrets had been failing to refresh for hours. Running pods were fine (their secrets
were already materialised), but any restart needing a fresh secret would have failed cluster-wide — a latent
outage nobody had noticed.</p>
<p>One Cilium-agent restart on that node fixed it; 126 → 0 in two minutes. The finance deploy didn't cause it —
but <strong>verifying the finance deploy end-to-end is what surfaced it.</strong> Green CI and a healthy pod would never
have shown it. That's the whole argument for checking the real system, not just the pipeline.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whats-next">What's next<a href="https://docs.devandre.sbs/blog/ktayl-core-finance-close-to-production#whats-next" class="hash-link" aria-label="Direct link to What's next" title="Direct link to What's next" translate="no">​</a></h2>
<p>The money thread now runs submission → underwriting → policy → billing → <strong>close</strong>. Next on this epic
(FINCLOSE-03): a close dashboard across periods and a Prometheus alert on outbox drift, so a stuck ledger
posting pages someone <em>before</em> it becomes a month-end surprise — rather than being found by a human looking.</p>]]></content:encoded>
            <category>ktayl-core</category>
            <category>finance</category>
            <category>modular-monolith</category>
            <category>spring-modulith</category>
            <category>observability</category>
            <category>production</category>
            <category>carnets</category>
        </item>
        <item>
            <title><![CDATA[One Pod Took Down Every Secret in the Cluster — and Why the Fix Wasn't 'Restart It']]></title>
            <link>https://docs.devandre.sbs/blog/one-pod-took-down-every-secret</link>
            <guid>https://docs.devandre.sbs/blog/one-pod-took-down-every-secret</guid>
            <pubDate>Thu, 19 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A power event left 126 ExternalSecrets failing cluster-wide. The symptom pointed at Vault; the cause was a single controller pod on a flaky node. The interesting part is why the obvious fix — restart it — does nothing, and what actually makes it self-heal.]]></description>
            <content:encoded><![CDATA[<p>I was verifying a routine production deploy when ArgoCD flipped the app to <strong>Degraded</strong>. The pods were
healthy, the endpoints answered — so I looked wider. <em>Every</em> app was Degraded. A cluster-wide query showed
<strong>126 ExternalSecrets failing to sync</strong>, and they had been failing silently for hours after a power event
earlier that day.</p>
<p>Nothing had broken that I could see from the outside. That's the kind of incident worth writing down.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-misdiagnosis-trap">The misdiagnosis trap<a href="https://docs.devandre.sbs/blog/one-pod-took-down-every-secret#the-misdiagnosis-trap" class="hash-link" aria-label="Direct link to The misdiagnosis trap" title="Direct link to The misdiagnosis trap" translate="no">​</a></h2>
<p>The surface reading is "Vault is down" or "the secrets operator is broken." Both were wrong. Vault was
<strong>unsealed and healthy</strong>. The external-secrets operator (ESO) was <strong>Running</strong>. Yet the <code>vault-backend</code>
ClusterSecretStore sat <code>InvalidProviderConfig</code>, and the real error, buried in the store status, was not
about Vault at all:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">cannot request a ServiceAccount token for external-secrets:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Post https://10.43.0.1:443/.../token: dial tcp 10.43.0.1:443: network is unreachable</span><br></div></code></pre></div></div>
<p>ESO authenticates to Vault using a Kubernetes ServiceAccount token it mints from the <strong>API server</strong>
(<code>10.43.0.1:443</code>). The single ESO controller pod happened to be scheduled on the oldest, flakiest node in
the cluster, and <em>that node</em> had lost its pod-to-API-server routing across the reboot. So ESO couldn't mint
its token → couldn't build its Vault client → <strong>every</strong> ExternalSecret stopped refreshing. One pod, on one
bad node, took out secret refresh for the whole cluster.</p>
<p>(There's a sibling failure mode with the identical symptom but a different cause — node clock skew making
Vault reject the token's <code>nbf</code> claim with a 403. Same store error, completely different fix. The lesson
that saved time: <strong>read the exact error string before acting</strong> — <code>network is unreachable</code> and
<code>invalid nbf claim</code> send you to opposite ends of the stack.)</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-restart-it-does-nothing">Why "restart it" does nothing<a href="https://docs.devandre.sbs/blog/one-pod-took-down-every-secret#why-restart-it-does-nothing" class="hash-link" aria-label="Direct link to Why &quot;restart it&quot; does nothing" title="Direct link to Why &quot;restart it&quot; does nothing" translate="no">​</a></h2>
<p>The reflex is <code>kubectl rollout restart</code>. It doesn't help — the fresh pod reschedules straight back onto the
same broken node and fails the same way. (A one-off <code>cilium</code> restart on <em>that</em> node fixes the routing and
recovers everything in two minutes — but that's a human noticing and intervening, and the incident had
already run for hours unnoticed.)</p>
<p>The deeper problem isn't the flaky node. It's that <strong>a critical cluster-wide controller was a single pod</strong> —
a hidden single point of failure hiding inside something that <em>looks</em> stateless and disposable.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-fix-that-makes-the-failure-self-heal">The fix that makes the failure self-heal<a href="https://docs.devandre.sbs/blog/one-pod-took-down-every-secret#the-fix-that-makes-the-failure-self-heal" class="hash-link" aria-label="Direct link to The fix that makes the failure self-heal" title="Direct link to The fix that makes the failure self-heal" translate="no">​</a></h2>
<p>Two replicas with <strong>leader election</strong>, spread across nodes. The mechanism is the elegant part, and it's
worth understanding rather than cargo-culting:</p>
<ul>
<li class="">The leader holds a <strong>lease in the API server</strong>. Only the leader reconciles; the second pod is a hot
standby.</li>
<li class="">When the leader's node loses API-server routing, it <strong>can't renew its lease</strong>. The standby — on a healthy
node, which <em>can</em> reach the API server — sees the lease expire and <strong>acquires it</strong>, then resumes
reconciling.</li>
</ul>
<p>So the exact event that broke ESO (a node losing the API server) is now the thing that <strong>triggers
failover</strong>. No human, no <code>cilium</code> restart.</p>
<p>Two details mattered:</p>
<ol>
<li class=""><strong><code>leaderElect</code> defaults to <code>false</code>.</strong> Bumping to two replicas <em>without</em> enabling it would be worse than
the bug — both pods would reconcile at once. That one line is the whole fix.</li>
<li class=""><strong>Spread, don't pin.</strong> The tempting shortcut is "just keep ESO off the bad node." But pinning-away is
still a pin, and it only defends against the <em>one</em> node you've already seen fail. A topology spread
across hostnames survives <em>any</em> single bad node — which is the actual requirement.</li>
</ol>
<p>I scoped it to the controller (the proven failure path) and left the admission webhook alone — narrow beats
broad when you're changing a component the whole cluster depends on.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-meta-lesson">The meta-lesson<a href="https://docs.devandre.sbs/blog/one-pod-took-down-every-secret#the-meta-lesson" class="hash-link" aria-label="Direct link to The meta-lesson" title="Direct link to The meta-lesson" translate="no">​</a></h2>
<p>This outage was <strong>latent</strong>. Running pods were unaffected (their secrets were already materialised); the only
victims-in-waiting were any pod that would restart and need a fresh secret. Green CI, healthy dashboards, no
alert — it was invisible until someone <em>verified a deploy end-to-end</em> and noticed an unrelated app was
Degraded.</p>
<p>That's the entire case for checking the real system over trusting the pipeline. The finance feature I was
shipping that day was fine. Verifying it is what surfaced a cluster-wide reliability bug that had nothing to
do with it — and that's exactly the kind of thing a pipeline can't show you.</p>]]></content:encoded>
            <category>reliability</category>
            <category>external-secrets</category>
            <category>vault</category>
            <category>cilium</category>
            <category>kubernetes</category>
            <category>sre</category>
            <category>incident</category>
        </item>
        <item>
            <title><![CDATA[Crossplane Without a Cloud — Why I Deferred It for a Year, and What Finally Earned Its Place]]></title>
            <link>https://docs.devandre.sbs/blog/crossplane-without-a-cloud</link>
            <guid>https://docs.devandre.sbs/blog/crossplane-without-a-cloud</guid>
            <pubDate>Mon, 16 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The reflex is that Crossplane is for provisioning cloud resources — RDS, GKE, S3 — so on a bare-metal cluster with no cloud account, it has nothing to do. I believed that and deferred it for a year. I was wrong about what Crossplane is for. Its value isn't a cloud account; it's a self-service infrastructure API, and the thing that makes that worth building is a developer portal. Here's the decision, what I built (including the composite-of-composites that genuinely impressed me), the boundary that keeps it from duplicating Helm, and the lesson about timing.]]></description>
            <content:encoded><![CDATA[<p>For about a year, my platform's architecture doc had a page titled <strong>"Phase 11 — Crossplane (Deferred)."</strong> The reasoning on it was, I thought, sound: Crossplane provisions external infrastructure as Kubernetes resources — AWS RDS instances, GKE clusters, Azure subscriptions — and my cluster is six laptops in a cupboard. No cloud account, no cloud resources, nothing to provision. So Crossplane had no job to do. Defer it.</p>
<p>That page even predicted its own ending: <em>"the most likely home for Crossplane is the Backstage / developer portal, where Compositions are the templates a developer clicks create on."</em></p>
<p>Last week I deleted the word "Deferred" from the title. Here's what I'd gotten wrong, and what finally made Crossplane earn its weight.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-thing-i-was-wrong-about">The thing I was wrong about<a href="https://docs.devandre.sbs/blog/crossplane-without-a-cloud#the-thing-i-was-wrong-about" class="hash-link" aria-label="Direct link to The thing I was wrong about" title="Direct link to The thing I was wrong about" translate="no">​</a></h2>
<p>I was defining Crossplane by its <strong>providers</strong> — provider-aws, provider-gcp — and concluding that without a cloud, there's nothing to orchestrate. That's looking at the plumbing and missing the point.</p>
<p>Crossplane's actual job is to be a <strong>self-service infrastructure API</strong>. A platform team defines a new Kubernetes resource type — say <code>PostgresInstance</code> — and a <em>Composition</em> that turns one short claim into all the real objects a database needs. A developer then writes six lines of YAML (or clicks a button) and gets a database. No Helm, no <code>kubectl</code>, no PR into the platform's internals.</p>
<p>Seen that way, the trigger for adopting Crossplane was never <em>"do I have a cloud account."</em> It was <em><strong>"do I have someone who wants to self-serve infrastructure."</strong></em> And the moment that became true was the moment a developer portal (Backstage) went up with golden-path templates. The deferral note had the right answer written on it the whole time.</p>
<p>This is the generalisable lesson, so let me pull it out of the Crossplane-specific story:</p>
<blockquote>
<p><strong>The right time to adopt a tool is not when the tool is interesting. It's when a real consumer for it exists.</strong> Crossplane without a self-service consumer is a control plane managing nothing — impressive and pointless. With a portal in front of it, it's the engine of the whole IDP. Same software, a year apart, completely different value.</p>
</blockquote>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-i-built">What I built<a href="https://docs.devandre.sbs/blog/crossplane-without-a-cloud#what-i-built" class="hash-link" aria-label="Direct link to What I built" title="Direct link to What I built" translate="no">​</a></h2>
<p>Two self-service APIs, each a Crossplane <em>Composite Resource Definition</em> (the new type) plus a <em>Composition</em> (what it renders), both consumed from Backstage.</p>
<p><strong><code>PostgresInstance</code></strong> — a developer asks for a database by size, and gets a CloudNativePG cluster (one instance for <code>small</code>, a two-instance HA pair for <code>medium</code>), a NetworkPolicy that locks it to the namespace, and a connection secret. One claim, three real objects.</p>
<p><strong><code>AppBundle</code></strong> — this is the one that made me grin. It's an app's <em>whole infrastructure baseline</em> in a single claim, and the way it's built is the advanced Crossplane move: a composite that <strong>composes another composite</strong>.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">AppBundle/orders            (one claim)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├─ PostgresInstance/orders   ← a NESTED composite, reconciled by its OWN Composition</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│   ├─ Cluster/orders-cnpg        (the database)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│   └─ NetworkPolicy/orders-db-netpol</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└─ NetworkPolicy/orders-baseline  (the app's default-deny network baseline)</span><br></div></code></pre></div></div>
<p><code>AppBundle</code> doesn't re-implement the database — it <em>claims a <code>PostgresInstance</code></em>, which Crossplane then expands via its own Composition. Delete the one <code>AppBundle</code> and the entire tree garbage-collects. A high-level request assembling lower-level requests: that's the pattern that turns a pile of primitives into a real platform.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-boundary-that-stops-it-duplicating-helm">The boundary that stops it duplicating Helm<a href="https://docs.devandre.sbs/blog/crossplane-without-a-cloud#the-boundary-that-stops-it-duplicating-helm" class="hash-link" aria-label="Direct link to The boundary that stops it duplicating Helm" title="Direct link to The boundary that stops it duplicating Helm" translate="no">​</a></h2>
<p>The obvious trap with <code>AppBundle</code> is that it starts to look like "deploy my app," which the platform already does with a Helm golden path. So I drew a hard line:</p>
<ul>
<li class=""><strong>Crossplane (<code>AppBundle</code>) owns the app's <em>infrastructure</em></strong> — its database, its network baseline.</li>
<li class=""><strong>Helm (<code>wrapper-service</code>) owns the app's <em>deployment</em></strong> — the Deployment/Rollout, Service, Ingress, TLS cert.</li>
</ul>
<p>They <strong>compose</strong> instead of overlapping: the Deployment mounts the secret the bundle created, and its pods are selected by the baseline NetworkPolicy. Infra vs runtime. If you don't draw this line explicitly, a "bundle" abstraction will slowly eat the deployment path and you'll have two tools fighting over the same objects.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-honest-parts">The honest parts<a href="https://docs.devandre.sbs/blog/crossplane-without-a-cloud#the-honest-parts" class="hash-link" aria-label="Direct link to The honest parts" title="Direct link to The honest parts" translate="no">​</a></h2>
<p>A few things that weren't free:</p>
<ul>
<li class=""><strong>Installing on a hardened cluster is a cascade, not a <code>helm install</code>.</strong> Gatekeeper, a locked-down ArgoCD AppProject and a scoped-RBAC model each had to be taught about Crossplane's provider pods before anything ran. Worth writing down once; painful to rediscover.</li>
<li class=""><strong>Composing a nested composite bit me.</strong> My first <code>AppBundle</code> tried to write a status field <em>onto the composed <code>PostgresInstance</code></em> — a field that isn't in that resource's schema — and the whole nesting silently failed to materialise. To surface a value you read <em>from</em> the child, not patch <em>into</em> it. The live test caught it; a unit test would not have.</li>
<li class=""><strong>It's still bare metal.</strong> The provider I use is <code>provider-kubernetes</code>, which composes in-cluster resources. The day I want self-service <em>cloud</em> buckets, I add <code>provider-aws</code> pointed at an always-free tier — but I'm applying the same rule: only when a real consumer asks.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="so-was-deferring-it-a-mistake">So: was deferring it a mistake?<a href="https://docs.devandre.sbs/blog/crossplane-without-a-cloud#so-was-deferring-it-a-mistake" class="hash-link" aria-label="Direct link to So: was deferring it a mistake?" title="Direct link to So: was deferring it a mistake?" translate="no">​</a></h2>
<p>No — and that's the point. Building Crossplane a year ago, with no portal and no one to self-serve, would have been a control plane orchestrating nothing: maintenance cost, zero value. Building it the week the portal needed "click → database" was exactly right. The tool didn't change. The <em>consumer</em> arrived. That's the signal to watch — not the tool's reputation, and not a 22-phase plan that happened to pencil it in for last spring.</p>
<p><em>The full as-built — the XRDs, the Compositions, the install cascade — lives on the <a class="" href="https://docs.devandre.sbs/platform/iac/crossplane">Crossplane page</a> in the platform docs.</em></p>]]></content:encoded>
            <category>crossplane</category>
            <category>platform-engineering</category>
            <category>idp</category>
            <category>self-service</category>
            <category>backstage</category>
            <category>architecture</category>
        </item>
        <item>
            <title><![CDATA[API Management Is Two Halves — and You Already Own the Important One]]></title>
            <link>https://docs.devandre.sbs/blog/api-management-is-two-halves</link>
            <guid>https://docs.devandre.sbs/blog/api-management-is-two-halves</guid>
            <pubDate>Sun, 15 Nov 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Someone asks you to 'put API management in place' and the reflex is to go shopping — Kong, Gravitee, WSO2, Apigee. I didn't buy anything. Because 'API management' is actually two different halves, and on a platform that already has an identity provider, a network policy layer and a service catalog, you already own the half that matters for internal APIs. Here's the decision, what I built, the one question that tells me when to buy a gateway, and the two things I got wrong on the way.]]></description>
            <content:encoded><![CDATA[<p>Someone asks you to <em>"put API management in place,"</em> and the reflex is to open a browser and compare products: Kong, Gravitee, WSO2, Apigee, Tyk. Pick one, deploy it, call it done.</p>
<p>I didn't buy anything. Not out of frugality — out of a realisation that saves a lot of footprint and regret: <strong>"API management" is not one thing. It's two halves, and most teams already own the half that actually matters for their internal APIs.</strong></p>
<p>This is the decision I made for my simulated insurer's platform, what I actually built, the one question that tells me when the <em>other</em> half becomes necessary — and, honestly, the two things I got wrong on the way.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-two-halves">The two halves<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#the-two-halves" class="hash-link" aria-label="Direct link to The two halves" title="Direct link to The two halves" translate="no">​</a></h2>
<p>When people say "API management," they mean some mix of these, and the two groups behave completely differently:</p>
<table><thead><tr><th>Half</th><th>What it does</th><th>Shape</th></tr></thead><tbody><tr><td><strong>Catalog + governance</strong> (a <em>portal</em>)</td><td>discovery, ownership, API contracts, who-consumes-what, identity, network policy</td><td>control plane</td></tr><tr><td><strong>Gateway + runtime</strong> (a <em>dataplane</em>)</td><td>per-consumer API keys, rate-limiting, quotas, request transformation, per-API usage analytics</td><td>data plane</td></tr></tbody></table>
<p>A monolithic API-management product sells you both in one box. That's the trap. Because the moment you look at what you <em>already run</em>, you notice something:</p>
<ul>
<li class=""><strong>Identity / authn-authz?</strong> Already there — a single sign-on provider issuing OIDC tokens for users and client-credentials for service-to-service.</li>
<li class=""><strong>Network / L7 policy?</strong> Already there — a default-deny CNI with per-service policy.</li>
<li class=""><strong>API catalog / developer portal?</strong> Already there — a service catalog that renders OpenAPI, tracks ownership, and draws the provider↔consumer graph.</li>
<li class=""><strong>API contracts?</strong> Already there — a committed <code>openapi.yaml</code> per service and contract tests in CI.</li>
</ul>
<p>That list <em>is</em> the first half of API management. For <strong>internal</strong> (service-to-service) APIs, it's the whole job. Buying a monolithic product to get it would mean deploying a <strong>second</strong> identity provider and a <strong>second</strong> portal just to obtain a gateway I didn't yet need — and paying for that in cluster footprint on hardware that doesn't have it to spare.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-decision-compose-now-gate-the-gateway">The decision: compose now, gate the gateway<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#the-decision-compose-now-gate-the-gateway" class="hash-link" aria-label="Direct link to The decision: compose now, gate the gateway" title="Direct link to The decision: compose now, gate the gateway" translate="no">​</a></h2>
<p>So the strategy became one line:</p>
<blockquote>
<p><strong>API management = provide a catalog + identity + policy now (from what the platform already runs); add a dedicated gateway <em>only</em> at the edge, gated behind the first real external consumer.</strong></p>
</blockquote>
<p>No monolithic product. The rejected alternative wasn't rejected on taste — it was rejected because it duplicated two systems I already operate and solved a problem (external, keyed, rate-limited APIs) that I don't have <em>today</em>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-i-actually-built-the-interim-model">What I actually built (the interim model)<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#what-i-actually-built-the-interim-model" class="hash-link" aria-label="Direct link to What I actually built (the interim model)" title="Direct link to What I actually built (the interim model)" translate="no">​</a></h2>
<p>The missing piece wasn't a gateway. It was that the catalog was <strong>empty</strong> — the platform <em>could</em> render APIs but nobody had registered them. So I did the cheap, high-value thing: I registered the real APIs as first-class catalog entities — each with its owning component, its provider↔consumer relationship, its rendered OpenAPI, and a link to the authoritative docs.</p>
<p>That turns the catalog from a nice idea into a real map: an engineer can now find an API, see who owns it, read its contract, and know who consumes it — without asking anyone. Combined with the identity provider, the network policy layer and the committed contracts, <strong>that is working API management for internal traffic.</strong> It cost no new infrastructure.</p>
<p>The honest scope matters, though: this is the <strong>catalog + identity + policy</strong> half. It does <strong>not</strong> rate-limit, issue API keys, enforce quotas, transform requests, or produce per-consumer analytics. A catalog is a portal, not a dataplane. Claiming otherwise would be the kind of overstatement that gets found out in an architecture review.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-one-question-that-tells-me-when-to-buy-a-gateway">The one question that tells me when to buy a gateway<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#the-one-question-that-tells-me-when-to-buy-a-gateway" class="hash-link" aria-label="Direct link to The one question that tells me when to buy a gateway" title="Direct link to The one question that tells me when to buy a gateway" translate="no">​</a></h2>
<p>The whole point of <em>gating</em> the gateway is having a crisp trigger, so the decision isn't vibes. Here it is:</p>
<blockquote>
<p><strong>Does an API now face a party I don't control, or does money / metering ride on it?</strong>
<strong>Yes → build the gateway. No → stay interim.</strong></p>
</blockquote>
<p>Concretely, I stand up a real edge gateway the first time any of these is true:</p>
<ol>
<li class=""><strong>A real external / third-party consumer</strong> calls an API — a broker, a reinsurer, an EDI partner. <em>(This is the primary trigger.)</em></li>
<li class=""><strong>Per-consumer API keys</strong> are needed — a partner expects a key to rotate and revoke, not an OIDC flow.</li>
<li class=""><strong>Rate-limiting or quotas</strong> must protect a partner- or public-facing backend.</li>
<li class=""><strong>Per-consumer usage analytics</strong> — billing, SLA reporting, "who called what, how often."</li>
<li class=""><strong>Monetisation</strong> — a metered API to paying customers.</li>
<li class=""><strong>Edge mediation / transformation</strong> — protocol or format translation for an external consumer.</li>
<li class=""><strong>A regulatory audit requirement</strong> on the external API surface.</li>
</ol>
<p>And the mirror image — the <em>non</em>-triggers, which is where discipline lives: more internal services calling each other, an internal UI hitting an internal API, or simply <em>wanting a nicer catalog</em> are <strong>not</strong> reasons to stand up a gateway. The common thread of every real trigger is a consumer outside the trust boundary, or money.</p>
<p>Today the platform is below all seven. So the interim model isn't a stopgap I'm embarrassed about — it's the <em>correct</em> state for where the system actually is.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="two-things-i-got-wrong-because-pretending-otherwise-helps-no-one">Two things I got wrong (because pretending otherwise helps no one)<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#two-things-i-got-wrong-because-pretending-otherwise-helps-no-one" class="hash-link" aria-label="Direct link to Two things I got wrong (because pretending otherwise helps no one)" title="Direct link to Two things I got wrong (because pretending otherwise helps no one)" translate="no">​</a></h2>
<p><strong>1. I started inventorying instead of mapping.</strong> My first instinct was to register <em>every</em> API-shaped thing. Wrong: a catalog is an <strong>integration map, not an HTTP-surface inventory</strong>. An API entity that nothing consumes teaches a reader nothing. I also managed to register a couple of <strong>duplicates</strong> — because I added entities without first checking that some services already shipped their own catalog entries. The fix was to register only APIs with a real role, and to always check what exists first. (A duplicate even collided on a name; the stale copy quietly self-pruned once I removed the source — but it was avoidable.)</p>
<p><strong>2. I filed the strategy under the wrong architectural pillar.</strong> I first documented this as an <em>Information System</em> concern, because the integration domain it belongs to sits under an "IS Foundations" grouping. But API management is a <strong>platform capability</strong> — it <em>provides</em> catalog/identity/policy/gateway to every app and would survive unchanged if the insurance business disappeared tomorrow. The grouping label and the platform-vs-business pillar are <strong>orthogonal axes</strong>, and I'd conflated them. Moved it to the platform pillar, where a shared capability belongs. The <em>use</em> of those APIs stays with the business; the <em>capability</em> is platform.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-takeaway">The takeaway<a href="https://docs.devandre.sbs/blog/api-management-is-two-halves#the-takeaway" class="hash-link" aria-label="Direct link to The takeaway" title="Direct link to The takeaway" translate="no">​</a></h2>
<p>"Put API management in place" almost never means "buy an API-management product." It means: <strong>make your APIs discoverable, owned, contracted, authenticated and policy-governed now</strong> — which, on a mature platform, you can mostly <em>compose</em> — and keep the gateway as a deliberate, triggered decision rather than a default purchase. Then write the trigger down, so the day it fires you act on evidence instead of a hunch.</p>
<hr>
<p><em>This platform runs a simulated insurer used as an engineering laboratory — no real customers or production traffic. The claim here is engineering judgement and a working interim capability, not commercial scale.</em></p>]]></content:encoded>
            <category>api-management</category>
            <category>backstage</category>
            <category>platform-engineering</category>
            <category>architecture</category>
            <category>api-gateway</category>
            <category>governance</category>
        </item>
        <item>
            <title><![CDATA[OIDC Is Not a Directory: Why I Keep Reaching for LDAP Next to Authentik]]></title>
            <link>https://docs.devandre.sbs/blog/oidc-is-not-a-directory</link>
            <guid>https://docs.devandre.sbs/blog/oidc-is-not-a-directory</guid>
            <pubDate>Tue, 20 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I run a simulated insurer's IS with Authentik as the single sign-on provider — one login for everything. So why did I just bolt an LDAP server onto it for the second time? Because SSO answers one question, and twice I needed a different one. Here's the root cause, and the rule that tells you in advance which protocol you actually need.]]></description>
            <content:encoded><![CDATA[<p>I run the information system of a simulated insurer on a six-node Kubernetes cluster, and the identity story is clean: <strong>Authentik</strong> is the single sign-on provider, every app is behind it, one login opens everything. That's the whole pitch of SSO — stop sprinkling passwords across forty apps.</p>
<p>So it was a little uncomfortable when, for the <strong>second</strong> time, I found myself standing up an <strong>LDAP</strong> server right next to Authentik. First for mail. Then, this week, for the ITSM. Twice I reached past the shiny OIDC door and opened an older, less fashionable one. The honest question a good engineer asks at that point isn't <em>"how do I wire LDAP?"</em> — it's <strong>"why does my beautiful SSO keep failing me here?"</strong></p>
<p>The answer turned out to be the same both times, and it's worth writing down so I never re-derive it a third time.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-oidc-actually-is-and-what-it-isnt">What OIDC actually is (and what it isn't)<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#what-oidc-actually-is-and-what-it-isnt" class="hash-link" aria-label="Direct link to What OIDC actually is (and what it isn't)" title="Direct link to What OIDC actually is (and what it isn't)" translate="no">​</a></h2>
<p>OpenID Connect — the protocol behind "Log in with Authentik" — is an <strong>interactive, browser-redirect, per-login</strong> flow. A human lands on an app, gets bounced to Authentik, authenticates, and comes back with a token full of claims. It is very good at exactly one question:</p>
<blockquote>
<p><strong>"The person in this browser, right now — who are they?"</strong></p>
</blockquote>
<p>That's it. OIDC is an <em>authentication event</em>, triggered by a human, in a browser, one user at a time. It is <strong>not</strong> a place you can go and <em>ask things about users</em>. There is no "verify this password for me" call, and no "give me everyone" call. OIDC is a turnstile, not a filing cabinet.</p>
<p>Both times I hit the wall, it was because the app needed the filing cabinet.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="case-1--mail-a-password-with-nowhere-to-check-it">Case 1 — Mail: a password with nowhere to check it<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#case-1--mail-a-password-with-nowhere-to-check-it" class="hash-link" aria-label="Direct link to Case 1 — Mail: a password with nowhere to check it" title="Direct link to Case 1 — Mail: a password with nowhere to check it" translate="no">​</a></h2>
<p>The mail server (Stalwart) has to let a desktop or phone mail client log in over <strong>IMAP and SMTP</strong>. Those clients authenticate the ancient way: they send a <strong>username and password over the wire</strong> and expect the server to say yes or no — a "bind."</p>
<p>There is no browser in that conversation. Thunderbird cannot get redirected to Authentik and click through a consent screen; it just has a password in hand and a socket open. OIDC has literally nothing to offer here — the whole protocol <em>is</em> the browser redirect that mail can't do.</p>
<p>What a mail server <em>can</em> do is <strong>bind against a directory</strong>: "here's a username and password, are they valid?" That's LDAP's native verb. So we turned on Authentik's <strong>LDAP outpost</strong> — which re-exposes the same Authentik users over LDAP — and pointed Stalwart at it. Same person, same password, a protocol the mail client can actually speak.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="case-2--itsm-i-needed-the-list-before-anyone-logged-in">Case 2 — ITSM: I needed the list <em>before</em> anyone logged in<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#case-2--itsm-i-needed-the-list-before-anyone-logged-in" class="hash-link" aria-label="Direct link to case-2--itsm-i-needed-the-list-before-anyone-logged-in" title="Direct link to case-2--itsm-i-needed-the-list-before-anyone-logged-in" translate="no">​</a></h2>
<p>This week's job was employee <strong>ingestion</strong> into GLPI (our ITSM). The requirement sounds trivial: <em>"when a ticket comes in, we should know who requested it."</em> To do that, every employee has to <strong>exist in GLPI as a selectable requester</strong> — ideally before they've ever logged in.</p>
<p>Here's the quiet problem with SSO: with OIDC, a user <strong>pops into existence the first time they log in</strong>, and not a moment sooner. The token tells you about <em>the one person authenticating</em> — it can't tell you about the other twenty who haven't shown up yet. There is no OIDC endpoint that means "enumerate my whole workforce." So an OIDC-only ITSM has a half-empty requester list until, one by one, everybody has happened to sign in. You can't assign a ticket to someone who isn't there.</p>
<p>What I needed was to <strong>read the user population and keep it synced</strong> — pull all ~20 employees in now, refresh daily as people join and leave. That's a <em>directory search</em>, and again the answer was the Authentik LDAP outpost: GLPI binds with a service account, searches for everyone in the <code>Workplace Users</code> group, and imports them as requesters. A daily job re-runs the sync.</p>
<p>And because LDAP also exposes <strong>group membership</strong>, I got the next requirement for free: a GLPI rule that says <em>"members of <code>Direction IT / SI</code> → Technician profile"</em>, so IT staff can be <strong>assigned</strong> tickets, not just raise them. OIDC claims could carry groups too — but only for the person logging in, and only at login. For a rule that has to apply to people who haven't logged in yet, you need the directory.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-pattern-sso-and-a-directory-are-different-organs">The pattern: SSO and a directory are different organs<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#the-pattern-sso-and-a-directory-are-different-organs" class="hash-link" aria-label="Direct link to The pattern: SSO and a directory are different organs" title="Direct link to The pattern: SSO and a directory are different organs" translate="no">​</a></h2>
<p>Once I saw it twice, the shape was obvious. These are <strong>three different questions</strong>, and they want <strong>three different protocols</strong>:</p>
<table><thead><tr><th>The real need</th><th>Protocol</th><th>The question it answers</th></tr></thead><tbody><tr><td>A human logs into a web app</td><td><strong>OIDC / SAML</strong> (Authentik SSO)</td><td>"Who is the person in this browser, right now?"</td></tr><tr><td>A non-browser client authenticates (IMAP, SMTP, LDAP-bind apps, some VPN/RADIUS)</td><td><strong>LDAP</strong> (bind)</td><td>"Is this username + password valid?"</td></tr><tr><td>An app must hold, enumerate, or pre-provision the user list + groups</td><td><strong>LDAP</strong> (search/sync) or <strong>SCIM</strong> (push)</td><td>"Who <em>are</em> all the users, and what groups are they in?"</td></tr></tbody></table>
<p>OIDC covers the first row brilliantly and the other two not at all. That's not a flaw in OIDC — it's a category error to expect it to. SSO is a <em>turnstile</em>; a directory is a <em>filing cabinet</em>; provisioning (SCIM) is a <em>mailroom that pushes updates</em>. Different organs.</p>
<p>The decision rule I'll use next time, before I start wiring anything:</p>
<ul>
<li class=""><strong>Human + browser?</strong> → OIDC. Always the default.</li>
<li class=""><strong>A client that isn't a browser needs to log in?</strong> → it needs a <strong>bind</strong> → LDAP.</li>
<li class=""><strong>An app needs the whole roster, or users to exist before they log in?</strong> → it needs to <strong>read/sync the directory</strong> → LDAP, or <strong>SCIM</strong> if the app can be <em>pushed</em> to (GLPI speaks LDAP, not SCIM, so LDAP it was).</li>
</ul>
<p>If I'd had that table a year ago, neither of these would have felt like a surprise.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-part-that-keeps-this-from-becoming-a-mess">The part that keeps this from becoming a mess<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#the-part-that-keeps-this-from-becoming-a-mess" class="hash-link" aria-label="Direct link to The part that keeps this from becoming a mess" title="Direct link to The part that keeps this from becoming a mess" translate="no">​</a></h2>
<p>Standing up LDAP twice <em>sounds</em> like identity sprawl — two user stores, two sets of passwords, drift waiting to happen. It isn't, and the reason matters: <strong>Authentik is still the one source of truth.</strong> The LDAP outpost is not a second directory with its own users; it's the <em>same</em> Authentik users, viewed through a second protocol. One person, one credential, two doors.</p>
<p>That's why, across the whole platform, I'm <code>kanmegnea@devandre.sbs</code> everywhere, my mail password <em>is</em> my Authentik password, and my GLPI account is the same identity as my SSO login. We added a <strong>protocol</strong>, not an <strong>identity system</strong>. The day there are two places to edit a user is the day this went wrong — and there isn't.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-lesson-id-hand-to-past-me">The lesson I'd hand to past-me<a href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory#the-lesson-id-hand-to-past-me" class="hash-link" aria-label="Direct link to The lesson I'd hand to past-me" title="Direct link to The lesson I'd hand to past-me" translate="no">​</a></h2>
<p>SSO is so good at the login problem that you start believing it's the <em>identity</em> problem, whole and entire. It isn't. "We have Authentik" answers <em>authentication for humans in browsers</em>. The moment a requirement is about <strong>a non-browser credential</strong> or <strong>the set of users itself</strong>, SSO goes quiet, and the right move is not to fight it — it's to put a directory next to it and keep one source of truth behind both.</p>
<p>Not every old protocol is legacy baggage. LDAP is forty years old and it's still the cleanest answer to "bind this" and "list everyone." Reaching for it next to a modern IdP isn't a step backwards — it's using the right organ for the question.</p>
<p><em>ktayl-solution is a fictional insurer used as an engineering laboratory — synthetic data, simulated users, no real customers. The identity design, however, is real and running.</em></p>]]></content:encoded>
            <category>identity</category>
            <category>authentik</category>
            <category>ldap</category>
            <category>oidc</category>
            <category>scim</category>
            <category>sso</category>
            <category>platform-engineering</category>
            <category>insurance</category>
        </item>
        <item>
            <title><![CDATA[Why an Insurer Needs Guidelines — and How I Built the Whole Framework as Code]]></title>
            <link>https://docs.devandre.sbs/blog/why-insurers-need-guidelines</link>
            <guid>https://docs.devandre.sbs/blog/why-insurers-need-guidelines</guid>
            <pubDate>Tue, 20 Oct 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[An insurance company doesn't run by hiring people and letting each department decide how to work. It runs on a framework of policies, standards, guidelines, procedures and controls. I built that framework for my simulated insurer — 15 governance books, 80 pages, wired to the business apps — and learned that the hard part isn't writing the rules. It's keeping the human rule, the executable rule and the engineering decision as one thing.]]></description>
            <content:encoded><![CDATA[<p>A real industrial insurer does not operate by hiring employees and letting each department improvise. It runs on a structured framework — <strong>policies, standards, guidelines, procedures and controls</strong> — that defines how decisions are made, who is authorized to make them, what controls apply, and what evidence is kept. For an insurer this isn't bureaucracy: the company carries financial responsibility for risks worth millions or billions of euros.</p>
<p>Picture five situations:</p>
<ul>
<li class="">An underwriter accepts a €200 million industrial risk without proper assessment.</li>
<li class="">A claims handler approves a €2 million claim without checking coverage or getting the required approval.</li>
<li class="">A salesperson promises cover the company legally cannot provide.</li>
<li class="">An IT administrator grants access to confidential claims data without authorization.</li>
<li class="">A manager signs a contract with a supplier under financial sanctions.</li>
</ul>
<p>Each one is a potential financial loss, legal problem, regulatory breach or reputational hit. Guidelines exist precisely to stop these — by defining <em>how</em> decisions must be made, <em>who</em> may make them, <em>what</em> controls are required, and <em>what</em> evidence must survive.</p>
<p>I rebuilt this framework end-to-end for <strong>ktayl-solution</strong>, a simulated insurer I run as an engineering laboratory. Here's what I learned.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-governance-hierarchy-five-levels-not-one-pile-of-pdfs">The governance hierarchy (five levels, not one pile of PDFs)<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#the-governance-hierarchy-five-levels-not-one-pile-of-pdfs" class="hash-link" aria-label="Direct link to The governance hierarchy (five levels, not one pile of PDFs)" title="Direct link to The governance hierarchy (five levels, not one pile of PDFs)" translate="no">​</a></h2>
<p>The single most useful idea is that a regulation, a policy, a guideline and a procedure are <strong>not the same thing</strong> — they answer different questions:</p>
<table><thead><tr><th>Level</th><th>Example</th><th>Answers</th></tr></thead><tbody><tr><td><strong>1 — External requirement</strong></td><td>Solvency II · DORA · GDPR · IDD</td><td>What must we comply with?</td></tr><tr><td><strong>2 — Corporate policy</strong></td><td>Information Security Policy · Risk Management Policy</td><td>What principles are non-negotiable?</td></tr><tr><td><strong>3 — Business guideline</strong></td><td>Access Management · Underwriting Appetite</td><td>How do we operate day-to-day?</td></tr><tr><td><strong>4 — Procedure (SOP)</strong></td><td>Onboarding SOP · deployment runbook</td><td>What exact steps?</td></tr><tr><td><strong>5 — Assurance</strong></td><td>Approvals · audit trails · KPIs · exceptions</td><td>How do we <em>prove</em> it happened?</td></tr></tbody></table>
<p>They overlap in conversation, but they serve different management purposes — and a mature insurer manages not just its business processes, but the <strong>rules governing those processes.</strong></p>
<p>This isn't theoretical. Under Solvency II, a regulated European insurer publishes a <strong>Solvency and Financial Condition Report (SFCR)</strong> that typically describes a Group-wide Code of Conduct, supported by more detailed compliance guidelines across subjects like anti-bribery, antitrust, sales compliance, <strong>financial sanctions and embargoes</strong>, anti-money-laundering and supervisory law — reviewed regularly, with managers required to adapt affected working instructions. Such insurers run a <strong>Three Lines of Defence</strong> model: operations own the risk, Risk/Compliance oversee and challenge, Internal Audit independently assures.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-12-domains-i-actually-built">The 12 domains I actually built<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#the-12-domains-i-actually-built" class="hash-link" aria-label="Direct link to The 12 domains I actually built" title="Direct link to The 12 domains I actually built" translate="no">​</a></h2>
<p>I organized ktayl-solution's governance into <strong>12 domains</strong>, each a "Cadre de gouvernance" book with the same <code>01 Politique → 02 Standard → 03 Directive → 04 Procédure → 05 Runbook</code> hierarchy:</p>
<blockquote>
<p>Corporate Governance &amp; Strategy · Legal/Compliance/Ethics · Enterprise Risk Management · Underwriting &amp; Policy Administration · Claims &amp; Fraud · Reinsurance &amp; International Programmes · Finance/Investments/Actuarial · HR &amp; Employee Conduct · IT/Cyber/Digital Resilience · Data Governance/Privacy/AI · Procurement/Third-Parties/Outsourcing · Sustainability/Communications/Business Continuity.</p>
</blockquote>
<p>Concretely that landed as <strong>15 governance books / 80 pages</strong> in a wiki (BookStack), behind SSO, grounded in Solvency II Pillar 2, IDD POG, DORA, GDPR, IFRS 17 and the LCB-FT/sanctions regime. Each page carries its owner, review cadence and regulatory references — because a guideline without an owner and a review date is already rotting.</p>
<p><em>(To be clear: this catalogue combines publicly-documented industry governance topics with a recommended comprehensive framework — not a claim that any specific insurer uses every exact title or workflow.)</em></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-hard-part-wasnt-writing-rules-it-was-three-homes-for-one-rule">The hard part wasn't writing rules. It was three homes for one rule.<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#the-hard-part-wasnt-writing-rules-it-was-three-homes-for-one-rule" class="hash-link" aria-label="Direct link to The hard part wasn't writing rules. It was three homes for one rule." title="Direct link to The hard part wasn't writing rules. It was three homes for one rule." translate="no">​</a></h2>
<p>The lesson that actually mattered: a single guideline lives in <strong>three places at once</strong>, and they must stay one thing.</p>
<ol>
<li class=""><strong>The human guideline</strong> — the policy/standard/guideline a person reads (the wiki).</li>
<li class=""><strong>The executable rule</strong> — the same rule enforced by the business application (appetite, authority limits, pricing floor).</li>
<li class=""><strong>The engineering decision</strong> — the architecture/ADR that says how it's built.</li>
</ol>
<p>If those three drift, governance becomes theatre. So I made the link explicit. The Underwriting guideline's <strong>delegation-of-authority matrix</strong> and <strong>technical-pricing floor</strong> aren't just prose — they're <em>executed</em> by the underwriting workbench: a quote under the technical floor is blocked and referred; a bind above an authority tier requires four-eyes. The access policy is <em>executed</em> by the IAM system (least-privilege, dual approval, joiner-mover-leaver). Each of those wiki pages carries a <strong>"policy-as-code" complement</strong> that names exactly which rules the app enforces — and says plainly that the wiki remains the source of truth.</p>
<p>That's the difference between <em>"we have a policy"</em> and <em>"the policy cannot be violated."</em> The data model I aim for threads the whole chain:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Regulation → Obligation → Policy → Guideline → Process → Control → Application → Evidence → Audit</span><br></div></code></pre></div></div>
<p>For example: <code>DORA → ICT change control → IT change policy → deployment guideline → release mgmt → deployment approval → the CI/CD pipeline → the audit log.</code></p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="guidelines-that-bind-everyone-assigned-by-role">Guidelines that bind everyone, assigned by role<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#guidelines-that-bind-everyone-assigned-by-role" class="hash-link" aria-label="Direct link to Guidelines that bind everyone, assigned by role" title="Direct link to Guidelines that bind everyone, assigned by role" translate="no">​</a></h2>
<p>Some rules are universal — Code of Conduct, confidentiality, acceptable IT use, data protection, anti-bribery, whistleblowing. But <strong>not every employee should get every guideline with equal weight.</strong> A claims handler needs settlement authority rules; an IT admin needs change-management and privileged-access rules; both need confidentiality and security awareness. So guidelines are <strong>assigned by role</strong> — in my build, your identity's groups decide which governance spaces you see and can edit, the same identity that gates every app. Governance and access are the same control surface.</p>
<p>A small but telling example from building it: the HR governance already <em>required</em> employees to sign a "charte informatique" (IT acceptable-use policy) at hiring — but the charte itself had never been written. It was a <strong>mandated-but-missing artifact</strong>: a rule that points at a document that doesn't exist. A guideline isn't "in place" until the thing it requires actually exists. I swept the whole library for that failure mode and closed the gaps.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="three-lines-of-defence-and-who-owns-what">Three Lines of Defence, and who owns what<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#three-lines-of-defence-and-who-owns-what" class="hash-link" aria-label="Direct link to Three Lines of Defence, and who owns what" title="Direct link to Three Lines of Defence, and who owns what" translate="no">​</a></h2>
<p>Publishing PDFs isn't governance. The operating model is what makes it real:</p>
<ul>
<li class=""><strong>1st line — operations</strong> (Underwriting, Claims, Finance, IT): own the risk, run the controls, keep the evidence.</li>
<li class=""><strong>2nd line — oversight</strong> (Risk, Compliance, Actuarial): set the frameworks, monitor, challenge.</li>
<li class=""><strong>3rd line — Internal Audit</strong>: independent assurance.</li>
</ul>
<p>Every guideline gets an <strong>owner, an approver, applicable roles, regulatory references, a version, a review date, related procedures, associated controls, evidence and an exceptions path</strong> — a governance register, not a folder of files. The review cadence respects the law: Solvency II Article 41, for instance, requires certain written governance policies to be reviewed at least annually.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-ai-fits--and-where-it-must-not">Where AI fits — and where it must not<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#where-ai-fits--and-where-it-must-not" class="hash-link" aria-label="Direct link to Where AI fits — and where it must not" title="Direct link to Where AI fits — and where it must not" translate="no">​</a></h2>
<p>The tempting move is to put an AI model behind a <code>calculatePremium()</code> endpoint or let a chatbot answer "am I allowed to do this?" authoritatively. I deliberately didn't. AI's honest role here is to <strong>help a human find and apply the right rule</strong>, never to <em>be</em> the rule:</p>
<ul>
<li class="">An underwriter could ask <em>"Can I insure a chemical plant in Brazil, and what approvals do I need?"</em> and get the applicable appetite, territorial and sanctions rules plus the authority matrix — <strong>retrieved from the current approved guidelines, source-linked</strong> — but the AI does not authorize the contract or invent an authority limit.</li>
<li class="">The pricing model is trained offline and <strong>compiled into an approved, versioned tariff</strong>; the price is always reconstructable without the model. (I wrote that up separately — <em><a class="" href="https://docs.devandre.sbs/blog/oidc-is-not-a-directory">"OIDC is not a directory"</a></em> and the pricing-evolution ADR.)</li>
</ul>
<p>That boundary — automate the repeatable control, preserve human accountability for the judgement — is itself the senior design decision.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-point">The point<a href="https://docs.devandre.sbs/blog/why-insurers-need-guidelines#the-point" class="hash-link" aria-label="Direct link to The point" title="Direct link to The point" translate="no">​</a></h2>
<p>Enterprise guidelines serve two needs that an insurer can't fully separate: <strong>employee governance</strong> (how people behave, what they may approve, when they escalate) and <strong>business governance</strong> (how the company accepts risk, prices, pays claims, uses third parties, stays compliant). An underwriting-authority rule is <em>both</em> — a business risk control <em>and</em> a limit on an individual's decision-making.</p>
<p>The objective is an organization where decisions are <strong>consistent, authorized, traceable, compliant and proportionate to the risk</strong> — without asking every employee to interpret hundreds of documents on their own. Building it for a simulated insurer taught me that the framework is the easy 20%; keeping the human rule, the executable rule and the engineering decision as one living thing is the 80% that actually protects the company.</p>
<p><em>ktayl-solution is a fictional insurer used as an engineering laboratory — synthetic data, simulated users, no real customers. The governance framework, and its wiring into the running systems, are real.</em></p>]]></content:encoded>
            <category>governance</category>
            <category>compliance</category>
            <category>insurance</category>
            <category>solvency-ii</category>
            <category>dora</category>
            <category>policy-as-code</category>
            <category>platform-engineering</category>
        </item>
        <item>
            <title><![CDATA[Modular-Monolith-First: Sizing Architecture to the Problem, Not the Fashion]]></title>
            <link>https://docs.devandre.sbs/blog/modular-monolith-first</link>
            <guid>https://docs.devandre.sbs/blog/modular-monolith-first</guid>
            <pubDate>Wed, 30 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[I run a simulated insurer's IS on Kubernetes, built as separate services per domain. Then I stopped and asked the uncomfortable question: is that the right architecture, or just the fashionable one? This is the decision I made — modular-monolith-first — and, more usefully, the decision I deliberately did NOT make: building the thing at all, yet.]]></description>
            <content:encoded><![CDATA[<p>There's a reflex in our industry, and I had it too: a new business domain shows up, and the hand reaches for <em>"…so that's a new microservice."</em> It feels modern. It feels scalable. It feels like what serious engineers do.</p>
<p>On the ktayl-solution information system — a six-node Kubernetes platform running a simulated insurer's entire IS — I'd built four domains exactly that way: policy, claims, underwriting, identity, each its own repo, CI pipeline, database, promotion track. Then I stopped and asked the question that matters more than any framework choice: <strong>is this the right architecture, or just the fashionable one?</strong></p>
<p>This post is the answer I arrived at — <strong>modular-monolith-first</strong> — and, honestly, the more valuable half: the decision I deliberately <em>didn't</em> make.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="architecture-follows-the-problem-not-the-fashion">Architecture follows the problem, not the fashion<a href="https://docs.devandre.sbs/blog/modular-monolith-first#architecture-follows-the-problem-not-the-fashion" class="hash-link" aria-label="Direct link to Architecture follows the problem, not the fashion" title="Direct link to Architecture follows the problem, not the fashion" translate="no">​</a></h2>
<p>The uncomfortable truth is that <strong>microservices are a solution to an organisational problem, not a technical one.</strong> They pay for themselves when <em>teams</em> need to deploy independently, when <em>scaling</em> profiles genuinely diverge, when a domain needs a <em>different stack</em>. They cost a fortune — service discovery, retries, circuit breakers, distributed tracing, eventual consistency, distributed transactions, N pipelines, N databases, N on-call surfaces — when you adopt them for a domain that has <em>none</em> of those pressures.</p>
<p>For an internal business platform — an insurer's IS, tens to a few thousand users — the first bottleneck is almost never throughput. It's <strong>business-process complexity and maintainability.</strong> And a modular monolith addresses exactly that while skipping the distributed-systems tax entirely.</p>
<p>So the default flipped. Not "a service per domain," but:</p>
<blockquote>
<p><strong>Start with a well-structured modular monolith. Move a part to its own service only when a concrete operational or organisational reason makes it true.</strong></p>
</blockquote>
<p>I made that decision test explicit — extract when <em>several</em> of these turn yes: independent deployment · another team owns it · very different scaling · different tech stack · strong data isolation · different SLA · consumed by several apps · a clear, stable business boundary. <strong>One or two yeses is not a service.</strong> It's a module.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-a-modular-monolith-actually-is-and-the-discipline-that-saves-it">What a modular monolith actually is (and the discipline that saves it)<a href="https://docs.devandre.sbs/blog/modular-monolith-first#what-a-modular-monolith-actually-is-and-the-discipline-that-saves-it" class="hash-link" aria-label="Direct link to What a modular monolith actually is (and the discipline that saves it)" title="Direct link to What a modular monolith actually is (and the discipline that saves it)" translate="no">​</a></h2>
<p>A modular monolith is one deployable whose code is organised into <strong>loosely-coupled modules</strong> around business capabilities — you get the design benefits of services (clear boundaries, separation of concerns, independent evolution) without the network in between. But it only works if you enforce the discipline that separates it from a big ball of mud:</p>
<ul>
<li class=""><strong>Modules talk through a public interface, in-process</strong> — a function call or an in-process domain event, never another module's internals. Putting HTTP or a queue <em>between modules of the same app</em> rebuilds the distributed monolith <em>inside</em> the monolith. Don't.</li>
<li class=""><strong>One database, but isolated data</strong> — one Postgres for simplicity, <strong>schema-per-module, and a hard rule that a module never reads another module's tables.</strong> That single constraint is what keeps coupling low <em>and</em> keeps the escape-route open: extracting a module later means lifting its schema and its interface, not untangling shared tables.</li>
<li class=""><strong>High cohesion, low coupling, single responsibility</strong> — a change in <code>claims</code> must not ripple into <code>billing</code>.</li>
</ul>
<p>Get that right and you have designed the service boundaries <em>without deploying them as services</em> — which is the whole game, because it makes the later extraction cheap instead of catastrophic.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-honest-audit-of-my-own-platform">The honest audit of my own platform<a href="https://docs.devandre.sbs/blog/modular-monolith-first#the-honest-audit-of-my-own-platform" class="hash-link" aria-label="Direct link to The honest audit of my own platform" title="Direct link to The honest audit of my own platform" translate="no">​</a></h2>
<p>Applying this to my own IS was uncomfortable, which is how I knew it was worth doing. The ground truth:</p>
<ul>
<li class=""><strong>Four domains are real services</strong> — and, tested against my own decision test, three are <em>justified</em>: <code>iam</code> (company-wide identity, consumed by everything), <code>claims</code> (an anti-corruption layer over a frozen, different-stack legacy — the boundary is the point), <code>underwriting</code> (Python, because pricing math is Python-native). The fourth, <code>policy-service</code>, is the core transactional domain that <code>underwriting</code> calls <strong>synchronously three times at bind</strong> — the textbook early tell of a distributed monolith. Justified today, but the seam to watch.</li>
<li class=""><strong>Twelve more domains were <em>designed but not built</em></strong> — a README and a full backlog each, and <strong>zero lines of code.</strong> The boundaries exist; the services don't. That turned out to be the best possible position: the design is done, and I hadn't yet committed the mistake of deploying twelve more services.</li>
</ul>
<p>So the correction was narrow and clear: the four stay (they earned it); the twelve become <strong>modules in a single app</strong> as they're built, not twelve more services.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="adopt-before-you-build">Adopt before you build<a href="https://docs.devandre.sbs/blog/modular-monolith-first#adopt-before-you-build" class="hash-link" aria-label="Direct link to Adopt before you build" title="Direct link to Adopt before you build" translate="no">​</a></h2>
<p>Here's the part the microservices reflex hides completely: <strong>most "domains" aren't yours to build.</strong> My finance domain isn't a service to write — ERPNext already runs the general ledger and financial close. ITSM is GLPI. Reporting is a data platform and Metabase. Documents are Paperless. Identity is its own service already.</p>
<p>The genuinely custom surface — the code no off-the-shelf tool will ever write for you — is small and specific: the insurance line-of-business logic. Broker portal and CRM. Premium billing rules and IFRS 17. Commissions, co-insurance, compliance workflow. <em>That</em> is what a modular monolith should host; everything else, it should <strong>integrate with, not reinvent.</strong> The platform that results is a deliberate <strong>hybrid</strong> — adopted tools, a few justified services, and one modular monolith for the custom logic. Not everything-in-one; not everything-a-service.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-two-senior-moves-nobody-puts-on-a-slide">The two senior moves nobody puts on a slide<a href="https://docs.devandre.sbs/blog/modular-monolith-first#the-two-senior-moves-nobody-puts-on-a-slide" class="hash-link" aria-label="Direct link to The two senior moves nobody puts on a slide" title="Direct link to The two senior moves nobody puts on a slide" translate="no">​</a></h2>
<p><strong>1. The stack is a <em>late</em> decision.</strong> I nearly fell into a second version of the same trap — pre-committing the monolith to a framework ("it'll be Spring Boot") before a single domain existed to build. That's the stack-fashion mistake wearing the modular-monolith outfit. The honest position is: the modular-monolith <em>pattern</em> is framework-agnostic; the <em>stack</em> is chosen <strong>when the first real domain is defined, against what that solution actually needs</strong> — could be NestJS, Spring Boot with Spring Modulith, .NET, whatever fits. Right tool for the task, decided at the moment you know the task. Not before.</p>
<p><strong>2. The most senior thing I did was not build it.</strong> There is no modular monolith on my platform. I checked — zero of forty-five repositories. And I'm not going to create it now, because <strong>an empty reference architecture is a liability, not a reference.</strong> A modular monolith is only worth anything when it carries a real domain doing real work. So it gets born the day I actually prioritise building the first genuinely-custom greenfield domain — realistically the broker/CRM distribution layer — <em>with</em> that first module, and not one commit sooner. Choosing <em>not</em> to build, when everything in you wants to scaffold the clever thing, is a discipline. It's also almost always the right call.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-signal-is-judgment-not-service-count">The signal is judgment, not service count<a href="https://docs.devandre.sbs/blog/modular-monolith-first#the-signal-is-judgment-not-service-count" class="hash-link" aria-label="Direct link to The signal is judgment, not service count" title="Direct link to The signal is judgment, not service count" translate="no">​</a></h2>
<p>If there's a single thing to take from this, it's that the impressive artifact was never "I ran twenty microservices." Anyone can multiply services. The senior signal — the thing an architect, an interviewer, a certification jury actually reads — is the <em>judgment</em>: <strong>a modular-monolith default, services only where a real boundary justifies one, adoption where a tool already exists, and the restraint to not build ahead of need.</strong></p>
<p>The whole decision cost nothing to <em>not</em> execute. It's written down as an architecture decision record; the boundaries are designed; the day a real domain needs a home, it's an afternoon's work. Until then, the most valuable line of code in this system is the one I chose not to write.</p>]]></content:encoded>
            <category>architecture</category>
            <category>modular-monolith</category>
            <category>microservices</category>
            <category>domain-driven-design</category>
            <category>platform-engineering</category>
            <category>insurance</category>
            <category>decision-records</category>
        </item>
        <item>
            <title><![CDATA[The Engineering Harness: Turning an AI Agent Into a Reliable Colleague on a Real Information System]]></title>
            <link>https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents</link>
            <guid>https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents</guid>
            <pubDate>Tue, 29 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Everyone is talking about smarter models. Almost nobody talks about the harness — the rules, memory, guardrails and verification loops that sit around the model and decide whether it ships reliable work or plausible garbage. This is the harness I built so an AI agent can operate on the ktayl-solution information system without breaking prod.]]></description>
            <content:encoded><![CDATA[<p>The frontier conversation in AI has quietly shifted. For two years it was <em>"which model is smartest?"</em> Now the people actually shipping agentic systems are asking a different question: <strong>"what do you put around the model?"</strong></p>
<p>That surrounding machinery has a name — the <strong>harness</strong>. The model is the engine. The harness is the chassis, the steering, the seatbelt and the brakes. A brilliant engine bolted to nothing kills you at the first corner; a modest engine in a well-built car gets you home every time. On the ktayl-solution information system — a six-node Kubernetes platform running a simulated insurer's entire IS — I've spent months building the harness that lets an AI agent do real engineering work against <strong>live infrastructure</strong> without me holding my breath.</p>
<p>This post is that harness, concept by concept. Not the theory — the actual rules I put in place, why each one exists, and the incident that usually forced it.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-a-harness-actually-is">What a harness actually is<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#what-a-harness-actually-is" class="hash-link" aria-label="Direct link to What a harness actually is" title="Direct link to What a harness actually is" translate="no">​</a></h2>
<p>Strip away the hype and an engineering harness is five things wrapped around a language model:</p>
<ol>
<li class=""><strong>Context</strong> — what the model is allowed to see, and <em>when</em>.</li>
<li class=""><strong>Memory</strong> — what persists after the session ends.</li>
<li class=""><strong>Guardrails</strong> — what the model is structurally prevented from doing wrong.</li>
<li class=""><strong>Verification</strong> — how work is <em>proven</em>, not asserted.</li>
<li class=""><strong>Orchestration</strong> — the deterministic control plane that gates the model's non-deterministic output.</li>
</ol>
<p>A raw model has none of these. It sees whatever you paste, forgets everything when the tab closes, will confidently run <code>rm -rf</code> if asked nicely, reports success it never checked, and applies changes with no gate between it and production. Every one of those is a failure I've designed <em>out</em> of my setup. Here's how.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-context-engineering--the-discipline-of-whats-in-the-window">1. Context engineering — the discipline of what's in the window<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#1-context-engineering--the-discipline-of-whats-in-the-window" class="hash-link" aria-label="Direct link to 1. Context engineering — the discipline of what's in the window" title="Direct link to 1. Context engineering — the discipline of what's in the window" translate="no">​</a></h2>
<p>The industry moved from "prompt engineering" (clever wording) to <strong>context engineering</strong> (deliberately curating what occupies the finite context window). The context window is a <em>budget</em>, not a bucket. Fill it with stale, irrelevant, or contradictory information and even the best model degrades — a phenomenon now called <strong>context rot</strong>.</p>
<p>My primary context file is a rolling window, by rule:</p>
<blockquote>
<p><strong>CLAUDE.md</strong> = current state + the <strong>last 2 session blocks</strong> only (rolling window). Older sessions → an archived <code>CLAUDE-history.md</code> on the controller. Reusable facts → the memory system. Stable rules → <code>.claude/rules/*.md</code>.</p>
</blockquote>
<p>That single discipline does a lot of work. The entry-point file stays small and <em>true</em>; history is preserved but out of the hot path; and durable knowledge is partitioned into modular, auto-loaded rule files — <code>connectivity.md</code>, <code>gitops.md</code>, <code>testing.md</code>, <code>github-projects.md</code> — that carry the standards without bloating every conversation.</p>
<p>The anti-pattern here is universal: people let one giant instructions file grow forever until it's half-obsolete and quietly poisons every session. A harness needs a <strong>compaction discipline</strong> as much as an application needs log rotation.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-persistent-memory-with-selective-recall">2. Persistent memory with selective recall<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#2-persistent-memory-with-selective-recall" class="hash-link" aria-label="Direct link to 2. Persistent memory with selective recall" title="Direct link to 2. Persistent memory with selective recall" translate="no">​</a></h2>
<p>An agent that forgets everything between sessions can't accumulate judgement. But an agent that remembers <em>everything</em> drowns. The answer is a <strong>retrieval-augmented memory</strong>: many small facts, each tagged with a description that acts as its retrieval key, and only the relevant ones pulled into context on a given task.</p>
<p>My memory system is one fact per file, with frontmatter:</p>
<div class="language-markdown codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-markdown codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token front-matter-block punctuation" style="color:#393A34">---</span><span class="token front-matter-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token front-matter-block"></span><span class="token front-matter-block front-matter yaml language-yaml key atrule" style="color:#00a4db">name</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">:</span><span class="token front-matter-block front-matter yaml language-yaml"> feedback</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">-</span><span class="token front-matter-block front-matter yaml language-yaml">harbor</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">-</span><span class="token front-matter-block front-matter yaml language-yaml">gc</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">-</span><span class="token front-matter-block front-matter yaml language-yaml">deployed</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">-</span><span class="token front-matter-block front-matter yaml language-yaml">tags</span><br></div><div class="token-line" style="color:#393A34"><span class="token front-matter-block front-matter yaml language-yaml"></span><span class="token front-matter-block front-matter yaml language-yaml key atrule" style="color:#00a4db">description</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">:</span><span class="token front-matter-block front-matter yaml language-yaml"> keep</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">-</span><span class="token front-matter-block front-matter yaml language-yaml">N GC can delete a tag still used by a running Deployment → ImagePullBackOff on reschedule</span><br></div><div class="token-line" style="color:#393A34"><span class="token front-matter-block front-matter yaml language-yaml"></span><span class="token front-matter-block front-matter yaml language-yaml key atrule" style="color:#00a4db">metadata</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">:</span><span class="token front-matter-block front-matter yaml language-yaml"></span><br></div><div class="token-line" style="color:#393A34"><span class="token front-matter-block front-matter yaml language-yaml">  </span><span class="token front-matter-block front-matter yaml language-yaml key atrule" style="color:#00a4db">type</span><span class="token front-matter-block front-matter yaml language-yaml punctuation" style="color:#393A34">:</span><span class="token front-matter-block front-matter yaml language-yaml"> feedback</span><span class="token front-matter-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token front-matter-block"></span><span class="token front-matter-block punctuation" style="color:#393A34">---</span><br></div></code></pre></div></div>
<p>Four design choices make it work as a harness component, not just a notes folder:</p>
<ul>
<li class=""><strong>Typed memories</strong> — <code>user</code> (who I am), <code>feedback</code> (how the agent should work), <code>project</code> (ongoing context), <code>reference</code> (external pointers). Different facts have different lifespans and different trust levels.</li>
<li class=""><strong>The <code>description:</code> is the retrieval key</strong> — recall is by relevance, so the index (<code>MEMORY.md</code>) can be scanned cheaply and only pertinent facts loaded.</li>
<li class=""><strong><code>[[wiki-links]]</code></strong> between facts turn the store into a knowledge graph — a gotcha about Kargo links to the gotcha about all-digit image SHAs.</li>
<li class=""><strong>Staleness awareness</strong> — the harness explicitly treats a recalled memory as <em>"what was true when written"</em> and verifies a named file or flag still exists before acting on it.</li>
</ul>
<p>That last point matters more than it looks. Most agent-memory demos happily recommend a function that was deleted three months ago. A real harness treats memory as a <em>hypothesis to verify</em>, not gospel.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-guardrails--prefer-the-impossible-over-the-forbidden">3. Guardrails — prefer the impossible over the forbidden<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#3-guardrails--prefer-the-impossible-over-the-forbidden" class="hash-link" aria-label="Direct link to 3. Guardrails — prefer the impossible over the forbidden" title="Direct link to 3. Guardrails — prefer the impossible over the forbidden" translate="no">​</a></h2>
<p>This is where a serious harness separates from a pile of good intentions. There are two kinds of guardrail, and most people only build the weak one.</p>
<p><strong>Soft guardrails</strong> are instructions: <em>"remember to use ECDSA certificates."</em> Useful, but a soft rule is only as reliable as the reader's attention on a tired Tuesday.</p>
<p><strong>Hard guardrails</strong> make the mistake <em>structurally impossible</em>. On this platform I kept hitting a recurring certificate bug — the Vault PKI role is EC-only, so any <code>Certificate</code> omitting the algorithm silently failed to sign. The soft fix is "remember the algorithm." The harness fix was a <strong>Gatekeeper admission policy</strong> (<code>K8sRequireEcdsaCert</code>) that <em>denies</em> a non-ECDSA cert at the API server. The wrong thing can no longer be created. That's the difference between a sign that says "don't fall" and a railing.</p>
<p>The same philosophy recurs across the platform:</p>
<table><thead><tr><th>Risk</th><th>Soft guardrail (weak)</th><th>Hard guardrail (what I built)</th></tr></thead><tbody><tr><td>Test hits a real database</td><td>"be careful in destructive tests"</td><td>a <strong>disposable-DB guard</strong> that makes a destructive test <em>incapable</em> of reaching a real DB</td></tr><tr><td>Bad change reaches prod</td><td>"review before promoting"</td><td><strong>CODEOWNERS-gated Git merge</strong> — the gate lives upstream in Git; no live sync can bypass it</td></tr><tr><td>Wrong certificate issuer</td><td>"use the minicloud-ca issuer"</td><td>Gatekeeper <strong>deny</strong> scoped to the issuer</td></tr><tr><td>Agent runs a raw prod <code>kubectl sync</code></td><td>"don't force-sync"</td><td><strong>auto-sync from Git only</strong> — the agent's job is to propose a Git change, never to touch the cluster</td></tr></tbody></table>
<p>The principle, borrowed straight from AI-safety practice: <strong>when you can make a failure mode unreachable, do that instead of instructing against it.</strong> Instructions are for judgement calls; structure is for things that must never happen.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-the-verification-loop--evidence-over-assertion">4. The verification loop — evidence over assertion<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#4-the-verification-loop--evidence-over-assertion" class="hash-link" aria-label="Direct link to 4. The verification loop — evidence over assertion" title="Direct link to 4. The verification loop — evidence over assertion" translate="no">​</a></h2>
<p>Here's the single most important — and most overlooked — property of a good harness. A language model will <em>cheerfully report success it never checked.</em> It is a fluent, confident narrator. Left unchecked, it will tell you the tests pass because tests passing is the expected shape of the story, not because it ran them.</p>
<p>So the harness has to force <strong>evidence over assertion</strong> at every layer. My testing standard encodes this as a five-layer pyramid — static, unit, integration, contract, E2E — plus a fifth gate that is the real teeth:</p>
<blockquote>
<p><strong>The QA gate (live-dev acceptance) is MANDATORY before prod promotion.</strong> L0–L4 prove the code in isolation and with mocks; they do <strong>not</strong> catch integration, deploy, runtime, or config bugs. After a service is live on dev, a QA agent runs an <em>adversarial test pass against the running service</em>. <strong>Green CI is not sufficient to promote.</strong></p>
</blockquote>
<p>That rule is written in blood. A recent service was built unit-tests-only, all green, and shipped three bugs that only a live adversarial pass caught: an API that was silently unauthenticated, a startup migration that disabled all logging, and — my favourite — an RFC3339 datetime the app sent that the downstream service rejected with a <code>400</code>. Every one was invisible to a mocked unit test.</p>
<p>Which leads to the core lesson the harness now enforces — <strong>mock discipline</strong>:</p>
<blockquote>
<p>A mock encodes an <em>assumption</em> about a collaborator. If the assumption is wrong, the mocked test stays <strong>green while prod fails</strong>. Therefore every mocked boundary MUST be backed by a contract test or a real integration that validates the assumption against the actual collaborator. <strong>A boundary that is only ever mocked is untested, not tested.</strong></p>
</blockquote>
<p>This is the same principle behind "the verifier must be independent of the generator." An agent that both writes the code <em>and</em> judges whether it works will grade its own homework generously. The harness inserts an independent check — a real database, a real contract, a live adversarial pass — precisely where the agent's self-assessment is least trustworthy.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-deterministic-orchestration-around-a-stochastic-core">5. Deterministic orchestration around a stochastic core<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#5-deterministic-orchestration-around-a-stochastic-core" class="hash-link" aria-label="Direct link to 5. Deterministic orchestration around a stochastic core" title="Direct link to 5. Deterministic orchestration around a stochastic core" translate="no">​</a></h2>
<p>The last piece is the control plane. The model is non-deterministic by nature; production must not be. So the harness wraps the stochastic actor in a <strong>deterministic pipeline</strong> where the agent only ever expresses <em>intent</em>, and deterministic machinery enforces the <em>outcome</em>.</p>
<p>On this platform that pipeline is: <strong>CI builds and proves the artifact → Kargo promotes it → ArgoCD reconciles it from Git.</strong> The agent proposes a Git change. It does not — cannot — click "sync" on production. The rule is blunt: <em>PR merge is the only gate; never force a manual ArgoCD sync.</em> And the promotion itself is owned by a machine, because I learned the hard way that hand-editing an image tag invites a bug where a seven-digit hex SHA that happens to be all-decimal (like <code>9248482</code>) parses as the <em>number</em> <code>9.2e+06</code> and breaks the deploy. So the harness rule became: <strong>never hand-edit an image tag; let Kargo own it</strong> — and Kargo wraps every tag in quotes, structurally killing the bug.</p>
<p>This is the agentic-safety pattern in miniature: give the agent autonomy to <em>propose</em>, keep the <em>reconciliation and the gate</em> in deterministic hands.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-meta-pattern-incident--memory--rule--backstop">The meta-pattern: incident → memory → rule → backstop<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#the-meta-pattern-incident--memory--rule--backstop" class="hash-link" aria-label="Direct link to The meta-pattern: incident → memory → rule → backstop" title="Direct link to The meta-pattern: incident → memory → rule → backstop" translate="no">​</a></h2>
<p>If you take one thing from this, take this. What makes the harness actually improve over time isn't any single rule — it's the <strong>loop that produces them</strong>:</p>
<ol>
<li class="">Something breaks in production. (Harbor GC deletes a still-deployed image. The Vault snapshot silently targets a standby node. A cross-service call fails on datetime format.)</li>
<li class="">The lesson is captured as a <strong>typed memory</strong>, dated, with the <em>why</em>.</li>
<li class="">The memory graduates into a <strong>rule</strong> in <code>.claude/rules/</code>, so it's loaded automatically forever after.</li>
<li class="">Where possible, the rule becomes a <strong>structural backstop</strong> — an admission policy, a CI guard, a machine-owned step — so the failure can't recur even if someone forgets the rule.</li>
</ol>
<p>Every guardrail in this post traces back to a real, dated incident. That feedback loop is the difference between a harness that is <em>documentation</em> and a harness that is an <em>engineering discipline</em>. It's also, not coincidentally, exactly what a compliance framework like DORA wants to see: not "we wrote a policy," but "an incident produced a control, and here's the evidence."</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="update-the-harness-becomes-an-ai-native-sdlc">Update: the harness becomes an AI-native SDLC<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#update-the-harness-becomes-an-ai-native-sdlc" class="hash-link" aria-label="Direct link to Update: the harness becomes an AI-native SDLC" title="Direct link to Update: the harness becomes an AI-native SDLC" translate="no">​</a></h2>
<p>Writing this post clarified something. The five components above are the <em>static</em> harness — they govern a single session. The next move was to close the loop around the whole software lifecycle, so the agent isn't just safe <em>within</em> a task but is wired into planning, review, testing and maintenance. Anthropic's Applied AI team frames this as an <strong>AI-native SDLC</strong> — twelve "plays" across plan → design → build → test → deploy → maintain. I ran the gap analysis against my own platform and shipped the missing pieces. Three of them extend the ideas above in ways worth pulling out.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="guardrails-one-layer-earlier-hooks-at-the-keystroke">Guardrails, one layer earlier: hooks at the keystroke<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#guardrails-one-layer-earlier-hooks-at-the-keystroke" class="hash-link" aria-label="Direct link to Guardrails, one layer earlier: hooks at the keystroke" title="Direct link to Guardrails, one layer earlier: hooks at the keystroke" translate="no">​</a></h3>
<p>The guardrails in section 3 are all <em>server-side</em> — Gatekeeper denies a bad manifest at the API server, CODEOWNERS blocks a bad merge in Git. They're excellent, but they catch the mistake <em>after</em> the agent has already produced it. A <strong>Claude Code hook</strong> moves the same "make it impossible" discipline one layer earlier — to the moment the agent tries to act.</p>
<p>A hook is a small script the harness runs <em>before</em> a tool call, and it can allow, block, or ask. Mine refuse — deterministically, before execution — an agent trying to <code>rm -rf /</code>, force-push to <code>main</code>, run a manual <code>argocd app sync</code> (the exact anti-pattern from section 5), <code>kubectl delete namespace</code>, pipe a <code>curl</code> straight into a shell, or write a secret or a <code>CLAUDE.md</code> into a repo. Crucially they <strong>fail open</strong> — a bug in a guard can never wedge the agent — and they use first-token dispatch so that a <code>grep "argocd app sync"</code> isn't mistaken for the real command. This is the client-side twin of the server-side gate: defence in depth, with the cheapest, earliest catch sitting right at the agent's fingertips.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-harness-now-tests-itself--and-closes-its-own-loop">The harness now tests itself — and closes its own loop<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#the-harness-now-tests-itself--and-closes-its-own-loop" class="hash-link" aria-label="Direct link to The harness now tests itself — and closes its own loop" title="Direct link to The harness now tests itself — and closes its own loop" translate="no">​</a></h3>
<p>Two moves complete the picture, and both are just this post's own theses applied <em>to the harness itself</em>.</p>
<p>First, <strong>the harness is code, so it gets tests.</strong> The rules, hooks and skills steer every session; a careless edit to a guard is exactly the silent regression the "evidence over assertion" section warns about. So the hooks now ship with a 36-case allow/block matrix that runs in CI on every change to the agent config. The harness regression-tests itself.</p>
<p>Second, <strong>the maintenance loop is now automated</strong> — the meta-pattern below (incident → memory → rule → backstop) turned into a running system. A deterministic detector on the controller watches production metrics as <em>control bands</em>: it learns each signal's normal range from its own rolling history and escalates only a real statistical outlier — 1σ logs, 2σ writes an <code>intent.md</code> (the same idea-capture artifact that starts every piece of work), 3σ opens a GitHub issue. No model runs in that loop — detection is 100% deterministic and free — and the <em>diagnosis</em> is a human triggering the agent on the resulting <code>intent.md</code>. A production signal now re-enters the development loop on its own.</p>
<p>And here is the part I like most, because it is the whole thesis of this post in a single episode. To verify the loop I triggered a <strong>real</strong> failure on a live band — a deliberately broken deployment. The detector was <em>supposed</em> to catch it, and didn't quite: my "rollout failed" query matched the phases <code>Degraded|Error</code>, but Argo Rollouts reports a deadline-exceeded failure as <code>Timeout</code>. The monitor that watches for broken deploys would have <strong>silently missed the most common broken deploy.</strong> A synthetic test would never have found that; only firing a real breach did. I fixed the query, added a regression test so it can't come back, and the corrected band opened the issue for real — <em>evidence over assertion</em>, applied to the very thing whose job is to enforce evidence over assertion.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="distribute-once-not-per-repo">Distribute once, not per-repo<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#distribute-once-not-per-repo" class="hash-link" aria-label="Direct link to Distribute once, not per-repo" title="Direct link to Distribute once, not per-repo" translate="no">​</a></h3>
<p>The last practical piece: all of it — hooks, skills, the review and intent-capture commands, the verifier/researcher sub-agents — is packaged as a single <strong>Claude Code plugin</strong> and installed once, so it applies in every repository automatically instead of drifting across twenty copies. The reference implementation stays version-controlled and CODEOWNERS-gated in the platform repo; the plugin is only the distribution layer. Fix a guard in one place, and <code>claude plugin update</code> carries it everywhere.</p>
<p>The through-line is deliberate: none of this needed a bigger model or a metered API bill. The deterministic parts run in CI or on the controller for free; the model's judgement runs on the plan I already pay for, invoked by a human at the gates that actually need judgement. The harness got materially stronger and the marginal cost was roughly zero — which is, again, the point.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-matters-beyond-my-lab">Why this matters beyond my lab<a href="https://docs.devandre.sbs/blog/engineering-harness-for-ai-agents#why-this-matters-beyond-my-lab" class="hash-link" aria-label="Direct link to Why this matters beyond my lab" title="Direct link to Why this matters beyond my lab" translate="no">​</a></h2>
<p>The uncomfortable truth of agentic AI in 2026 is that <strong>the model is rarely the bottleneck</strong> — the harness is. A frontier model with a weak harness produces confident, plausible, unverified work that fails in exactly the places mocks hide. A modest model with a strong harness — persistent memory, structural guardrails, an independent verification gate, and a deterministic control plane — produces work you can actually put in front of production.</p>
<p>That's the shift worth internalising. Stop asking only <em>"is the model good enough?"</em> Start asking <em>"is the harness good enough to make this model trustworthy on my system?"</em> On the ktayl-solution IS, building that harness turned out to be most of the engineering — and all of the reliability.</p>
<hr>
<p><em>The rules referenced here live in the platform's <code>.claude/rules/</code> directory and the memory system; the incidents behind them are documented across earlier posts on this blog — the <a class="" href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage">cascading outage debug</a> and the <a class="" href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup">3-2-1 backup reasoning</a> are two good examples of the loop in action.</em></p>]]></content:encoded>
            <category>ai-agents</category>
            <category>agentic-ai</category>
            <category>engineering-harness</category>
            <category>context-engineering</category>
            <category>guardrails</category>
            <category>gitops</category>
            <category>testing</category>
            <category>reliability</category>
            <category>platform-engineering</category>
            <category>llmops</category>
            <category>dora</category>
        </item>
        <item>
            <title><![CDATA[3-2-1, Not 1: Why I Kept MinIO Instead of Going Cloud-Only for Backups]]></title>
            <link>https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup</link>
            <guid>https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup</guid>
            <pubDate>Sun, 27 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[It's tempting to delete the backup server and push everything to cheap cloud object storage. On the ktayl-solution platform I decided not to — and an hour later I fat-fingered a bucket delete that proved exactly why. This is the reasoning behind keeping a local MinIO alongside Cloudflare R2, and where the cloud instinct is actually right.]]></description>
            <content:encoded><![CDATA[<p>While hardening disaster recovery on the ktayl-solution information system, a fair question came up: <em>we already mirror backups to Cloudflare R2 — so why keep a MinIO server running on the controller at all? Couldn't we retire it and go cloud-only?</em></p>
<p>R2's free tier is generous, cloud object storage is durable, and one less service to operate is always appealing. So it's a reasonable instinct. It's also <strong>wrong</strong> — and about an hour after I talked myself through why, I proved it the hard way by deleting the wrong bucket prefix. This post is that reasoning, and the honest incident that validated it.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-rule-the-instinct-forgets-3-2-1">The rule the instinct forgets: 3-2-1<a href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup#the-rule-the-instinct-forgets-3-2-1" class="hash-link" aria-label="Direct link to The rule the instinct forgets: 3-2-1" title="Direct link to The rule the instinct forgets: 3-2-1" translate="no">​</a></h2>
<p>The backup discipline that has survived every fashion cycle is <strong>3-2-1</strong>: at least <strong>3</strong> copies of your data, on <strong>2</strong> different media/locations, with <strong>1</strong> off-site. The whole point is that the copies fail <em>independently</em> — a fire, a ransomware event, a billing lockout, or a human fat-finger should never be able to take out more than one of them at a time.</p>
<p>The mistake in "let's go cloud-only" is treating MinIO and R2 as <strong>redundant</strong>. They're not — they're the two <em>halves</em> of a 3-2-1:</p>
<table><thead><tr><th></th><th>MinIO (on the controller)</th><th>Cloud (R2 / Blob / S3)</th></tr></thead><tbody><tr><td><strong>Role</strong></td><td>local <strong>primary</strong> — fast restore; the drills read from it</td><td><strong>off-site DR</strong> — geographic + provider separation</td></tr><tr><td><strong>Restore speed</strong></td><td>LAN, instant, free</td><td>WAN + egress (R2 is zero-egress ✓; S3/Azure bill it)</td></tr><tr><td><strong>Internet-independent</strong></td><td>✅ restores work during an ISP outage</td><td>❌ needs the internet to be up</td></tr><tr><td><strong>Cost</strong></td><td>free (just disk)</td><td>free within limits; egress risk on S3/Azure</td></tr></tbody></table>
<p>Retiring MinIO to go cloud-only isn't "simplifying to two copies." It's collapsing <strong>from 3-2-1 to one location</strong>. That is strictly <em>less</em> resilient, not more.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-minio-on-the-controller-is-good-design-not-tech-debt">Why MinIO-on-the-controller is good design, not tech debt<a href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup#why-minio-on-the-controller-is-good-design-not-tech-debt" class="hash-link" aria-label="Direct link to Why MinIO-on-the-controller is good design, not tech debt" title="Direct link to Why MinIO-on-the-controller is good design, not tech debt" translate="no">​</a></h2>
<p>Three properties make the local copy pull real weight:</p>
<p><strong>1. It lives outside the thing it backs up.</strong> MinIO runs on the <em>controller</em> — a separate machine from the six k3s nodes it protects. Backups should never live inside the cluster they back up; if the cluster dies, in-cluster backups die with it. A separate failure domain is correct hygiene, not a SPOF waiting to happen.</p>
<p><strong>2. Restores are LAN-fast and free.</strong> The daily restore drill — which actually loads a dump into a throwaway Postgres and asserts row counts, because <em>a backup you haven't restored is a hypothesis</em> — reads from MinIO over the local network. Instant, no egress. Go cloud-only and every drill and every real recovery now pays WAN latency and (on S3/Azure) egress fees. You'll be tempted to drill less. Don't build an architecture that punishes you for testing recovery.</p>
<p><strong>3. It's air-gapped from your cloud account.</strong> This is the one people underweight. A cloud account can be billing-locked, credential-compromised, or — my personal favourite — <strong>fat-fingered</strong>.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-incident-that-proved-the-point-an-hour-later">The incident that proved the point (an hour later)<a href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup#the-incident-that-proved-the-point-an-hour-later" class="hash-link" aria-label="Direct link to The incident that proved the point (an hour later)" title="Direct link to The incident that proved the point (an hour later)" translate="no">​</a></h2>
<p>While migrating a CloudNativePG cluster's backup target to a dedicated bucket, I deleted the <em>old</em> WAL-archive prefix to clean up. It was the right operation on the wrong assumption: a Postgres standby was mid-<code>pg_rewind</code>, and <code>pg_rewind --restore-target-wal</code> fetches missing WAL <strong>from that archive</strong>. I'd just removed the segments it needed. The replica went into a crash-loop.</p>
<p>It was fully recoverable — the primary was healthy, so I re-bootstrapped the standby from scratch and codified the lesson (<em>keep the old WAL until every replica is healthy on the new store</em>). No data was lost. But sit with the counterfactual for a second: <strong>if that archive had been my only copy of a primary's backups, a single careless <code>rm</code> would have been unrecoverable.</strong> That is the failure mode 3-2-1 exists to prevent, and it's exactly the failure mode "cloud-only" walks straight into. Human error doesn't respect a provider's eleven 9s of durability — durability protects you from <em>their</em> disk dying, not from <em>you</em> deleting the object.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-the-cloud-instinct-is-genuinely-right">Where the cloud instinct is genuinely right<a href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup#where-the-cloud-instinct-is-genuinely-right" class="hash-link" aria-label="Direct link to Where the cloud instinct is genuinely right" title="Direct link to Where the cloud instinct is genuinely right" translate="no">​</a></h2>
<p>None of this means "avoid the cloud." The off-site half of 3-2-1 <strong>is</strong> cloud, and it should be. On this platform MinIO mirrors to <strong>Cloudflare R2</strong> — 10 GB always-free with <strong>zero egress</strong>, which is the single best off-site object target of the three big options (S3 and Azure Blob both charge to pull your data back out <em>when you can least afford friction</em> — during a restore).</p>
<p>The correct place to spend the "more cloud" instinct is <strong>diversifying the off-site tier</strong>, not replacing the local one. Adding a <em>second</em> cloud (Azure Blob or S3) as an additional off-site copy buys you <strong>multi-cloud DR</strong> — protection against a single provider outage or account lockout, which for a regulated insurer maps directly to <strong>DORA Art. 28–29 (ICT concentration risk)</strong>. But it's an <em>addition</em>, sized to a free tier, not a substitute. And honestly, R2's zero-egress + 10 GB already covers the need well enough that a second cloud is a nice-to-have, not urgent.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-net-and-how-it-shows-up-in-the-design">The net, and how it shows up in the design<a href="https://docs.devandre.sbs/blog/dont-retire-minio-3-2-1-backup#the-net-and-how-it-shows-up-in-the-design" class="hash-link" aria-label="Direct link to The net, and how it shows up in the design" title="Direct link to The net, and how it shows up in the design" translate="no">​</a></h2>
<blockquote>
<p>Keep <strong>MinIO</strong> (local, primary, LAN-fast, air-gapped) <strong>+ R2</strong> (off-site, zero-egress). Optionally add a second cloud off-site later for concentration-risk cover. Never trade the local copy away for the off-site one.</p>
</blockquote>
<p>This isn't abstract — it decides where new backups <em>go</em>. When I built app-consistent logical dumps for the two most business-critical databases (the insurance policy DB and the ERP), they write to <strong>MinIO</strong> <code>db-logical/</code>, which then mirrors to R2. That gives each of them the full 3-2-1: the volume snapshot (Velero), the local logical dump (MinIO), and the off-site copy (R2) — three copies, two media, one off-site.</p>
<p>The lesson isn't "cloud bad, local good." It's that <strong>resilience comes from <em>independent</em> copies, and the cheapest way to lose that independence is to talk yourself into deleting one.</strong> I almost did — and then a stray <code>rm</code> reminded me why I hadn't.</p>]]></content:encoded>
            <category>backup</category>
            <category>disaster-recovery</category>
            <category>minio</category>
            <category>cloudflare-r2</category>
            <category>velero</category>
            <category>dora</category>
            <category>3-2-1</category>
            <category>object-storage</category>
            <category>platform-engineering</category>
            <category>reliability</category>
            <category>carnets</category>
        </item>
        <item>
            <title><![CDATA[The Layer Below GitOps: How ~200 Lines of Ansible Keep a Bare-Metal Cluster Reproducible]]></title>
            <link>https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap</link>
            <guid>https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap</guid>
            <pubDate>Sat, 19 Sep 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[GitOps reconciles everything inside the cluster — but not the operating system beneath it. This is how minicloud-ansible codifies the node-level prerequisites (iSCSI, multipath, registry mirrors, default routes, CIS hardening) so any node can be reimaged or added with a single idempotent playbook run.]]></description>
            <content:encoded><![CDATA[<p>ArgoCD reconciles everything <em>inside</em> my cluster: 95 applications, from Vault to the AI gateway, all declared in Git and continuously synced. But ArgoCD cannot format a disk, install <code>open-iscsi</code>, or fix a default route. There is a layer <strong>below</strong> GitOps — the operating system on each bare-metal node — and if that layer isn't codified, "reproducible infrastructure" is a half-truth.</p>
<p>For the ktayl-solution information system, that layer is owned by one small repo: <strong><a href="https://github.com/KanmegneTabouguie/minicloud-ansible" target="_blank" rel="noopener noreferrer" class=""><code>minicloud-ansible</code></a></strong>. It's about 200 lines of task code across four roles, and it does exactly one job well: make the node OS prerequisites for a 6-node k3s cluster <strong>reproducible and auditable</strong>. This post is how I use it to operate the organisation's platform.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-scope-boundary-what-ansible-owns-and-what-it-deliberately-doesnt">The scope boundary: what Ansible owns, and what it deliberately doesn't<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#the-scope-boundary-what-ansible-owns-and-what-it-deliberately-doesnt" class="hash-link" aria-label="Direct link to The scope boundary: what Ansible owns, and what it deliberately doesn't" title="Direct link to The scope boundary: what Ansible owns, and what it deliberately doesn't" translate="no">​</a></h2>
<p>The platform runs on refurbished ThinkPads (plus one 2012 MacBook Pro) provisioned by MAAS. The delivery model is trunk-based GitOps: CI builds artifacts, Kargo promotes them, ArgoCD deploys them. So where does Ansible fit? Precisely in the gap the other tools can't reach:</p>
<table><thead><tr><th>Layer</th><th>Owner</th><th>Example</th></tr></thead><tbody><tr><td>Bare metal / machine lifecycle</td><td>MAAS + OpenTofu</td><td>enrol &amp; commission a ThinkPad as a node</td></tr><tr><td><strong>Node OS prerequisites</strong></td><td><strong>Ansible (this repo)</strong></td><td><strong><code>open-iscsi</code>, multipath blacklist, registry mirror, default route, CIS kubelet config</strong></td></tr><tr><td>k3s cluster &amp; workloads</td><td>GitOps (ArgoCD + Kargo)</td><td>95 Applications, Helm values, promotion</td></tr></tbody></table>
<p>The single most important design decision in this repo is a <strong>non-goal</strong>: it does <strong>not</strong> install k3s. The cluster is live and stateful — Longhorn replicas, Harbor registry data, the monitoring TSDB, the kine/SQLite control-plane store. Re-running a <code>curl | sh</code> k3s installer against a healthy node has no upside and a real risk of corrupting cluster state if anything in the installer drifts. So the repo covers <strong>only the OS-level prerequisites that must be re-applied if a node is reimaged</strong> — and the k3s install stays a documented, deliberate, manual step. Knowing what <em>not</em> to automate is part of operating safely.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-four-roles-that-keep-a-node-correct">The four roles that keep a node correct<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#the-four-roles-that-keep-a-node-correct" class="hash-link" aria-label="Direct link to The four roles that keep a node correct" title="Direct link to The four roles that keep a node correct" translate="no">​</a></h2>
<p>The bootstrap playbook, <code>site.yml</code>, is four lines — it composes four roles against the <code>cluster</code> inventory group:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Bootstrap minicloud cluster nodes (post</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">MAAS</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> pre</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">k3s)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">hosts</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cluster</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">roles</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> common</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> longhorn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">prereq</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">registries</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> network</span><br></div></code></pre></div></div>
<p>Each role encodes a lesson.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="common--base-utilities-and-one-that-isnt-obvious"><code>common</code> — base utilities, and one that isn't obvious<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#common--base-utilities-and-one-that-isnt-obvious" class="hash-link" aria-label="Direct link to common--base-utilities-and-one-that-isnt-obvious" title="Direct link to common--base-utilities-and-one-that-isnt-obvious" translate="no">​</a></h3>
<p><code>htop</code>, <code>vim</code>, <code>curl</code>, <code>jq</code>, <code>rsync</code>… and <code>sqlite3</code>. That last one isn't for comfort: the control-plane node runs an online backup of the k3s state database with <code>sqlite3 .backup</code>, which is WAL-safe on a live DB. It's harmless on the workers, so it ships to every node rather than being a special case. Small, but it's the difference between "I have a backup" and "I have a backup that doesn't corrupt under load."</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="longhorn-prereq--the-role-that-earned-its-multipath-blacklist"><code>longhorn-prereq</code> — the role that earned its multipath blacklist<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#longhorn-prereq--the-role-that-earned-its-multipath-blacklist" class="hash-link" aria-label="Direct link to longhorn-prereq--the-role-that-earned-its-multipath-blacklist" title="Direct link to longhorn-prereq--the-role-that-earned-its-multipath-blacklist" translate="no">​</a></h3>
<p>This is the role with a war story. Longhorn exports each volume as an iSCSI target (vendor <code>IET</code>, product <code>VIRTUAL-DISK</code>). If <code>multipathd</code> is running, it <em>claims</em> those <code>/dev/sdX</code> devices as <code>mpathN</code> and holds them at the device-mapper layer — so kubelet's mount fails with <code>already mounted or mount point busy</code>, and pods hang forever in <code>ContainerCreating</code>.</p>
<p>The older nodes carried a hand-added blacklist. Then I added <code>loving-gannet</code>, the newest node — and it hit the bug immediately, because it <em>never had the blacklist the others had</em>. That's the exact failure mode Ansible exists to prevent: undocumented, per-node manual fixes that a new node silently lacks. So the fix went into the role:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Blacklist Longhorn iSCSI devices from multipath</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ansible.builtin.copy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">dest</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /etc/multipath.conf</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">content</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      blacklist {</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          device {</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              vendor "IET"</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              product "VIRTUAL-DISK"</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          }</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      }</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">when</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> multipathd_unit.stat.exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">notify</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Flush and restart multipathd</span><br></div></code></pre></div></div>
<p>Now the blacklist is a property of <em>being a node in this cluster</em>, not a thing I remembered to do. Any future node gets it on its first <code>site.yml</code> run. (The role also installs <code>open-iscsi</code> and enables <code>iscsid</code>, Longhorn's other hard requirement.)</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="k3s-registries--harbor-as-a-mirror-with-a-fallback-that-prevents-self-inflicted-outages"><code>k3s-registries</code> — Harbor as a mirror, with a fallback that prevents self-inflicted outages<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#k3s-registries--harbor-as-a-mirror-with-a-fallback-that-prevents-self-inflicted-outages" class="hash-link" aria-label="Direct link to k3s-registries--harbor-as-a-mirror-with-a-fallback-that-prevents-self-inflicted-outages" title="Direct link to k3s-registries--harbor-as-a-mirror-with-a-fallback-that-prevents-self-inflicted-outages" translate="no">​</a></h3>
<p>Every image pull on the cluster routes through the in-cluster Harbor as a proxy-cache mirror — <code>docker.io</code>, <code>ghcr.io</code>, <code>quay.io</code>, <code>registry.k8s.io</code>. This role drops <code>/etc/rancher/k3s/registries.yaml</code> (plus the internal root-CA cert, so pulls are HTTPS-verified) onto each node.</p>
<p>The subtlety is in the fallback. Each mirror lists Harbor <strong>first</strong> and the public upstream <strong>second</strong>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">mirrors</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"docker.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io/v2/docker-hub"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://registry-1.docker.io"</span><br></div></code></pre></div></div>
<p>That ordering is the whole point: if Harbor is down — a pod restart, an upgrade — k3s falls through to the public registry instead of the entire cluster losing the ability to pull images. It avoids the classic "the registry restart broke the cluster" trap. A registry mirror is only a good idea if it fails open.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="network--a-one-file-role-for-the-boring-problem-that-takes-a-cluster-down"><code>network</code> — a one-file role for the boring problem that takes a cluster down<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#network--a-one-file-role-for-the-boring-problem-that-takes-a-cluster-down" class="hash-link" aria-label="Direct link to network--a-one-file-role-for-the-boring-problem-that-takes-a-cluster-down" title="Direct link to network--a-one-file-role-for-the-boring-problem-that-takes-a-cluster-down" translate="no">​</a></h3>
<p>A single netplan file pins the default route via <code>10.0.0.1</code>. It's trivial — until a node reboots without a default gateway and drops off the network. The role also carries a real gotcha in its metadata: since Ubuntu 24.04, netplan <strong>refuses world-readable files</strong>, so the file must be <code>0600</code>. The handler runs <code>netplan generate</code> (to validate syntax) <em>before</em> <code>netplan apply</code> — because the one thing worse than a bad route is applying a bad route to a node you then can't reach.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="day-2-rolling-upgrades-without-downtime">Day-2: rolling upgrades without downtime<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#day-2-rolling-upgrades-without-downtime" class="hash-link" aria-label="Direct link to Day-2: rolling upgrades without downtime" title="Direct link to Day-2: rolling upgrades without downtime" translate="no">​</a></h2>
<p>Bootstrap is once-per-node. The repo's other job is ongoing maintenance, and <code>upgrade.yml</code> is where the organisation gets zero-downtime patching. It runs <code>serial: 1</code> — strictly one node at a time — and for each node:</p>
<ol>
<li class=""><code>kubectl drain</code> (delegated to the controller) — cordon + evict, respecting PodDisruptionBudgets</li>
<li class=""><code>apt update</code> + <code>apt upgrade</code> (<strong>safe</strong> upgrade — never removes packages)</li>
<li class="">reboot <strong>only if</strong> <code>/var/run/reboot-required</code> exists (i.e. a kernel landed)</li>
<li class="">wait for the node to report <code>Ready</code></li>
<li class=""><code>kubectl uncordon</code></li>
</ol>
<p>The pre-flight is codified in the playbook's own comments as an operating contract: every workload should have ≥2 replicas with anti-affinity across workers, and every Longhorn volume ≥2 healthy replicas — so the drain can <em>fail safe</em> if it can't relocate a volume rather than risk data. This is how a solo-operated platform patches its OS across a live cluster without taking the organisation's services offline.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="beyond-bootstrap-hardening-and-migrations-as-playbooks">Beyond bootstrap: hardening and migrations as playbooks<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#beyond-bootstrap-hardening-and-migrations-as-playbooks" class="hash-link" aria-label="Direct link to Beyond bootstrap: hardening and migrations as playbooks" title="Direct link to Beyond bootstrap: hardening and migrations as playbooks" translate="no">​</a></h2>
<p>The same idempotent model extends to bigger changes, kept as separate, reviewable playbooks:</p>
<ul>
<li class=""><strong><code>cis-kubelet-hardening.yml</code></strong> writes a CIS-benchmarked <code>/var/lib/kubelet/config.yaml</code> (read-only port <code>0</code>, cert rotation, strong TLS cipher suites only, pod PID limits) and wires k3s to load it — then deploys <code>kube-bench</code> to prove it. Result: <strong>16/16 PASS</strong> on the k3s-cis-1.7 kubelet controls, on every worker. Security posture as code, with its own evidence.</li>
<li class=""><strong><code>cilium-migration.yml</code></strong> performed the rolling Flannel→Cilium eBPF CNI swap on a live cluster.</li>
<li class=""><strong><code>fix-grub-timeout.yml</code></strong> is the kind of small, real fix that becomes a repeatable playbook instead of a forgotten SSH session.</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-discipline-that-makes-it-trustworthy-changed0">The discipline that makes it trustworthy: <code>changed=0</code><a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#the-discipline-that-makes-it-trustworthy-changed0" class="hash-link" aria-label="Direct link to the-discipline-that-makes-it-trustworthy-changed0" title="Direct link to the-discipline-that-makes-it-trustworthy-changed0" translate="no">​</a></h2>
<p>None of this matters if the code doesn't match reality. The workflow that keeps them honest is a <strong>drift audit</strong> — a check-mode run that changes nothing and reports what <em>would</em> change:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ansible-playbook playbooks/site.yml --check --diff</span><br></div></code></pre></div></div>
<p>Read the <code>PLAY RECAP</code>. If every host reports <code>changed=0</code>, the codified state <strong>is</strong> reality. If a host reports <code>changed &gt; 0</code>, that's drift — either a role that no longer matches the node, or a node that someone touched by hand. Either way you investigate the diff <em>before</em> applying. And every role must report <code>changed=0</code> on a second consecutive run — the definition of idempotency, and the bar for a role being "done."</p>
<p>For a regulated context (the ktayl-solution IS simulates a French insurer, with DORA in scope), that property is worth as much as the automation itself: at any moment I can <em>prove</em>, non-destructively, that the fleet's OS layer matches version-controlled, reviewed intent — and reconstruct any node from it.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-small-repo-matters-to-the-organisation">Why this small repo matters to the organisation<a href="https://docs.devandre.sbs/blog/ansible-bare-metal-node-bootstrap#why-this-small-repo-matters-to-the-organisation" class="hash-link" aria-label="Direct link to Why this small repo matters to the organisation" title="Direct link to Why this small repo matters to the organisation" translate="no">​</a></h2>
<p>It's tempting to see 200 lines of Ansible next to 95 GitOps applications and call it an afterthought. It isn't. It's the <strong>floor</strong> the whole platform stands on:</p>
<ul>
<li class=""><strong>Reproducibility.</strong> A reimaged or brand-new node becomes a correct cluster member with one <code>site.yml</code> run — no tribal knowledge, no per-node snowflakes (the <code>loving-gannet</code> lesson, made permanent).</li>
<li class=""><strong>Safety.</strong> The Harbor-with-fallback mirror and the drain-first upgrade both fail <em>open</em>, so routine operations can't cascade into outages.</li>
<li class=""><strong>Auditability.</strong> <code>--check --diff</code> turns "the servers are configured correctly" from a claim into a verifiable, repeatable fact.</li>
<li class=""><strong>A clean scope boundary.</strong> MAAS provisions metal, Ansible makes the OS correct, GitOps runs the cluster. Each tool does the job it's best at, and the seams are explicit.</li>
</ul>
<p>GitOps gets the spotlight because it runs the applications the business sees. But the applications only run because, underneath them, every node is boringly, provably correct — and that's the job this little repo does for the organisation, every single time a node comes or goes.</p>
<p><em>The repo is public: <a href="https://github.com/KanmegneTabouguie/minicloud-ansible" target="_blank" rel="noopener noreferrer" class=""><code>KanmegneTabouguie/minicloud-ansible</code></a>.</em></p>]]></content:encoded>
            <category>ansible</category>
            <category>bare-metal</category>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>gitops</category>
            <category>longhorn</category>
            <category>harbor</category>
            <category>cis</category>
            <category>automation</category>
            <category>platform-engineering</category>
            <category>idempotency</category>
        </item>
        <item>
            <title><![CDATA[Anatomy of a Cascading Kubernetes Outage: When the First Symptom Is Three Layers From the Cause]]></title>
            <link>https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage</link>
            <guid>https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage</guid>
            <pubDate>Sun, 23 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A disk filled up. Then cluster DNS died. Then storage volumes refused to rebuild. The obvious cause was a symptom — the real culprit was a bloated SQLite write-ahead log starving the storage layer. Here is the full debugging trail, the fix, and the prevention that shipped afterward.]]></description>
            <content:encoded><![CDATA[<p>A monitoring alert fired: the platform watchdog was <code>DOWN</code>. Within minutes the picture looked ugly — cluster DNS was refusing connections, and shortly after, distributed-storage volumes stopped rebuilding. A textbook cascade.</p>
<p>This is the full post-mortem: how the outage propagated, why the <em>obvious</em> cause turned out to be a symptom three layers from the root, the fix, and — more importantly — the prevention that shipped so it can't recur the same way. Every change referenced here is a public, reviewable pull request.</p>
<p>The platform in question — <strong>minicloud</strong> — is a production-grade Kubernetes environment running on refurbished ThinkPads, built and operated solo as a simulation of an enterprise information system. Bare metal, no managed control plane, no safety net. Which is exactly why it's a good teacher.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-cascade-top-to-bottom">The cascade, top to bottom<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#the-cascade-top-to-bottom" class="hash-link" aria-label="Direct link to The cascade, top to bottom" title="Direct link to The cascade, top to bottom" translate="no">​</a></h2>
<p>The alert said "DNS down." Chasing that first would have been a waste of an hour. Here is what was actually happening, from symptom down to root:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">watchdog DOWN (the alert)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  └─ cluster DNS refusing connections</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">       └─ the controller's DNS service (bind9) had crashed</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            └─ its database (MAAS-bundled PostgreSQL) had crashed</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                 └─ the controller's root disk had hit 100% full</span><br></div></code></pre></div></div>
<p>The disk had filled because a backup group kept rebuilding two large, re-creatable volumes (a container registry cache and an analytics store) that should have been excluded — the exclusion existed in code, but a stale label on the live objects kept them in the backup set. Classic drift between "what git says" and "what's actually running."</p>
<p>So the <em>first</em> fix was mundane: reclaim the disk (delete the orphaned backup data through the object store's own API, since a 100%-full disk blocks most other approaches), then restart the DNS service. DNS came back. Alert cleared.</p>
<p>If that were the whole story, it wouldn't be worth writing about.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-second-deeper-failure-storage-that-wouldnt-heal">The second, deeper failure: storage that wouldn't heal<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#the-second-deeper-failure-storage-that-wouldnt-heal" class="hash-link" aria-label="Direct link to The second, deeper failure: storage that wouldn't heal" title="Direct link to The second, deeper failure: storage that wouldn't heal" translate="no">​</a></h2>
<p>With the cluster reachable again, the storage layer (Longhorn) was a mess — roughly twenty volumes showed <code>degraded</code>, each running on a single replica instead of three. Normally Longhorn just rebuilds the missing replicas. It wasn't.</p>
<p>I'd kick a reconcile, watch a burst of rebuild activity start… and then stall. The rebuilds would begin and give up, repeatedly. No obvious errors. Plenty of free disk and schedulable nodes. The setting that governs rebuild concurrency was correct.</p>
<p>This is the part that matters, because the answer wasn't in the storage layer at all.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="root-cause-a-write-ahead-log-was-starving-the-rebuild-loop">Root cause: a write-ahead log was starving the rebuild loop<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#root-cause-a-write-ahead-log-was-starving-the-rebuild-loop" class="hash-link" aria-label="Direct link to Root cause: a write-ahead log was starving the rebuild loop" title="Direct link to Root cause: a write-ahead log was starving the rebuild loop" translate="no">​</a></h2>
<p>k3s stores cluster state in SQLite (via kine) rather than etcd — common on bare metal. When a cluster is <em>crash-stopped</em> (power cut, hard reboot) instead of shut down cleanly, kine never gets to checkpoint its <strong>write-ahead log (WAL)</strong>. The WAL bloats. On restart, every API read has to replay a huge WAL, and the whole Kubernetes API slows to a crawl.</p>
<p>A slow API has a non-obvious downstream victim: <strong>Longhorn's rebuild controller depends on timely API calls to coordinate replica rebuilds.</strong> When the API is molasses, the rebuild loop kicks off work, can't drive it to completion in time, and backs off. It <em>looks</em> like a storage problem. It's actually a control-plane-datastore problem wearing a storage costume.</p>
<p>The fix was a clean restart of k3s on the control-plane node, which forces kine to checkpoint the WAL:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># WAL size, before → after a clean checkpoint:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">state.db-wal   914 MB  →  111 MB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># API responsiveness, during the incident → after:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl get nodes   &gt;15s (timed out)  →  0.7s</span><br></div></code></pre></div></div>
<p>The moment the API was fast again, the rebuilds flowed and completed. Verified after recovery:</p>
<div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-console codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">$ kubectl get nodes</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">NODE            STATUS   VERSION</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">fast-heron      Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">fast-skunk      Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">loving-gannet   Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">set-hog         Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">star-kitten     Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">swift-mac       Ready    v1.36.3+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">$ # kubectl get nodes latency:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">717ms          # during the incident: timed out (&gt;15s)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">$ # Longhorn volume health:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">robustness: {'healthy': 42, 'unknown': 1}   # 1 = a detached/idle volume, not degraded</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="fixing-the-fix-prevention-not-just-recovery">Fixing the fix: prevention, not just recovery<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#fixing-the-fix-prevention-not-just-recovery" class="hash-link" aria-label="Direct link to Fixing the fix: prevention, not just recovery" title="Direct link to Fixing the fix: prevention, not just recovery" translate="no">​</a></h2>
<p>Recovering an outage is table stakes. The real work is making sure the same class of failure can't recur silently. Three things shipped:</p>
<p><strong>1. Never crash-stop the cluster again.</strong> The entire WAL-bloat problem exists only because the cluster was hard-stopped. So I wrote a graceful shutdown script that cordons workers, stops the agents, and cleanly stops k3s on the control-plane node — which <em>checkpoints the WAL as part of a clean stop</em>. A matching startup script waits for the API and uncordons. Cold starts now come back in minutes with a small WAL, not hours of rebuild storms.</p>
<p><strong>2. Self-healing DNS.</strong> The DNS service can get left disabled after a crash or an automated restart of the provisioning stack. A small systemd guard now re-asserts it on boot and on a short interval, so DNS can't stay down for more than a couple of minutes regardless of what knocked it over. It proved itself the same week — a node reboot brought DNS back with zero intervention.</p>
<p><strong>3. A backup that can't livelock.</strong> The control-plane backup was doing <code>sqlite3 .backup</code>, which uses the online-backup API — and that API <em>restarts the copy whenever the source is written.</em> On a busy, now-larger database, it livelocked and never finished. Switched it to <code>VACUUM INTO</code>, a single-transaction consistent snapshot that also compacts the database: it completes in seconds instead of hanging for ten-plus minutes. The image was also made self-contained so a backup never depends on reaching the internet mid-incident.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-changes-public-reviewable">The changes (public, reviewable)<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#the-changes-public-reviewable" class="hash-link" aria-label="Direct link to The changes (public, reviewable)" title="Direct link to The changes (public, reviewable)" translate="no">​</a></h2>
<p>Everything above landed as pull requests on the GitOps repository — timestamped, CI-checked, reviewable:</p>
<table><thead><tr><th>PR</th><th>What</th></tr></thead><tbody><tr><td><strong>#765</strong></td><td>Storage labeler actively strips the stale backup label (the drift that filled the disk)</td></tr><tr><td><strong>#766</strong></td><td>Control-plane backup: self-contained image + <code>VACUUM INTO</code> (no livelock, no internet dependency)</td></tr><tr><td><strong>#767</strong></td><td>Admission-policy exemption hygiene (a stale security finding, correctly re-scoped to the real subject)</td></tr><tr><td><strong>#768</strong></td><td>Network micro-segmentation for the AI-agent and workflow namespaces (default-deny egress, internet blocked, cluster-internal allowed)</td></tr><tr><td><strong>#770</strong></td><td>GitOps drift fix: ignore an operator-managed status field on a CRD (so <em>real</em> drift stands out)</td></tr><tr><td><strong>#771</strong></td><td>Removed a stale manifest for a deleted namespace that was silently failing every sync of that app</td></tr></tbody></table>
<p>A representative verification, post-change — the AI-agent namespace can reach its internal LLM gateway but is blocked from the public internet, and the hardened admission policies report zero violations:</p>
<div class="language-console codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-console codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">$ # egress enforcement from an AI-agent pod:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">internal LiteLLM   : reachable</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">public internet    : BLOCKED</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">$ # Gatekeeper policy violations after remediation:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">no-privileged-containers: totalViolations=0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">block-net-raw:            totalViolations=0</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-id-underline-for-anyone-operating-bare-metal-kubernetes">What I'd underline for anyone operating bare-metal Kubernetes<a href="https://docs.devandre.sbs/blog/debugging-cascading-kubernetes-outage#what-id-underline-for-anyone-operating-bare-metal-kubernetes" class="hash-link" aria-label="Direct link to What I'd underline for anyone operating bare-metal Kubernetes" title="Direct link to What I'd underline for anyone operating bare-metal Kubernetes" translate="no">​</a></h2>
<ul>
<li class=""><strong>The first symptom is almost never the root cause.</strong> "DNS is down" was four layers up from "the disk filled because of config drift." Chase the chain, not the top of it.</li>
<li class=""><strong>A slow control-plane API has blast radius you won't predict.</strong> It didn't just make <code>kubectl</code> sluggish — it silently broke self-healing storage. When something <em>should</em> be recovering and isn't, check whether the control plane can keep up.</li>
<li class=""><strong>Clean shutdown is a feature, not a nicety.</strong> On SQLite-backed k3s, a graceful stop that checkpoints the WAL is the difference between a two-minute reboot and a two-hour rebuild storm. It's free. Write the script.</li>
<li class=""><strong>Fix the recurrence, not just the incident.</strong> The outage was ~fixed in the first hour. The next four hours — the prevention scripts, the backup rewrite, the drift fixes — are what actually made the platform more reliable than it was before it broke.</li>
</ul>
<p>Same week, on the now-healthy cluster, I also added a sixth node end-to-end via bare-metal PXE provisioning (network-boot → hardware inventory → OS install → cluster join), which is why the <code>kubectl get nodes</code> output above shows six. Growth and hardening in the same stretch — which is roughly the point of running your own platform: every failure is a curriculum.</p>
<hr>
<p><em>minicloud is a solo-built, production-grade Kubernetes platform on refurbished hardware, delivered entirely through GitOps. If you operate bare-metal or edge Kubernetes and hit something similar, I'd genuinely like to compare notes.</em></p>]]></content:encoded>
            <category>kubernetes</category>
            <category>sre</category>
            <category>incident-response</category>
            <category>post-mortem</category>
            <category>k3s</category>
            <category>longhorn</category>
            <category>gitops</category>
            <category>argocd</category>
            <category>cilium</category>
            <category>reliability</category>
            <category>storage</category>
            <category>dns</category>
        </item>
        <item>
            <title><![CDATA[One Registry to Rule Them All: Harbor as the Single Image Entry Point for a Bare-Metal k3s Cluster]]></title>
            <link>https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache</link>
            <guid>https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache</guid>
            <pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How a self-hosted Harbor instance, configured as a pull-through proxy for docker.io, ghcr.io, quay.io, and registry.k8s.io, becomes the single entry point for all image traffic on a bare-metal k3s cluster — eliminating Docker Hub rate limits, centralizing vulnerability scanning, and keeping air-gap capability without any code changes in your manifests.]]></description>
            <content:encoded><![CDATA[<p>If you run a Kubernetes cluster seriously, you eventually hit the Docker Hub wall. One morning your CI pipeline starts failing with <code>toomanyrequests: You have reached your pull rate limit</code>. Or worse — it fails during a cluster recovery at 2 AM, when your nodes are pulling images to restart critical workloads and Docker Hub decides you've exceeded your 100-pulls-per-6-hours anonymous quota.</p>
<p>The standard advice is to add authentication. But that only raises the limit — it doesn't eliminate the dependency on an external service during your most vulnerable moments. The production answer is a pull-through proxy cache, and on a self-hosted k3s cluster, Harbor + k3s mirrors makes every node behave as if Docker Hub were local.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-full-picture-five-registries-one-entry-point">The Full Picture: Five Registries, One Entry Point<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#the-full-picture-five-registries-one-entry-point" class="hash-link" aria-label="Direct link to The Full Picture: Five Registries, One Entry Point" title="Direct link to The Full Picture: Five Registries, One Entry Point" translate="no">​</a></h2>
<p>On the minicloud platform — a 5-node bare-metal k3s cluster running 70+ workloads — image traffic involves five distinct registries:</p>
<table><thead><tr><th>Registry</th><th>Type</th><th>What it serves</th></tr></thead><tbody><tr><td><code>harbor.10.0.0.200.nip.io</code></td><td>Self-hosted (Harbor 2.14)</td><td><strong>Everything</strong> — CI-built images + proxy cache for all public registries</td></tr><tr><td><code>docker.io</code></td><td>Upstream public</td><td>Default Docker Hub — nginx, postgres, redis, alpine, ubuntu...</td></tr><tr><td><code>ghcr.io</code></td><td>Upstream public</td><td>GitHub Container Registry — Authentik, Longhorn, Velero, most CNCF tooling</td></tr><tr><td><code>quay.io</code></td><td>Upstream public</td><td>Red Hat quay — Prometheus, AlertManager, Grafana, OPA</td></tr><tr><td><code>registry.k8s.io</code></td><td>Upstream public</td><td>Kubernetes project images — pause, kube-proxy, CoreDNS, metrics-server</td></tr></tbody></table>
<p>But "five registries" is only true from the perspective of pull origin. From the perspective of every node in the cluster, there is exactly <strong>one</strong> registry: Harbor.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-k3s-makes-harbor-transparent">How k3s Makes Harbor Transparent<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#how-k3s-makes-harbor-transparent" class="hash-link" aria-label="Direct link to How k3s Makes Harbor Transparent" title="Direct link to How k3s Makes Harbor Transparent" translate="no">​</a></h2>
<p>The key is <code>registries.yaml</code> — a containerd mirror configuration file that k3s reads on startup. It tells the container runtime: "when a pod asks for an image from X, try Y first, fall back to X."</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># /etc/rancher/k3s/registries.yaml (on every k3s node)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">mirrors</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"docker.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io/v2/docker-hub"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://registry-1.docker.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"ghcr.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io/v2/ghcr"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://ghcr.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"quay.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io/v2/quay"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://quay.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"registry.k8s.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io/v2/k8s-registry"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://registry.k8s.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"harbor.10.0.0.200.nip.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">endpoint</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://harbor.10.0.0.200.nip.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">configs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">"harbor.10.0.0.200.nip.io"</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">tls</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">ca_file</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /etc/rancher/k3s/minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca.crt</span><br></div></code></pre></div></div>
<p>When a pod spec says <code>image: nginx:alpine</code>, containerd does not contact <code>docker.io</code>. It tries <code>harbor.10.0.0.200.nip.io/v2/docker-hub</code> first. If Harbor has the image cached, it returns it immediately. If not, Harbor fetches it from <code>registry-1.docker.io</code>, caches it, and serves it — the node only ever communicates with Harbor.</p>
<p>The fallback endpoint (<code>"https://registry-1.docker.io"</code>) is there as a resilience mechanism: if Harbor itself is down, containerd can still pull directly. In practice this fallback fires only during Harbor restarts or maintenance windows.</p>
<p><strong>Nothing in your Kubernetes manifests changes.</strong> A Deployment that says <code>image: ghcr.io/goauthentik/server:2024.12.0</code> keeps saying exactly that. The mirror intercepts the pull at the containerd level, before any manifest parsing.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="harbor-proxy-cache-projects">Harbor Proxy Cache Projects<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#harbor-proxy-cache-projects" class="hash-link" aria-label="Direct link to Harbor Proxy Cache Projects" title="Direct link to Harbor Proxy Cache Projects" translate="no">​</a></h2>
<p>On the Harbor side, each upstream registry becomes a <strong>proxy cache project</strong>. A proxy cache project has no images stored in git or pushed by anyone — it is purely a pull-through cache. When Harbor receives a request for <code>docker-hub/nginx:alpine</code>, it:</p>
<ol>
<li class="">Checks its local storage for <code>nginx:alpine</code> (same digest as Docker Hub's)</li>
<li class="">If found and the manifest hasn't expired: serves from local storage</li>
<li class="">If not found: pulls from the configured upstream registry, stores it, serves it</li>
</ol>
<p>The four proxy cache projects on minicloud:</p>
<table><thead><tr><th>Harbor project name</th><th>Upstream registry</th><th>Registry type in Harbor</th></tr></thead><tbody><tr><td><code>docker-hub</code></td><td><code>https://registry-1.docker.io</code></td><td>Docker Hub</td></tr><tr><td><code>ghcr</code></td><td><code>https://ghcr.io</code></td><td>Docker Registry (OCI-compatible)</td></tr><tr><td><code>quay</code></td><td><code>https://quay.io</code></td><td>Docker Registry (OCI-compatible)</td></tr><tr><td><code>k8s-registry</code></td><td><code>https://registry.k8s.io</code></td><td>Docker Registry (OCI-compatible)</td></tr></tbody></table>
<p>The project name in Harbor <strong>must exactly match</strong> the path segment in <code>registries.yaml</code>. The mirror endpoint <code>harbor.10.0.0.200.nip.io/v2/docker-hub</code> routes to the Harbor project named <code>docker-hub</code>. If you create the project as <code>proxy-docker</code> but the mirror path says <code>docker-hub</code>, every pull misses cache and goes to the fallback — you get no rate limit protection and no vulnerability scanning.</p>
<p>One gotcha worth documenting: Harbor lists <code>quay</code> as a supported registry type, but when you try to create a proxy cache project against a <code>quay</code>-type registry, the API returns <code>400: unsupported registry type quay</code>. The fix is to register the Quay upstream as <code>docker-registry</code> (generic OCI) instead of <code>quay</code> — Quay's V2 API is fully OCI-compatible and Harbor's generic OCI proxy works correctly against it.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-matters-beyond-rate-limits">Why This Matters Beyond Rate Limits<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#why-this-matters-beyond-rate-limits" class="hash-link" aria-label="Direct link to Why This Matters Beyond Rate Limits" title="Direct link to Why This Matters Beyond Rate Limits" translate="no">​</a></h2>
<p>Docker Hub rate limits are the obvious motivation, but the architecture delivers several other properties that matter in production:</p>
<p><strong>Vulnerability scanning at the chokepoint.</strong> Harbor runs Trivy. Every image that passes through the proxy cache is scanned. If you enable "Prevent vulnerable images" at project level, no image with a Critical CVE can be pulled into the cluster — even if it is a publicly published upstream image that a manifest references directly. The Kubernetes scheduler sees a 403 from Harbor and the pod stays Pending instead of running vulnerable code.</p>
<p><strong>Reproducibility under network partition.</strong> A bare-metal cluster in a home lab or office does not have enterprise internet SLAs. If your cluster can survive a 4-hour internet outage, it is because every image your workloads need is already in Harbor's cache from the last pull. During a power failure recovery on minicloud — where all 5 nodes restart simultaneously and try to pull images at once — Harbor serves everything from local storage. No image pull failures, no pods stuck in <code>ImagePullBackOff</code>.</p>
<p><strong>Audit trail for all image pulls.</strong> Harbor logs every pull request: which image, which tag, which digest, at what time, authenticated as which user or service account. On a cluster with 70 running workloads, knowing that <code>set-hog</code> pulled <code>quay.io/prometheus/prometheus:v2.54.0</code> at 03:47 on 2026-08-02 is occasionally useful for incident investigation.</p>
<p><strong>Supply chain integrity for CI-built images.</strong> The fifth entry in the <code>registries.yaml</code> mirror list — <code>harbor.10.0.0.200.nip.io</code> pointing to itself — ensures that CI-built images (your own services, custom Backstage image, custom Open WebUI) are also served through Harbor with no special treatment. cosign signatures are stored as Harbor artifacts alongside the image. Trivy scans your own images with the same policy as upstream images. The entire fleet's image provenance flows through one system.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-pull-flow-step-by-step">The Pull Flow, Step by Step<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#the-pull-flow-step-by-step" class="hash-link" aria-label="Direct link to The Pull Flow, Step by Step" title="Direct link to The Pull Flow, Step by Step" translate="no">​</a></h2>
<p>Here is exactly what happens when k3s schedules <code>harbor-core</code> onto a node after a fresh Harbor database wipe (which requires Harbor to re-pull its own images):</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">1. Scheduler assigns pod to node fast-skunk</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">2. kubelet asks containerd: pull goharbor/harbor-core:v2.14.0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">3. containerd checks registries.yaml: "docker.io" → mirror harbor.10.0.0.200.nip.io/v2/docker-hub</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">4. containerd sends: GET harbor.10.0.0.200.nip.io/v2/docker-hub/goharbor/harbor-core/manifests/v2.14.0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">5. Harbor: checks docker-hub project cache → cache miss (fresh DB)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">6. Harbor: authenticates to registry-1.docker.io (with stored credentials if configured)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">7. Harbor: pulls manifest + layers from Docker Hub</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">8. Harbor: stores layers in harbor-registry PVC (20Gi Longhorn)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">9. Harbor: returns manifest to containerd</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">10. containerd: pulls layers from Harbor (same request, now cache hit)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">11. Node: image unpacked, pod starts</span><br></div></code></pre></div></div>
<p>On subsequent pulls of the same image (same digest), step 6–8 are skipped entirely. Harbor answers from its own storage. Docker Hub is never contacted.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-breaks-when-harbor-goes-down">What Breaks When Harbor Goes Down<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#what-breaks-when-harbor-goes-down" class="hash-link" aria-label="Direct link to What Breaks When Harbor Goes Down" title="Direct link to What Breaks When Harbor Goes Down" translate="no">​</a></h2>
<p>This architecture creates a single point of failure: if Harbor is down and an image is not already on the node, the pod cannot start. The fallback endpoints in <code>registries.yaml</code> mitigate this, but they expose you to rate limits again and require outbound internet access that may not always be available.</p>
<p>The operational answer is to treat Harbor with the same reliability posture as your ingress controller or DNS: keep it on a stable node (<code>fast-skunk</code>, pinned via nodeSelector), use Longhorn with 3 replicas for its PVCs, and alert on Harbor pod restarts. During planned Harbor maintenance, pre-pull any images you know will be needed.</p>
<p>On minicloud, this played out once when harbor-database's Longhorn PVC faulted and Harbor was unavailable for ~40 minutes. During that window, nodes that already had images cached locally were unaffected. Pods that needed image pulls were stuck in <code>ImagePullBackOff</code> — they fell back to Docker Hub and hit rate limits because the anonymous pull quota was already consumed from earlier in the day. The lesson: a pull-through cache is not the same as a local registry. Containerd does not pre-populate nodes; it only caches after the first pull. For critical workloads, <code>imagePullPolicy: IfNotPresent</code> with pre-pulled images on each node is the only true offline guarantee.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="configuration-reference">Configuration Reference<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#configuration-reference" class="hash-link" aria-label="Direct link to Configuration Reference" title="Direct link to Configuration Reference" translate="no">​</a></h2>
<p><strong>Creating a proxy cache registry in Harbor (API):</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">HARBOR_PASS=$(ssh controller "cat ~/.harbor-admin")</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Register the upstream (example: ghcr.io)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -sk --cacert ~/minicloud-ca.crt \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -u "admin:${HARBOR_PASS}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -X POST "https://harbor.10.0.0.200.nip.io/api/v2.0/registries" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H 'Content-Type: application/json' \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "name": "ghcr-upstream",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "type": "docker-registry",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "url": "https://ghcr.io",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "insecure": false</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  }'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Get the registry ID from the response, then create the proxy project</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -sk --cacert ~/minicloud-ca.crt \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -u "admin:${HARBOR_PASS}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -X POST "https://harbor.10.0.0.200.nip.io/api/v2.0/projects" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H 'Content-Type: application/json' \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "project_name": "ghcr",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "registry_id": &lt;ID_FROM_ABOVE&gt;,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "public": true</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  }'</span><br></div></code></pre></div></div>
<p><strong>Verifying the mirror is working:</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># On any node, watch containerd pull through Harbor:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "journalctl -u k3s -f | grep 'pulling from'"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Or check Harbor's pull count via API:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -sk --cacert ~/minicloud-ca.crt \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -u "admin:${HARBOR_PASS}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  "https://harbor.10.0.0.200.nip.io/api/v2.0/projects/ghcr" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | python3 -c "import sys,json; p=json.load(sys.stdin); print('pulls:', p['metadata'].get('pull_count', 0))"</span><br></div></code></pre></div></div>
<p><strong>Critical: project names must match mirror paths.</strong> The mirror config <code>harbor.10.0.0.200.nip.io/v2/docker-hub</code> requires a Harbor project named exactly <code>docker-hub</code>. The <code>/v2/</code> prefix and the project name form the containerd pull URL.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://docs.devandre.sbs/blog/container-registry-architecture-harbor-k3s-proxy-cache#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<p>The minicloud registry architecture is deliberately simple: one Harbor instance, four proxy cache projects, one <code>registries.yaml</code> on every node. No image pull authentication secrets in namespaces. No special handling in Helm values or Kustomize overlays. Every node pulls every image from Harbor, Harbor fetches from upstream when needed, and Docker Hub rate limits are a problem that no longer exists in day-to-day operations.</p>
<p>The more interesting property is the supply chain consolidation: every image, whether it was built by CI and pushed to <code>library/my-service</code>, or pulled through the cache from <code>ghcr.io/someproject/tool</code>, passes through the same Harbor instance, gets scanned by the same Trivy policy, and appears in the same audit log. For a platform that runs insurance workloads where image provenance matters for regulatory compliance, that single chokepoint is worth more than the Docker Hub rate limit fix.</p>]]></content:encoded>
            <category>harbor</category>
            <category>kubernetes</category>
            <category>docker</category>
            <category>registry</category>
            <category>k3s</category>
            <category>self-hosted</category>
            <category>devops</category>
            <category>supply-chain</category>
            <category>rate-limiting</category>
            <category>containerd</category>
        </item>
        <item>
            <title><![CDATA[Every Non-Human Identity on a Self-Hosted k8s Platform: A Complete Taxonomy]]></title>
            <link>https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform</link>
            <guid>https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform</guid>
            <pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Service accounts, robot accounts, break-glass tokens, OAuth2 client credentials, API keys — a self-hosted Kubernetes platform uses all of them. Here is how they differ, why each one exists, and what happens when you lose track of one.]]></description>
            <content:encoded><![CDATA[<p>When you build a production Kubernetes platform from scratch, you accumulate non-human identities faster than you expect. By the time the minicloud platform reached operational maturity — a 5-node bare-metal k3s cluster running 70+ workloads — it had more than 35 distinct non-human identities spanning six different categories. Most of them are invisible during normal operations. You only notice them when one breaks.</p>
<p>This post maps every non-human identity type in use on the platform, explains how they differ, and documents the operational lessons learned from the ones that caused incidents.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-six-identity-types">The Six Identity Types<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#the-six-identity-types" class="hash-link" aria-label="Direct link to The Six Identity Types" title="Direct link to The Six Identity Types" translate="no">​</a></h2>
<p>Not all non-human identities are created equal. They differ in who creates them, how they authenticate, how long they live, and what happens when they go wrong.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-kubernetes-service-accounts">1. Kubernetes Service Accounts<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#1-kubernetes-service-accounts" class="hash-link" aria-label="Direct link to 1. Kubernetes Service Accounts" title="Direct link to 1. Kubernetes Service Accounts" translate="no">​</a></h3>
<p>The cleanest identity type in the stack. A <code>ServiceAccount</code> object in a namespace gives a pod a JWT token, mounted automatically at <code>/var/run/secrets/kubernetes.io/serviceaccount/token</code>. The kubelet rotates this token regularly. When the pod is deleted, the token is gone.</p>
<p>Service accounts are the right choice whenever a workload needs to call the Kubernetes API or any system that supports Kubernetes-native authentication (like Vault with the <code>kubernetes</code> auth method).</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># cert-manager authenticates to Vault PKI using its ServiceAccount JWT</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterIssuer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">vault</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">auth</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">kubernetes</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">role</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">serviceAccountRef</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div></code></pre></div></div>
<p>The token is short-lived, automatically rotated, and bound to the pod's identity. No credential management required.</p>
<p><strong>Minicloud service accounts in use:</strong></p>
<table><thead><tr><th>SA</th><th>Namespace</th><th>Authenticates to</th></tr></thead><tbody><tr><td><code>cert-manager</code></td><td>cert-manager</td><td>Vault PKI engine</td></tr><tr><td><code>external-secrets</code></td><td>external-secrets</td><td>Vault (reads all <code>secret/platform/*</code>)</td></tr><tr><td><code>argocd-application-controller</code></td><td>argocd</td><td>k8s API (cluster-admin)</td></tr><tr><td><code>velero</code></td><td>velero</td><td>k8s API + object storage</td></tr><tr><td><code>backstage</code></td><td>backstage</td><td>k8s API (catalog discovery)</td></tr><tr><td><code>minicloud-agent</code></td><td>ai</td><td>k8s API + LiteLLM</td></tr><tr><td><code>longhorn-pvc-labeler</code></td><td>longhorn-system</td><td>k8s API (patches Longhorn volumes)</td></tr><tr><td><code>node-problem-detector</code></td><td>node-problem-detector</td><td>k8s API (patches node conditions)</td></tr></tbody></table>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-robot--technical-accounts">2. Robot / Technical Accounts<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#2-robot--technical-accounts" class="hash-link" aria-label="Direct link to 2. Robot / Technical Accounts" title="Direct link to 2. Robot / Technical Accounts" translate="no">​</a></h3>
<p>A robot account is a human-shaped identity that belongs to a machine. Harbor's terminology; other systems call it a "service user," "system account," or "bot account." It authenticates exactly like a human user — username and password or API token — but the credential is owned by an automated system.</p>
<p>The defining characteristic: <strong>the credential lives somewhere external to the system that issued it</strong>. After you create a Harbor robot account, you copy the one-time-display token to Vault and to your CI secrets. The token and the account then live independent lives. If the account's database is wiped, the token in Vault is now pointing at nothing.</p>
<p>This is exactly what happened with <code>robot$ci</code> in late July 2026. A Longhorn PVC failure forced a Harbor database wipe and rebuild. The old <code>robot$ci</code> account was re-created with the same name, but the token was new — and the GitHub org secrets still held the old one. CI image pushes failed silently for weeks before the mismatch was noticed.</p>
<p><strong>The fix:</strong> store the token in Vault (<code>secret/platform/harbor</code> key <code>robot-ci-secret</code>) immediately after creation. When rebuilding Harbor, check Vault first, then update GitHub secrets.</p>
<p><strong>Minicloud robot/technical accounts:</strong></p>
<table><thead><tr><th>Account</th><th>System</th><th>Token location</th></tr></thead><tbody><tr><td><code>robot$ci</code></td><td>Harbor</td><td>Vault <code>secret/platform/harbor</code> + GitHub org secrets</td></tr><tr><td><code>admin</code></td><td>MinIO (Docker)</td><td>Vault <code>secret/platform/minio</code></td></tr><tr><td><code>ktayl</code></td><td>MAAS</td><td>Controller-local only (low risk — MAAS is controller-only)</td></tr></tbody></table>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-break-glass-accounts">3. Break-Glass Accounts<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#3-break-glass-accounts" class="hash-link" aria-label="Direct link to 3. Break-Glass Accounts" title="Direct link to 3. Break-Glass Accounts" translate="no">​</a></h3>
<p>A break-glass account is an emergency exit. It should be sealed, documented, and used only when the normal authentication path (OIDC/SSO) is unavailable.</p>
<p>On the minicloud platform, Authentik provides SSO for ArgoCD, Grafana, Harbor, Backstage, Plane, ERPNext, and more. If Authentik goes down — pod crash, database corruption, Longhorn volume fault — every one of those UIs becomes inaccessible to human operators. Break-glass accounts are the offline path.</p>
<p><strong>Minicloud break-glass accounts:</strong></p>
<table><thead><tr><th>Account</th><th>System</th><th>Normal login path</th><th>Emergency credential</th></tr></thead><tbody><tr><td><code>admin</code></td><td>ArgoCD</td><td>Authentik OIDC → <code>kanmegnea</code></td><td>Vault <code>secret/platform/break-glass</code> key <code>argocd</code></td></tr><tr><td><code>admin</code></td><td>Grafana</td><td>Authentik OIDC → <code>kanmegnea</code></td><td>Vault <code>secret/platform/break-glass</code> key <code>grafana</code></td></tr><tr><td><code>admin</code></td><td>Harbor</td><td>Authentik OIDC → <code>kanmegnea</code></td><td>Vault <code>secret/platform/break-glass</code> key <code>harbor</code></td></tr><tr><td><code>minicloud-break-glass</code></td><td>k3s API</td><td>OIDC kubeconfig <code>minicloud-oidc</code></td><td>Static cert kubeconfig context</td></tr></tbody></table>
<p>The operational discipline for break-glass accounts:</p>
<ol>
<li class=""><strong>Create them once</strong> and write credentials to Vault immediately</li>
<li class=""><strong>Re-disable after use</strong> (ArgoCD local admin requires <code>accounts.admin: enabled: false</code> in <code>argocd-cm</code>)</li>
<li class=""><strong>Test them periodically</strong> — a break-glass account that has never been tested may not work when you need it most</li>
</ol>
<p>Before this session, the break-glass passwords existed only as files on the controller filesystem (<code>~/.argocd-admin</code>, <code>~/.grafana-admin</code>, <code>~/.harbor-admin</code>). If the controller X390 ThinkPad's disk failed, those credentials would be unrecoverable. They now live in Vault at <code>secret/platform/break-glass</code>.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-oauth2-client-credentials-oidc-providers">4. OAuth2 Client Credentials (OIDC Providers)<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#4-oauth2-client-credentials-oidc-providers" class="hash-link" aria-label="Direct link to 4. OAuth2 Client Credentials (OIDC Providers)" title="Direct link to 4. OAuth2 Client Credentials (OIDC Providers)" translate="no">​</a></h3>
<p>Every application that delegates authentication to Authentik holds an OAuth2 client credential pair: <code>client_id</code> + <code>client_secret</code>. Authentik issues these when you create an OAuth2/OIDC provider for an application.</p>
<p>These are not "accounts" — they are credentials that identify an application to the identity provider. The application uses them to exchange an authorization code for an access token.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Browser → ArgoCD → Authentik (presents client_id, receives code)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                 → exchanges code + client_secret for JWT</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                 → user lands on ArgoCD with claims from JWT</span><br></div></code></pre></div></div>
<p><strong>Minicloud OIDC providers (one per application):</strong></p>
<table><thead><tr><th>Application</th><th>Authentik provider slug</th><th>client_secret location</th></tr></thead><tbody><tr><td>ArgoCD</td><td><code>argocd</code></td><td>k8s secret <code>argocd-secret</code></td></tr><tr><td>Harbor</td><td><code>harbor</code></td><td>k8s secret + Vault <code>secret/platform/harbor</code></td></tr><tr><td>Grafana</td><td><code>grafana</code></td><td>k8s secret <code>grafana-oidc</code></td></tr><tr><td>Backstage</td><td><code>backstage</code></td><td>k8s secret</td></tr><tr><td>Plane CE</td><td><code>plane</code></td><td>k8s secret</td></tr><tr><td>ERPNext</td><td><code>frappe</code></td><td>k8s secret</td></tr><tr><td>Open WebUI</td><td><code>open-webui</code></td><td>k8s secret</td></tr><tr><td>Vaultwarden</td><td><code>vaultwarden</code></td><td>k8s secret (Timshel fork required for SSO)</td></tr><tr><td>Matrix/Element</td><td><code>synapse</code></td><td>Synapse config</td></tr></tbody></table>
<p>The risk profile of OAuth2 client credentials is lower than robot accounts — they can only initiate authentication flows, not directly access data. If a <code>client_secret</code> leaks, an attacker can impersonate the application to Authentik, but still cannot bypass the user's authentication step.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-external-service-api-keys">5. External Service API Keys<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#5-external-service-api-keys" class="hash-link" aria-label="Direct link to 5. External Service API Keys" title="Direct link to 5. External Service API Keys" translate="no">​</a></h3>
<p>Long-lived tokens issued by third-party services that don't support Kubernetes-native auth. These are the credentials for Cloudflare, AWS SES, Tailscale, GitHub, and monitoring services.</p>
<p>All of them live in Vault under <code>secret/platform/&lt;service&gt;</code> and are pulled into the cluster via External Secrets Operator at runtime. Pods never see the raw token — they see the k8s Secret that ESO populated.</p>
<p><strong>Minicloud external API keys:</strong></p>
<table><thead><tr><th>Service</th><th>Vault path</th><th>Used by</th></tr></thead><tbody><tr><td>Cloudflare API (<code>MINICLOUD</code> token)</td><td><code>secret/platform/cloudflare</code> key <code>api-token</code></td><td>cloudflared tunnel + cert-manager DNS01</td></tr><tr><td>Cloudflare R2 access key + secret</td><td><code>secret/platform/cloudflare</code> keys <code>r2-*</code></td><td>Velero off-site backup BSL</td></tr><tr><td>Tailscale OAuth</td><td>GitHub org secrets</td><td>CI pipelines (all repos, Tailscale action)</td></tr><tr><td>GitHub <code>GITOPS_TOKEN</code></td><td>GitHub org secrets</td><td>CI → kustomize push, Backstage scaffolder</td></tr><tr><td>AWS SES SMTP</td><td><code>secret/platform/mail</code></td><td>Stalwart mail relay</td></tr><tr><td>Healthchecks.io API key</td><td><code>secret/platform/healthchecks-io</code></td><td>minicloud-ops heartbeat + watchdog alerts</td></tr></tbody></table>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="6-the-vault-root-token">6. The Vault Root Token<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#6-the-vault-root-token" class="hash-link" aria-label="Direct link to 6. The Vault Root Token" title="Direct link to 6. The Vault Root Token" translate="no">​</a></h3>
<p>In a different category from everything else. The Vault root token is not an application identity — it is the master key to the secret store itself. Every other credential in the platform is accessible to whoever holds the root token.</p>
<p>On minicloud, the root token lives at <code>~/.vault-root-token</code> on the controller filesystem (mode 600). It was generated during <code>vault operator init</code> and has never been rotated.</p>
<p>The improvement made in this session: a scoped <code>platform-ops</code> token was created with a read-only policy on <code>secret/platform/*</code> plus PKI sign permissions. This token lives at <code>~/.vault-ops-token</code> and is what automation and day-to-day scripts should use. The root token is reserved for write operations and policy management.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">platform-ops policy:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  secret/data/platform/*    → read, list</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  secret/metadata/platform/* → read, list</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  pki/sign/*                → create, update</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  pki/issue/*               → create, update</span><br></div></code></pre></div></div>
<p>The <code>platform-ops</code> token is a 10-year periodic token, renewable. The root token rotation procedure (revoke + <code>vault operator generate-root</code> with unseal key) is documented but not yet executed — that step requires offline coordination with the unseal key.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-decision-rule">The Decision Rule<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#the-decision-rule" class="hash-link" aria-label="Direct link to The Decision Rule" title="Direct link to The Decision Rule" translate="no">​</a></h2>
<p>When you need a new non-human identity on the platform, the choice follows this hierarchy:</p>
<table><thead><tr><th>Situation</th><th>Identity type</th></tr></thead><tbody><tr><td>Pod needs to call k8s API or Vault</td><td>Kubernetes <code>ServiceAccount</code></td></tr><tr><td>CI pipeline needs to push to a registry</td><td>Robot account (stored in Vault immediately)</td></tr><tr><td>External service with no SA concept</td><td>Technical account with credentials in Vault</td></tr><tr><td>Application delegates login to Authentik</td><td>OAuth2 client credential (OIDC provider)</td></tr><tr><td>Third-party SaaS API (Cloudflare, AWS)</td><td>API key in Vault <code>secret/platform/&lt;service&gt;</code></td></tr><tr><td>Human emergency when SSO is down</td><td>Break-glass account, re-disabled after use</td></tr></tbody></table>
<p>The hierarchy reflects auto-rotation: use the highest-automation option available. Kubernetes SAs rotate automatically. OAuth2 client credentials rotate on Authentik re-issue. API keys and robot accounts are manual — Vault is the mitigation.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-breaks-when-you-lose-track">What Breaks When You Lose Track<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#what-breaks-when-you-lose-track" class="hash-link" aria-label="Direct link to What Breaks When You Lose Track" title="Direct link to What Breaks When You Lose Track" translate="no">​</a></h2>
<p>Three incidents from the minicloud operational history that each map to a different identity type:</p>
<p><strong>Robot account — Harbor <code>robot$ci</code> (2026-08-16):</strong>
Harbor database wiped and rebuilt after Longhorn PVC fault. <code>robot$ci</code> was re-created with the same name but a new token. GitHub org secrets still held the old token. CI image pushes started failing with 401. Fix: recreate the robot account, update GitHub secrets, store new token in Vault. Time to resolution: found during a routine audit of ArgoCD Degraded apps. <strong>Lesson: always store robot tokens in Vault immediately after creation. Never rely on the CI secret alone.</strong></p>
<p><strong>Break-glass account — ArgoCD admin (ongoing until today):</strong>
ArgoCD admin password existed only on the controller filesystem. If the X390's NVMe failed, the only path to ArgoCD during an Authentik outage would be regenerating the bcrypt hash directly in the argocd-cm. That's a 20-minute procedure during what is already an incident. <strong>Lesson: break-glass credentials belong in Vault, not local files.</strong></p>
<p><strong>ESO SecretSyncedError — silent for 5 days (2026-08-11 to 2026-08-16):</strong>
<code>harbor-stable-secrets</code> ExternalSecret failed after a Vault key was deleted during the Harbor DB wipe. ESO logged <code>SecretSyncedError</code> but pods kept running — the k8s Secret already had valid cached data from the last successful sync. The failure was invisible until an audit. <strong>Lesson: ESO health is not visible from pod health. Monitor ExternalSecret <code>.status.conditions</code> separately, not just pod status.</strong></p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="complete-identity-inventory">Complete Identity Inventory<a href="https://docs.devandre.sbs/blog/non-human-identity-management-k8s-platform#complete-identity-inventory" class="hash-link" aria-label="Direct link to Complete Identity Inventory" title="Direct link to Complete Identity Inventory" translate="no">​</a></h2>
<p>For reference, the full minicloud identity count as of 2026-08-16:</p>
<table><thead><tr><th>Type</th><th>Count</th><th>Auto-rotated</th><th>All in Vault</th></tr></thead><tbody><tr><td>Kubernetes Service Accounts</td><td>9</td><td>Yes (kubelet JWT)</td><td>N/A</td></tr><tr><td>Robot / Technical accounts</td><td>3</td><td>No — manual</td><td>Yes (as of this session)</td></tr><tr><td>Break-glass accounts</td><td>4</td><td>No</td><td>Yes (as of this session)</td></tr><tr><td>OAuth2 client credentials</td><td>9</td><td>No</td><td>Partially</td></tr><tr><td>External API keys</td><td>6</td><td>No</td><td>Yes</td></tr><tr><td>Vault root / ops tokens</td><td>2</td><td>No</td><td>N/A (root of trust)</td></tr><tr><td><strong>Total</strong></td><td><strong>33</strong></td><td>—</td><td>—</td></tr></tbody></table>
<p>The goal for a platform at this maturity level: every non-human identity that cannot auto-rotate should have its credential in Vault, with ESO pulling it into the cluster at runtime. The only exceptions are the Vault root token itself (it must be stored outside Vault) and the k8s break-glass kubeconfig (it must be stored outside the cluster).</p>]]></content:encoded>
            <category>security</category>
            <category>iam</category>
            <category>kubernetes</category>
            <category>vault</category>
            <category>service-accounts</category>
            <category>devops</category>
            <category>k3s</category>
            <category>self-hosted</category>
        </item>
        <item>
            <title><![CDATA[Moving Your Kubernetes CA Private Key Into Vault PKI — Without Changing a Single Certificate]]></title>
            <link>https://docs.devandre.sbs/blog/vault-pki-ca-migration</link>
            <guid>https://docs.devandre.sbs/blog/vault-pki-ca-migration</guid>
            <pubDate>Sun, 16 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How we migrated the minicloud root CA private key from a plaintext Kubernetes secret into HashiCorp Vault's PKI engine — importing the same CA so no certificate had to be re-issued, no trust store had to be updated, and no service saw any disruption.]]></description>
            <content:encoded><![CDATA[<p>Every Kubernetes cluster that uses cert-manager for TLS has the same quiet risk buried in it: the CA private key that signs all your internal certificates is sitting in a Kubernetes secret, stored in plaintext in your cluster's datastore.</p>
<p>On managed clusters with etcd encryption at rest, this is adequately mitigated. On k3s with kine and SQLite — which is how many bare-metal clusters run — the secrets table is plaintext. Anyone who can read <code>state.db</code> from the control plane node can extract your CA private key and forge certificates your entire cluster trusts.</p>
<p>This post covers how we migrated the minicloud root CA private key into HashiCorp Vault's PKI secrets engine, with the same CA cert so nothing else needed to change — no re-trust, no downtime, no changes to any of our 43 Certificate resources.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-problem">The Problem<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#the-problem" class="hash-link" aria-label="Direct link to The Problem" title="Direct link to The Problem" translate="no">​</a></h2>
<p>When cert-manager bootstraps a CA-based ClusterIssuer, it expects the CA certificate and private key as a Kubernetes secret:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterIssuer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ca</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">secretName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">root</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca   </span><span class="token comment" style="color:#999988;font-style:italic"># ← CA private key lives here</span><br></div></code></pre></div></div>
<p>The secret in <code>cert-manager/minicloud-root-ca</code> contained three fields: <code>ca.crt</code>, <code>tls.crt</code> (same as the CA cert), and <code>tls.key</code> — the 227-byte EC P-256 private key that signs every TLS certificate on the cluster.</p>
<p>On k3s, that secret lives in a SQLite database on the control plane node:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/var/lib/rancher/k3s/server/db/state.db</span><br></div></code></pre></div></div>
<p>SQLite databases are not encrypted. The kine layer that k3s uses to emulate etcd stores Kubernetes objects as rows in a <code>kine</code> table. The secret value is base64-encoded, not encrypted. Anyone with read access to that file — even just a <code>cat</code> from a privileged process — can extract the CA key:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># What an attacker with disk access can do:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sqlite3 state.db "SELECT value FROM kine WHERE name LIKE '%minicloud-root-ca%'"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → base64-encoded Kubernetes Secret JSON, including tls.key</span><br></div></code></pre></div></div>
<p>With the CA private key, they can issue a certificate for any hostname that your cluster trusts, sign it with the minicloud root CA, and your browser, curl, and every service-to-service connection will accept it without complaint.</p>
<p>The CA certificate itself is public — it is distributed everywhere, trusted in the macOS Keychain, baked into container images. That is fine. The private key is not.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-not-just-enable-k3s-encryption-at-rest">Why Not Just Enable k3s Encryption At Rest?<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#why-not-just-enable-k3s-encryption-at-rest" class="hash-link" aria-label="Direct link to Why Not Just Enable k3s Encryption At Rest?" title="Direct link to Why Not Just Enable k3s Encryption At Rest?" translate="no">​</a></h2>
<p>k3s supports Kubernetes <code>EncryptionConfiguration</code> to encrypt secrets in the SQLite datastore. This is a valid mitigation. But it moves the problem rather than solving it: the encryption key (a KMS key or a local keyfile) is now the sensitive material, and it still has to live somewhere.</p>
<p>Vault PKI solves a different and harder problem. The CA private key <strong>never leaves Vault</strong>. cert-manager does not receive the key. It submits a Certificate Signing Request, Vault signs it and returns only the certificate. The key material is accessed by the signing operation, not transferred.</p>
<p>The exposure surface becomes: anyone who can authenticate to Vault with a valid token and the <code>cert-manager</code> policy. That is a much smaller and more auditable set than "anyone who can read the SQLite file."</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="architecture-after-migration">Architecture After Migration<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#architecture-after-migration" class="hash-link" aria-label="Direct link to Architecture After Migration" title="Direct link to Architecture After Migration" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">cert-manager controller</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │ 1. creates CSR</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Vault Kubernetes auth</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │ 2. SA token → 1h Vault token</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Vault PKI engine (pki/)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │ 3. signs CSR with CA key (key never leaves Vault)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │ 4. returns signed certificate</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">cert-manager controller</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        │ 5. stores cert in k8s Secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Ingress (Traefik) → TLS terminated with that cert</span><br></div></code></pre></div></div>
<p>The cert-manager pod authenticates to Vault using its own Kubernetes service account token. Vault's Kubernetes auth backend validates the token against the cluster API server, then issues a short-lived (1h) Vault token scoped to the <code>cert-manager</code> policy. That policy allows only <code>pki/sign/cert-manager</code> and <code>pki/issue/cert-manager</code> — nothing else.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-migration-strategy-import-dont-replace">The Migration Strategy: Import, Don't Replace<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#the-migration-strategy-import-dont-replace" class="hash-link" aria-label="Direct link to The Migration Strategy: Import, Don't Replace" title="Direct link to The Migration Strategy: Import, Don't Replace" translate="no">​</a></h2>
<p>The critical design choice: <strong>import the existing CA into Vault PKI rather than generating a new one</strong>.</p>
<p>Generating a new CA would mean:</p>
<ul>
<li class="">Distributing the new CA certificate to every device and system that trusts the old one (macOS Keychain, container images, Ansible roles, k3s registry config, dozens of services that embed the CA bundle)</li>
<li class="">Re-issuing all 43 existing certificates so they chain to the new CA</li>
<li class="">A window where old certs (still trusted by the old CA) and new certs (only trusted by the new CA) coexist</li>
</ul>
<p>Importing the existing CA means:</p>
<ul>
<li class="">Same CA certificate, same fingerprint</li>
<li class="">All existing certs remain valid — they were signed by this CA and continue to be</li>
<li class="">No trust store changes anywhere</li>
<li class="">The transition is invisible to every TLS client</li>
</ul>
<p>Vault supports CA import via <code>POST /v1/pki/config/ca</code> with a PEM bundle containing both the certificate and the private key. The key is stored internally; the cert becomes the issuing certificate for all subsequent sign operations.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-migration-steps">The Migration Steps<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#the-migration-steps" class="hash-link" aria-label="Direct link to The Migration Steps" title="Direct link to The Migration Steps" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-enable-and-configure-the-pki-engine">1. Enable and Configure the PKI Engine<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#1-enable-and-configure-the-pki-engine" class="hash-link" aria-label="Direct link to 1. Enable and Configure the PKI Engine" title="Direct link to 1. Enable and Configure the PKI Engine" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Enable PKI at the default path</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/sys/mounts/pki \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{"type": "pki"}'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Tune max lease TTL to match CA validity (10 years)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/sys/mounts/pki/tune \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{"max_lease_ttl": "87600h"}'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Configure CRL and issuing certificate URLs</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/pki/config/urls \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "issuing_certificates": "https://vault.internal/v1/pki/ca",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "crl_distribution_points": "https://vault.internal/v1/pki/crl"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  }'</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-extract-the-existing-ca-and-import-it">2. Extract the Existing CA and Import It<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#2-extract-the-existing-ca-and-import-it" class="hash-link" aria-label="Direct link to 2. Extract the Existing CA and Import It" title="Direct link to 2. Extract the Existing CA and Import It" translate="no">​</a></h3>
<p>The CA cert and key live in the <code>cert-manager/minicloud-root-ca</code> secret:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Extract from k8s secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">CRT=$(kubectl get secret minicloud-root-ca -n cert-manager \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -o jsonpath='{.data.tls\.crt}' | base64 -d)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">KEY=$(kubectl get secret minicloud-root-ca -n cert-manager \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -o jsonpath='{.data.tls\.key}' | base64 -d)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Import the bundle — cert first, then key</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">BUNDLE="${CRT}${KEY}"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/pki/config/ca \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d "{\"pem_bundle\": \"$BUNDLE\"}"</span><br></div></code></pre></div></div>
<p>Before proceeding, verify the fingerprint of the imported CA matches what is in the Vault PKI endpoint:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Fingerprint of the CA cert in Vault</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -sk https://vault.internal/v1/pki/ca/pem \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | openssl x509 -noout -fingerprint -sha256</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Must match the fingerprint of the CA cert trusted everywhere</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">openssl x509 -in minicloud-ca.crt -noout -fingerprint -sha256</span><br></div></code></pre></div></div>
<p>If these do not match exactly, stop. Something went wrong with the import.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-create-the-pki-role">3. Create the PKI Role<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#3-create-the-pki-role" class="hash-link" aria-label="Direct link to 3. Create the PKI Role" title="Direct link to 3. Create the PKI Role" translate="no">​</a></h3>
<p>The role controls what cert-manager is allowed to request. We restrict it to only the domains we actually use:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/pki/roles/cert-manager \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "allowed_domains": ["10.0.0.200.nip.io", "devandre.sbs"],</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "allow_subdomains": true,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "allow_bare_domains": false,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "allow_wildcard_certificates": false,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "max_ttl": "8760h",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "ttl": "2160h",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "key_type": "ec",</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "key_bits": 256,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "generate_lease": false</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  }'</span><br></div></code></pre></div></div>
<p><code>allow_wildcard_certificates: false</code> is deliberate. cert-manager always requests specific SANs, not wildcards. Disabling wildcards reduces the blast radius if the Vault token were ever compromised.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-create-the-vault-policy-and-kubernetes-auth-role">4. Create the Vault Policy and Kubernetes Auth Role<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#4-create-the-vault-policy-and-kubernetes-auth-role" class="hash-link" aria-label="Direct link to 4. Create the Vault Policy and Kubernetes Auth Role" title="Direct link to 4. Create the Vault Policy and Kubernetes Auth Role" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Policy: cert-manager can only sign/issue certs via the cert-manager role</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vault policy write cert-manager - &lt;&lt;EOF</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">path "pki/sign/cert-manager"  { capabilities = ["create", "update"] }</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">path "pki/issue/cert-manager" { capabilities = ["create", "update"] }</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">EOF</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Kubernetes auth role: cert-manager SA → cert-manager policy</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -X POST https://vault.internal/v1/auth/kubernetes/role/cert-manager \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -H "X-Vault-Token: $TOKEN" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -d '{</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "bound_service_account_names": ["cert-manager"],</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "bound_service_account_namespaces": ["cert-manager"],</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "policies": ["cert-manager"],</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "ttl": "1h"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  }'</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="5-update-the-clusterissuer-in-place">5. Update the ClusterIssuer In-Place<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#5-update-the-clusterissuer-in-place" class="hash-link" aria-label="Direct link to 5. Update the ClusterIssuer In-Place" title="Direct link to 5. Update the ClusterIssuer In-Place" translate="no">​</a></h3>
<p>This is the key to a zero-disruption migration: we replace the <code>minicloud-ca</code> ClusterIssuer spec <strong>in-place</strong>, keeping the same name. All 43 Certificate resources reference <code>issuerRef.name: minicloud-ca</code> — none of them need to change.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Before</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterIssuer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ca</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">secretName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">root</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># After</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterIssuer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">vault</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">server</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> https</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//vault.10.0.0.200.nip.io   </span><span class="token comment" style="color:#999988;font-style:italic"># internal URL — bypasses Cloudflare Access</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">path</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> pki/sign/cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">caBundle</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> &lt;base64</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">encoded minicloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ca.crt</span><span class="token punctuation" style="color:#393A34">&gt;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">auth</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">kubernetes</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">mountPath</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /v1/auth/kubernetes</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">role</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">serviceAccountRef</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div></code></pre></div></div>
<p>The <code>caBundle</code> field tells cert-manager how to verify Vault's own TLS certificate. Since Vault's cert was itself issued by <code>minicloud-ca</code>, we provide the same CA cert. This avoids a chicken-and-egg situation: cert-manager can verify Vault's cert using the CA bundle embedded in the ClusterIssuer, without needing to call any other issuer first.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="6-gitops-a-dedicated-argocd-app-for-clusterissuers">6. GitOps: A Dedicated ArgoCD App for ClusterIssuers<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#6-gitops-a-dedicated-argocd-app-for-clusterissuers" class="hash-link" aria-label="Direct link to 6. GitOps: A Dedicated ArgoCD App for ClusterIssuers" title="Direct link to 6. GitOps: A Dedicated ArgoCD App for ClusterIssuers" translate="no">​</a></h3>
<p>Before this migration, the ClusterIssuers were applied via <code>kubectl</code> and not tracked in GitOps. We moved them into a dedicated ArgoCD application:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">minicloud-gitops/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  manifests/cert-manager-config/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    00-clusterissuer-selfsigned.yaml   # selfsigned-bootstrap</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    01-clusterissuer-vault.yaml        # minicloud-ca (Vault-backed)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  apps/platform/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    cert-manager-config.yaml           # ArgoCD Application, sync wave -1</span><br></div></code></pre></div></div>
<p>The sync wave <code>-1</code> matters. cert-manager itself runs at wave <code>-2</code>. The ClusterIssuers at wave <code>-1</code> are created after cert-manager is ready but before any other application tries to request a certificate (wave <code>0</code> and above). Without this ordering, the first sync of a new cluster would fail because Certificate resources would be submitted before their issuer exists.</p>
<p>One more change required: <code>ClusterIssuer</code> is a cluster-scoped resource and must be explicitly listed in the AppProject's <code>clusterResourceWhitelist</code>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">clusterResourceWhitelist</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">group</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"cert-manager.io"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ClusterIssuer</span><br></div></code></pre></div></div>
<p>This is easy to miss. Without it, ArgoCD reports "resource cert-manager.io<!-- -->:ClusterIssuer<!-- --> is not permitted in project" and the sync fails.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="gotchas-we-hit">Gotchas We Hit<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#gotchas-we-hit" class="hash-link" aria-label="Direct link to Gotchas We Hit" title="Direct link to Gotchas We Hit" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="cloudflare-blocks-api-calls-to-vaults-public-url">Cloudflare Blocks API Calls to Vault's Public URL<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#cloudflare-blocks-api-calls-to-vaults-public-url" class="hash-link" aria-label="Direct link to Cloudflare Blocks API Calls to Vault's Public URL" title="Direct link to Cloudflare Blocks API Calls to Vault's Public URL" translate="no">​</a></h3>
<p>Our Vault instance is accessible publicly at <code>vault.devandre.sbs</code> via Cloudflare Tunnel. Cloudflare Access protects it with browser-based authentication. When our Python setup script tried to call the Vault API at that URL, it received HTTP 403 with <code>error code: 1010</code> — Cloudflare blocking a non-browser client.</p>
<p>The fix is to always use the internal URL (<code>vault.10.0.0.200.nip.io</code>) for API calls originating from the controller or from within the cluster. cert-manager pods run inside the cluster and reach Vault over the internal network, which is why the ClusterIssuer uses <code>server: https://vault.10.0.0.200.nip.io</code>.</p>
<p><strong>Rule:</strong> If you are scripting Vault API calls from anywhere except a browser, use the internal URL.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="deleting-the-secret-triggers-immediate-regeneration">Deleting the Secret Triggers Immediate Regeneration<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#deleting-the-secret-triggers-immediate-regeneration" class="hash-link" aria-label="Direct link to Deleting the Secret Triggers Immediate Regeneration" title="Direct link to Deleting the Secret Triggers Immediate Regeneration" translate="no">​</a></h3>
<p>After the migration was complete, we deleted <code>cert-manager/minicloud-root-ca</code> to remove the plaintext key from the cluster. cert-manager immediately regenerated it.</p>
<p>The reason: there was still a <code>Certificate</code> object in the <code>cert-manager</code> namespace named <code>minicloud-root-ca</code>, referencing the <code>selfsigned-bootstrap</code> ClusterIssuer. This was the bootstrap certificate that originally created the CA secret. With the Certificate object present, cert-manager treats the secret as managed — when it is deleted, cert-manager re-issues it (with a freshly generated key, not the original one).</p>
<p>The correct sequence is:</p>
<ol>
<li class="">Delete the <code>Certificate</code> object first</li>
<li class="">Then delete the secret</li>
</ol>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl delete certificate minicloud-root-ca -n cert-manager</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl delete secret minicloud-root-ca -n cert-manager</span><br></div></code></pre></div></div>
<p>After step 1, cert-manager no longer manages the secret. After step 2, it is gone and nothing recreates it.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="appproject-whitelist-must-be-in-git-before-the-app-syncs">AppProject Whitelist Must Be in Git Before the App Syncs<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#appproject-whitelist-must-be-in-git-before-the-app-syncs" class="hash-link" aria-label="Direct link to AppProject Whitelist Must Be in Git Before the App Syncs" title="Direct link to AppProject Whitelist Must Be in Git Before the App Syncs" translate="no">​</a></h3>
<p>We patched the AppProject directly with <code>kubectl patch</code> to add <code>ClusterIssuer</code> to the whitelist, then created the <code>cert-manager-config</code> ArgoCD app. The app started syncing — and hit "resource not permitted" errors.</p>
<p>The reason: the <code>argocd-project</code> ArgoCD app manages the AppProject from git (<code>main</code> branch). On its next reconciliation cycle (every few minutes), it overwrote our <code>kubectl patch</code> with the git version, which did not yet include <code>ClusterIssuer</code> in the whitelist. Our cert-manager-config app was stuck in a retry loop.</p>
<p>The fix: merge the AppProject change to <code>main</code> first, let <code>argocd-project</code> sync, then create or re-create the <code>cert-manager-config</code> app. In a GitOps system, the git state always wins — direct API changes get reconciled away.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="verification">Verification<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#verification" class="hash-link" aria-label="Direct link to Verification" title="Direct link to Verification" translate="no">​</a></h2>
<p>After the ClusterIssuer switched to Vault, we force-renewed one certificate to confirm the end-to-end flow:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Force renewal by deleting the TLS secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl delete secret homer-tls -n homer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># cert-manager immediately requests a new cert from Vault</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl wait --for=condition=Ready certificate/homer-tls -n homer --timeout=30s</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Verify the new cert chains to the same root CA</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl get secret homer-tls -n homer \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -o jsonpath='{.data.tls\.crt}' | base64 -d \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | openssl verify -CAfile minicloud-ca.crt /dev/stdin</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → /dev/stdin: OK</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Check issuer and expiry</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl get secret homer-tls -n homer \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -o jsonpath='{.data.tls\.crt}' | base64 -d \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | openssl x509 -noout -issuer -enddate</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># issuer=CN=minicloud Internal Root CA</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># notAfter=Nov 13 21:54:14 2026 GMT</span><br></div></code></pre></div></div>
<p>The new certificate was issued in under 2 seconds. The issuer is unchanged. The chain verifies against the same minicloud root CA that was already trusted in the macOS Keychain.</p>
<p>We then ran the same <code>openssl verify</code> check across all 43 TLS secrets in the cluster. Every one returned <code>OK</code>.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-security-posture-before-and-after">The Security Posture Before and After<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#the-security-posture-before-and-after" class="hash-link" aria-label="Direct link to The Security Posture Before and After" title="Direct link to The Security Posture Before and After" translate="no">​</a></h2>
<table><thead><tr><th></th><th>Before</th><th>After</th></tr></thead><tbody><tr><td>CA private key location</td><td><code>cert-manager/minicloud-root-ca</code> k8s secret</td><td>Vault PKI engine internal storage</td></tr><tr><td>Datastore encryption</td><td>None (kine/SQLite plaintext)</td><td>Vault's own storage backend</td></tr><tr><td>Key exposure method</td><td>Any process with SQLite read access</td><td>Vault audit log only — key never exported</td></tr><tr><td>cert-manager authentication</td><td>None (direct secret read via RBAC)</td><td>Kubernetes SA JWT → 1h scoped Vault token</td></tr><tr><td>Who can forge a cert</td><td>Anyone who reads <code>state.db</code></td><td>Anyone with a valid <code>cert-manager</code> policy token</td></tr><tr><td>Blast radius of RBAC escalation</td><td>Full CA key compromise</td><td>Token issue only (no key exposure)</td></tr></tbody></table>
<p>The difference between "anyone who reads the SQLite file" and "anyone with a Vault token scoped to sign only" is the entire distance between unmanaged secret sprawl and secrets management.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-stays-the-same">What Stays the Same<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#what-stays-the-same" class="hash-link" aria-label="Direct link to What Stays the Same" title="Direct link to What Stays the Same" translate="no">​</a></h2>
<p>The public CA certificate (<code>minicloud-ca.crt</code>) is unchanged. It is still trusted in the macOS Keychain. It is still distributed to container images via the Ansible role. It is still embedded in k3s registry configuration. None of that needs to move.</p>
<p>Every existing TLS certificate — the 43 secrets currently in the cluster — remains valid. They were issued by the CA key that Vault now holds. On their next renewal cycle (cert-manager renews at 30 days before expiry by default), they will be re-issued by Vault seamlessly. Services never see a gap in certificate validity.</p>
<p>The only thing that changed is where the private key lives and who can touch it.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-more-thing-vault-is-also-protected-by-its-own-cert">One More Thing: Vault Is Also Protected by Its Own Cert<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#one-more-thing-vault-is-also-protected-by-its-own-cert" class="hash-link" aria-label="Direct link to One More Thing: Vault Is Also Protected by Its Own Cert" title="Direct link to One More Thing: Vault Is Also Protected by Its Own Cert" translate="no">​</a></h2>
<p>There is a subtle circular dependency here worth naming. Vault's own TLS certificate (<code>vault/vault-tls</code>) was issued by cert-manager using the <code>minicloud-ca</code> ClusterIssuer. After the migration, cert-manager issues Vault's cert by calling Vault. Vault signs a cert for itself via cert-manager.</p>
<p>This is not a problem in practice. The existing cert is valid for 90 days with a 30-day renew window. Renewal happens long before expiry. cert-manager connects to Vault using the current cert (which is still valid) to request the next cert. The transition is smooth.</p>
<p>But it does mean: if Vault's cert expires before cert-manager can renew it, cert-manager can no longer reach Vault, and the whole issuer is broken. The solution is to keep Vault's cert duration generous (90 days) and monitor cert expiry with alerting — which the existing PrometheusRule for cert-manager already handles.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://docs.devandre.sbs/blog/vault-pki-ca-migration#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<p>Moving a CA private key from a Kubernetes secret into Vault PKI is a non-disruptive operation if you import the existing CA rather than generating a new one. The fingerprint stays the same. The certificates stay valid. The trust stores stay untouched. The only change visible to anything outside Vault is that cert-manager now requests certificates differently — and that the private key is no longer readable by anyone who can access the cluster datastore.</p>
<p>The migration took one session. The cluster ran continuously throughout. Forty-three certificates verified clean after the switch. The CA private key no longer exists anywhere a file read can find it.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>security</category>
            <category>vault</category>
            <category>cert-manager</category>
            <category>pki</category>
            <category>tls</category>
            <category>gitops</category>
            <category>k3s</category>
            <category>argocd</category>
            <category>secrets-management</category>
        </item>
        <item>
            <title><![CDATA[Bare Metal First, Cloud at the Edge — Our Hybrid Architecture Decision]]></title>
            <link>https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare</link>
            <guid>https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare</guid>
            <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Most tutorials teach you to deploy on AWS. We went the other way: five bare-metal nodes on the floor, Cloudflare at the edge, and cloud services only where physics makes self-hosting impossible. This is why.]]></description>
            <content:encoded><![CDATA[<p>Most Kubernetes tutorials start with <code>eksctl create cluster</code> or <code>gcloud container clusters create</code>. A managed control plane, auto-scaling node groups, load balancers that appear with a single annotation. The cloud abstracts the hardware entirely.</p>
<p>We went the other direction. Five physical machines — four ThinkPad laptops and a 2012 MacBook Pro — running k3s, with every workload scheduled and operated by us. No managed control plane. No auto-scaling node group. No cloud load balancer. Just Linux, containerd, and Flannel on iron we can touch.</p>
<p>But we do use cloud services. AWS delivers our email. Cloudflare sits in front of every HTTP request. A Lightsail instance relays our video call UDP traffic. Tailscale connects us to the cluster from anywhere.</p>
<p>This post explains how we decided what goes where, and why the resulting architecture is not a compromise — it is a deliberate design.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-starting-question">The Starting Question<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#the-starting-question" class="hash-link" aria-label="Direct link to The Starting Question" title="Direct link to The Starting Question" translate="no">​</a></h2>
<p>When you run infrastructure, every service you add forces the same question: does this run on my hardware, or does it run somewhere else?</p>
<p>The naive answer is "it depends." The useful answer requires a framework. Ours has three criteria:</p>
<ol>
<li class=""><strong>Does it require a public IP or a specific network position that I cannot provide?</strong></li>
<li class=""><strong>Would running it myself damage something I cannot fix — like email deliverability reputation?</strong></li>
<li class=""><strong>Is the operational cost of running it myself disproportionate to the benefit?</strong></li>
</ol>
<p>If the answer to any of these is yes, the service belongs in the cloud. Otherwise, it runs on our nodes.</p>
<p>Let us apply this to every service on the platform.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-runs-on-premise">What Runs On-Premise<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#what-runs-on-premise" class="hash-link" aria-label="Direct link to What Runs On-Premise" title="Direct link to What Runs On-Premise" translate="no">​</a></h2>
<p>Everything with a yes answer to "can we run this ourselves without a structural disadvantage" runs on the cluster.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">┌─────────────────────────────────────────────────────────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  k3s cluster — 5 nodes, bare metal                                  │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│                                                                     │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  set-hog (control plane)    fast-skunk    fast-heron                │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  star-kitten                swift-mac (MacBook Pro 2012)            │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│                                                                     │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Workloads (selected):                                              │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  ArgoCD · Authentik · Harbor · Grafana · Loki · Tempo               │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Backstage · Plane · ERPNext · Matrix · Element · Jitsi             │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Stalwart mail · Open WebUI · Vaultwarden · Vault                   │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  LiteLLM · vLLM · Flowise · MLflow · n8n · Temporal                │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Longhorn storage · MinIO · PostgreSQL · MariaDB                    │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└─────────────────────────────────────────────────────────────────────┘</span><br></div></code></pre></div></div>
<p>This is twenty-five production workloads, all their databases, all their storage — running on hardware that costs nothing per month to operate beyond electricity. It is also where every piece of sensitive data lives: insurance policy records, employee HR data, authentication credentials, vector embeddings, LLM inference.</p>
<p>The data sovereignty dimension matters here more than cost. Running a French insurance information system means operating under GDPR and ACPR supervision. Every byte of PII staying inside physical hardware we control, in a jurisdiction we chose, is a compliance decision as much as an infrastructure one.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-runs-in-the-cloud-and-why">What Runs In the Cloud, and Why<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#what-runs-in-the-cloud-and-why" class="hash-link" aria-label="Direct link to What Runs In the Cloud, and Why" title="Direct link to What Runs In the Cloud, and Why" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="cloudflare--the-edge-layer">Cloudflare — The Edge Layer<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#cloudflare--the-edge-layer" class="hash-link" aria-label="Direct link to Cloudflare — The Edge Layer" title="Direct link to Cloudflare — The Edge Layer" translate="no">​</a></h3>
<p>The cluster sits behind a home internet connection. Home ISPs assign dynamic IP addresses, often share IPs across customers, and do not provide the DDoS mitigation or the BGP peering that makes a public endpoint reliable. Cloudflare solves all of this.</p>
<p><strong>Cloudflare Tunnel</strong> is the core mechanism. Rather than exposing our cluster's IP address to the internet, we run a lightweight <code>cloudflared</code> daemon on the controller. It maintains an outbound connection to Cloudflare's edge. When a request arrives for <code>argocd.devandre.sbs</code>, Cloudflare routes it through that tunnel to our internal service — without our IP ever being published.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">External request → argocd.devandre.sbs</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          Cloudflare edge (WAF + DDoS mitigation)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                   Cloudflare Tunnel</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          cloudflared daemon (controller, 100.88.123.8)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                        ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          ArgoCD service (argocd namespace, 10.0.0.200)</span><br></div></code></pre></div></div>
<p>Every one of our twenty-three public endpoints follows this path. The WAF inspects traffic before it reaches the cluster. DDoS traffic is absorbed at Cloudflare's edge, not by our nodes. The origin IP is never exposed.</p>
<p><strong>Cloudflare R2</strong> stores our off-site backup. Velero backs up cluster state to an on-cluster MinIO instance daily. A separate weekly schedule writes to R2. If the physical hardware is destroyed — fire, flood, theft — the cluster state survives in R2 and can be restored to any Kubernetes cluster. This is the one scenario where on-premise storage structurally cannot help: the backup must survive the loss of the site.</p>
<p><strong>The cost:</strong> Cloudflare Tunnel is free. R2 is free up to 10 GB storage and 1 million Class A operations per month. Our weekly backup runs well within this. Cloudflare WAF on the free plan covers the essential rules. Total monthly spend: zero.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="aws-ses--email-delivery">AWS SES — Email Delivery<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#aws-ses--email-delivery" class="hash-link" aria-label="Direct link to AWS SES — Email Delivery" title="Direct link to AWS SES — Email Delivery" translate="no">​</a></h3>
<p>Stalwart Mail runs on the cluster and handles all inbound and outbound email for <code>devandre.sbs</code>. For inbound, this works perfectly — Stalwart receives, parses, and stores mail entirely on-premise.</p>
<p>For outbound, running your own SMTP relay is structurally disadvantaged. IP reputation is everything in email deliverability. A home IP address has no sender reputation — it will be classified as residential and rejected or filtered by most major providers. Warming a new IP takes months. If the IP is ever shared with a spam source, the reputation follows the IP, not the sender.</p>
<p>AWS SES solves this. It provides a sending infrastructure with established IP reputation, DKIM signing, SPF alignment, and DMARC support. Our email originates in Stalwart, routes through SES as a relay, and arrives with the deliverability profile of a commercial sending platform.</p>
<p>The cost is $0.10 per thousand messages. For the volume of a small insurance company's transactional email — policy confirmations, claim updates, dunning notices, alerts — the monthly spend is cents.</p>
<p>This satisfies criterion 2 precisely: running it ourselves would damage email deliverability in a way we cannot fix without months of IP warming and without certainty of outcome.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="aws-lightsail--turn-relay-for-video">AWS Lightsail — TURN Relay for Video<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#aws-lightsail--turn-relay-for-video" class="hash-link" aria-label="Direct link to AWS Lightsail — TURN Relay for Video" title="Direct link to AWS Lightsail — TURN Relay for Video" translate="no">​</a></h3>
<p>Jitsi Meet runs on the cluster. Most video calls work peer-to-peer or through the Jitsi Videobridge (JVB) running on <code>star-kitten</code>. But WebRTC peer-to-peer fails when both participants are behind symmetric NAT — which is common on mobile networks and corporate firewalls.</p>
<p>The solution is a TURN server: a relay that both participants can reach directly, which forwards UDP packets between them. A TURN server must be reachable on public UDP ports without NAT. It must have a stable public IP.</p>
<p>Our cluster sits behind NAT. We cannot expose arbitrary UDP ports reliably without a fixed public IP and control over the router. A Lightsail instance at $3.50/month solves this cleanly: static IP, public UDP ports, coturn running as a service.</p>
<p>This satisfies criterion 1. The TURN server requires a network position — public UDP reachability without NAT — that we structurally cannot provide from within the cluster.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="tailscale--zero-trust-vpn">Tailscale — Zero-Trust VPN<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#tailscale--zero-trust-vpn" class="hash-link" aria-label="Direct link to Tailscale — Zero-Trust VPN" title="Direct link to Tailscale — Zero-Trust VPN" translate="no">​</a></h3>
<p>The cluster is not directly reachable from the internet (by design — Cloudflare Tunnel handles HTTP). But the controller needs to be reachable for SSH, for kubectl, and for infrastructure operations.</p>
<p>Tailscale provides this via WireGuard-based mesh networking. Every node gets a Tailscale address in the <code>100.x.x.x</code> range. The controller is reachable at <code>100.88.123.8</code> from any device on the same Tailscale network. The data plane is peer-to-peer; no traffic flows through Tailscale's servers if a direct path exists.</p>
<p>The control plane is a SaaS service — Tailscale manages key distribution and device authentication. This is a deliberate trade-off: we do not want to operate the PKI and coordination service ourselves for a zero-trust overlay. The free plan covers up to 100 devices, which we will not exceed.</p>
<hr>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="github--source-control-and-ci">GitHub — Source Control and CI<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#github--source-control-and-ci" class="hash-link" aria-label="Direct link to GitHub — Source Control and CI" title="Direct link to GitHub — Source Control and CI" translate="no">​</a></h3>
<p>All code, GitOps manifests, and documentation live in GitHub. CI runs on GitHub Actions with runners provided by GitHub. This is a SaaS dependency, but it satisfies criterion 3: the operational cost of running self-hosted Gitea, a CI runner fleet, and a container scan pipeline ourselves would be disproportionate to the benefit when GitHub's free tier provides all of it.</p>
<p>The one deliberate decision here is that the container registry is <strong>not</strong> GitHub Container Registry. All images push to Harbor, running on the cluster, for two reasons: data locality (images are pulled from within the cluster, not over the internet) and control (we manage image retention, vulnerability scanning, and access control ourselves).</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-decision-framework-in-practice">The Decision Framework in Practice<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#the-decision-framework-in-practice" class="hash-link" aria-label="Direct link to The Decision Framework in Practice" title="Direct link to The Decision Framework in Practice" translate="no">​</a></h2>
<p>Every time we add a new service, we apply the same three questions:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Does it require a public IP or specific network position?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    YES → cloud (Lightsail, EC2 free tier)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    NO  ↓</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Would running it myself damage an irreplaceable reputation?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    YES → cloud (SES for email deliverability)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    NO  ↓</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Is the operational overhead disproportionate to the benefit?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    YES → cloud SaaS (Tailscale, GitHub)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    NO  → on-premise (everything else)</span><br></div></code></pre></div></div>
<p>This is why twenty-five workloads run on bare metal and four cloud services handle what bare metal cannot.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-cost-comparison">The Cost Comparison<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#the-cost-comparison" class="hash-link" aria-label="Direct link to The Cost Comparison" title="Direct link to The Cost Comparison" translate="no">​</a></h2>
<p>Running the equivalent of this platform on AWS would require:</p>
<table><thead><tr><th>Component</th><th>AWS equivalent</th><th>Estimated monthly cost</th></tr></thead><tbody><tr><td>5 k8s worker nodes (2 vCPU, 8GB)</td><td>5× t3.large EKS workers</td><td>~$270</td></tr><tr><td>Control plane</td><td>EKS managed</td><td>$72</td></tr><tr><td>Storage (2TB total)</td><td>EBS gp3</td><td>~$160</td></tr><tr><td>Object storage (MinIO equivalent)</td><td>S3</td><td>~$46</td></tr><tr><td>Load balancer</td><td>ALB</td><td>~$20</td></tr><tr><td>NAT gateway</td><td>NAT GW</td><td>~$32</td></tr><tr><td><strong>Total</strong></td><td></td><td><strong>~$600/month</strong></td></tr></tbody></table>
<p>Our actual cloud spend:</p>
<table><thead><tr><th>Service</th><th>Monthly cost</th></tr></thead><tbody><tr><td>AWS SES</td><td>~$0.50</td></tr><tr><td>AWS Lightsail (TURN)</td><td>$3.50</td></tr><tr><td>Cloudflare</td><td>$0</td></tr><tr><td>Tailscale</td><td>$0</td></tr><tr><td>GitHub</td><td>$0</td></tr><tr><td><strong>Total</strong></td><td><strong>~$4/month</strong></td></tr></tbody></table>
<p>The bare-metal nodes have a one-time acquisition cost (used ThinkPads, ~€200–400 each) and an ongoing electricity cost (approximately €15/month for 5 machines). The cluster cost is around €25/month all-in.</p>
<p>The architecture does not save money by being clever. It saves money by correctly identifying which problems require cloud infrastructure and which do not.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-this-architecture-cannot-do">What This Architecture Cannot Do<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#what-this-architecture-cannot-do" class="hash-link" aria-label="Direct link to What This Architecture Cannot Do" title="Direct link to What This Architecture Cannot Do" translate="no">​</a></h2>
<p>Honesty requires listing the trade-offs.</p>
<p><strong>No elastic scaling.</strong> If traffic spikes beyond our five nodes' capacity, there is no auto-scaling group to add capacity. We scale vertically (more RAM in a ThinkPad) or accept that the cluster has a ceiling.</p>
<p><strong>No availability zone redundancy.</strong> All five nodes are in the same physical location. A power outage, a fire, or a network failure takes everything down simultaneously. Cloudflare R2 backup and Velero give us data recovery, but RTO (recovery time) is measured in hours, not minutes.</p>
<p><strong>Higher operational burden.</strong> When a node goes down, we fix it. When a disk fails, we replace it. When k3s releases a security patch, we plan and execute the upgrade. A managed Kubernetes service handles most of this automatically.</p>
<p>These are conscious trade-offs made for a specific context: a portfolio platform demonstrating full-stack infrastructure capability, where data sovereignty and operational control are more important than elastic scale or five-nines availability.</p>
<p>For a production insurance company at scale, the architecture would shift: on-premise for regulated data processing, cloud Kubernetes (EKS/AKS) for stateless workloads that need elastic capacity, with the same Cloudflare edge layer in front of both.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-principle">The Principle<a href="https://docs.devandre.sbs/blog/hybrid-cloud-bare-metal-cloudflare#the-principle" class="hash-link" aria-label="Direct link to The Principle" title="Direct link to The Principle" translate="no">​</a></h2>
<p>The question is never "cloud or on-premise." It is always "what does this specific workload require, and where does that place it?"</p>
<p>Our database workloads require data locality, consistent IOPS, and compliance control. They run on bare metal.</p>
<p>Our email delivery requires IP reputation that takes months to build. It runs through SES.</p>
<p>Our video relay requires a public UDP address without NAT. It runs on Lightsail.</p>
<p>Our public endpoints require DDoS mitigation and a stable origin address. They run through Cloudflare.</p>
<p>Everything else runs on the cluster.</p>
<p>That is hybrid cloud: not splitting workloads arbitrarily between environments, but placing each workload in the environment that structurally fits it. The cloud services we use cost four euros a month. The platform they front is twenty-five production workloads running on hardware on the floor.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>bare-metal</category>
            <category>hybrid-cloud</category>
            <category>cloudflare</category>
            <category>aws</category>
            <category>architecture</category>
            <category>devops</category>
            <category>infrastructure</category>
            <category>k3s</category>
            <category>self-hosted</category>
        </item>
        <item>
            <title><![CDATA[Why We Skipped LDAP, Active Directory, and Entra ID — And What We Built Instead]]></title>
            <link>https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad</link>
            <guid>https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad</guid>
            <pubDate>Sun, 09 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Most enterprises carry 25 years of identity debt — AD on-prem, LDAP connectors, Entra sync agents. We built a Kubernetes platform from scratch and landed directly at the modern end of that arc. This post explains the difference and why it matters.]]></description>
            <content:encoded><![CDATA[<p>Most enterprise identity architectures did not start as what they are today. They started in 1999 with Active Directory, accumulated LDAP integrations over the following decade, and are now partway through a migration toward cloud-based identity via Microsoft Entra ID — carrying the weight of every layer that came before.</p>
<p>We built our platform from scratch. We never had an on-premises domain. We never configured LDAP. We skipped directly to the protocol stack that enterprises are spending years and significant money trying to reach. This post explains what we chose, why, and how the resulting identity architecture compares to the enterprise standard.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-most-enterprises-actually-run">What Most Enterprises Actually Run<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#what-most-enterprises-actually-run" class="hash-link" aria-label="Direct link to What Most Enterprises Actually Run" title="Direct link to What Most Enterprises Actually Run" translate="no">​</a></h2>
<p>Before comparing, it is worth understanding what the enterprise identity stack looks like in practice, because the gap between what organisations have and what they are targeting is significant.</p>
<p>A typical large organisation has three layers coexisting simultaneously:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">┌───────────────────────────────────────────────────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Microsoft Entra ID                                           │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  (cloud identity, modern apps, Microsoft 365)                 │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└────────────────────────┬──────────────────────────────────────┘</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                         │ Entra Connect sync (bidirectional)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">┌────────────────────────▼──────────────────────────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Active Directory Domain Services (on-premises)               │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  (Windows machines, Kerberos, Group Policy, legacy apps)      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└────────────────────────┬──────────────────────────────────────┘</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                         │ LDAP / LDAPS queries</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">┌────────────────────────▼──────────────────────────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  Legacy application layer                                     │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">│  (VPNs, file servers, printers, older web apps)               │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└───────────────────────────────────────────────────────────────┘</span><br></div></code></pre></div></div>
<p>Each layer was added because the previous one could not handle the new requirement. Each layer is still running because the applications depending on it cannot be migrated quickly enough. The organisation is paying the operational cost of all three simultaneously.</p>
<p>This is not a criticism — it is the reality of any system that has evolved over 25 years under real business constraints. But it does mean that what enterprises call "modern identity" is often Entra ID sitting on top of Active Directory sitting on top of LDAP, with sync agents managing consistency between all three.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-protocol-stack-underneath-each-layer">The Protocol Stack Underneath Each Layer<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#the-protocol-stack-underneath-each-layer" class="hash-link" aria-label="Direct link to The Protocol Stack Underneath Each Layer" title="Direct link to The Protocol Stack Underneath Each Layer" translate="no">​</a></h2>
<p>The three technologies are not equivalent in kind, which makes direct comparison misleading.</p>
<p><strong>LDAP</strong> is a protocol — specifically, a wire format and query language for asking questions of a directory service. It does not store users itself. It defines how an application asks <em>"does this user exist?"</em> or <em>"what groups does this user belong to?"</em></p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Application</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     │  LDAP query  (port 389 / 636)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Directory service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     ├── uid=andre,ou=users,dc=company,dc=com</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     ├── memberOf: cn=developers,ou=groups,...</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">     └── userPassword: {SSHA}...</span><br></div></code></pre></div></div>
<p><strong>Active Directory</strong> is a product that implements LDAP alongside Kerberos for authentication, DNS for service discovery, and Group Policy for Windows machine configuration. It is the dominant on-premises directory service because it shipped with Windows Server and became the default for Windows-centric enterprises.</p>
<p><strong>Microsoft Entra ID</strong> is a cloud identity platform. Despite retaining "Active Directory" in its legacy name, it does not speak LDAP or Kerberos natively toward cloud applications. It speaks OAuth 2.0, OpenID Connect, and SAML — the same protocols used by every modern web service. The mental model shift is significant:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">LDAP model                    OIDC model</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">──────────────────────        ──────────────────────</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">App queries directory         App delegates auth</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">App checks password           User authenticates at IDP</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">App manages session           IDP issues JWT token</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">App decides access            App trusts token claims</span><br></div></code></pre></div></div>
<p>Under LDAP, the application is in control of authentication. Under OIDC, the identity provider is. This is a fundamentally better security boundary: the application never touches credentials, never stores password hashes, and never has to implement MFA itself.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-we-built">What We Built<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#what-we-built" class="hash-link" aria-label="Direct link to What We Built" title="Direct link to What We Built" translate="no">​</a></h2>
<p>Our platform runs on five bare-metal nodes — four ThinkPads and a MacBook Pro — with k3s as the Kubernetes distribution. From the first workload, we chose a single identity approach: <strong>Authentik</strong> as a self-hosted identity provider, with every application configured to use OIDC.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">                    ┌──────────────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    │         Authentik         │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    │   auth.devandre.sbs       │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    │                           │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    │  Users  Groups  Flows      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    │  TOTP   Sessions  Policies │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                    └────────────┬─────────────┘</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                                 │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              ┌──────────────────┼──────────────────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │                  │                  │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">           OAuth2             OpenID Connect      Proxy</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │                  │                  │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   ┌──────────▼─────┐  ┌────────▼──────┐  ┌───────▼──────┐</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   │ ArgoCD         │  │ Open WebUI    │  │ Jitsi Meet   │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   │ Harbor         │  │ Grafana       │  │ (forward auth)│</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   │ Plane          │  │ Backstage     │  └──────────────┘</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   │ Vaultwarden    │  │ n8n           │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   │ ERPNext        │  │ Temporal      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   └────────────────┘  └───────────────┘</span><br></div></code></pre></div></div>
<p>Every application in the platform — more than fifteen — authenticates through a single login page with TOTP. There are no per-application password databases. No application stores credentials. There is no LDAP connector, no sync agent, no on-premises component of any kind.</p>
<p>The flow for a user accessing any protected resource is identical regardless of which application they are opening:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">User opens ArgoCD / Grafana / Harbor / any app</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │  302 redirect to Authentik</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      Authentik login page</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │  password + TOTP</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      JWT issued with claims:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        sub: andre</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        groups: ["authentik Admins"]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        email: kanmegnea@...</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │  redirect back with code</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      Application exchanges code for token</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              │  reads groups claim</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      Access granted (admin or user tier)</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="feature-for-feature-comparison">Feature-for-Feature Comparison<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#feature-for-feature-comparison" class="hash-link" aria-label="Direct link to Feature-for-Feature Comparison" title="Direct link to Feature-for-Feature Comparison" translate="no">​</a></h2>
<table><thead><tr><th>Capability</th><th>Enterprise LDAP/AD</th><th>Microsoft Entra ID</th><th>Our Authentik stack</th></tr></thead><tbody><tr><td>User store</td><td>AD DS</td><td>Entra ID</td><td>Authentik (PostgreSQL-backed)</td></tr><tr><td>Auth protocol</td><td>Kerberos / LDAP</td><td>OAuth2 / OIDC / SAML</td><td>OAuth2 / OIDC</td></tr><tr><td>MFA</td><td>Separate product (Duo, ADFS)</td><td>Entra MFA</td><td>Authentik TOTP (built-in)</td></tr><tr><td>SSO</td><td>Federated / complex</td><td>Native</td><td>Native</td></tr><tr><td>Group-based access</td><td>AD groups → app RBAC</td><td>Entra groups → app RBAC</td><td>Authentik groups → app RBAC</td></tr><tr><td>Windows domain</td><td>Required</td><td>Optional</td><td>Not applicable</td></tr><tr><td>App password storage</td><td>Per-app</td><td>Per-app (legacy)</td><td>Never — IDP only</td></tr><tr><td>Self-hosted</td><td>Yes (AD DS)</td><td>No</td><td>Yes</td></tr><tr><td>Cloud-native design</td><td>No</td><td>Yes</td><td>Yes</td></tr><tr><td>Conditional Access policies</td><td>No</td><td>Yes (premium)</td><td>Basic (Authentik policy engine)</td></tr><tr><td>Operational overhead</td><td>High (AD DCs, GPO, replication)</td><td>Low (managed)</td><td>Medium (self-operated)</td></tr><tr><td>Vendor lock-in</td><td>Microsoft</td><td>Microsoft</td><td>None</td></tr><tr><td>GDPR / data residency</td><td>Complex</td><td>Data in Microsoft DCs</td><td>Full control (on-prem)</td></tr></tbody></table>
<p>The protocol column is where the real difference sits. Kerberos and LDAP were designed for a world where every application lived inside a network perimeter and could reach a domain controller directly. OIDC was designed for a world where applications are distributed, may run in the cloud, and cannot assume network adjacency to an identity provider. Our stack was built for the second world from day one.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-one-thing-ldap-still-does-that-oidc-does-not">The One Thing LDAP Still Does That OIDC Does Not<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#the-one-thing-ldap-still-does-that-oidc-does-not" class="hash-link" aria-label="Direct link to The One Thing LDAP Still Does That OIDC Does Not" title="Direct link to The One Thing LDAP Still Does That OIDC Does Not" translate="no">​</a></h2>
<p>There is an honest reason LDAP has not simply disappeared: some applications do not speak OIDC and never will. Network switches, storage appliances, older VPN concentrators, legacy ERP modules, printers with access controls — many of these devices speak LDAP and nothing else.</p>
<p>Authentik handles this case with an optional <strong>LDAP outpost</strong>: a sidecar component that translates LDAP queries against the Authentik user store. If we ever need to authenticate a device that only understands LDAP, we do not need to run a separate directory. Authentik surfaces its users and groups over LDAP while the real store remains OIDC-native.</p>
<p>We have not needed this feature yet. Every application we deployed — including ERPNext (HR), Matrix Synapse (chat), Jitsi Meet (video), Plane (project management), and Vaultwarden (passwords) — has native OIDC support. The LDAP outpost exists as a fallback for the legacy integration case, not as a primary path.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-operational-tradeoff-we-accept">The Operational Tradeoff We Accept<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#the-operational-tradeoff-we-accept" class="hash-link" aria-label="Direct link to The Operational Tradeoff We Accept" title="Direct link to The Operational Tradeoff We Accept" translate="no">​</a></h2>
<p>Running a self-hosted identity provider is not free. The honest tradeoffs compared to a managed service like Entra ID are:</p>
<p><strong>Single point of failure.</strong> Authentik is a single pod in our cluster. If the <code>auth</code> namespace goes down — during a Kubernetes upgrade, a storage rebuild, a node failure — every SSO-protected application becomes unreachable until it recovers. This is why every critical application has a break-glass local admin account (<code>~/.argocd-admin</code>, <code>~/.grafana-admin</code>, etc.) stored on the controller for emergencies.</p>
<p><strong>We operate the upgrades.</strong> Entra ID upgrades itself. We schedule Authentik upgrades, test them in staging, and roll them out manually. This is a few hours of work per major version, not a continuous burden, but it is work that Entra ID customers do not do.</p>
<p><strong>No Conditional Access equivalent.</strong> Entra ID's Conditional Access lets you say <em>"require MFA only when the user is outside the corporate network"</em> or <em>"block login from specific countries."</em> Authentik has a policy engine that can express similar rules, but the tooling is less mature and requires more manual configuration.</p>
<p>For a homelab-grade cluster serving a team of one, these tradeoffs are entirely reasonable. For an organisation with compliance requirements and an IT operations team, the managed alternative earns its cost.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-architecture-matters-for-kubernetes-specifically">Why This Architecture Matters for Kubernetes Specifically<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#why-this-architecture-matters-for-kubernetes-specifically" class="hash-link" aria-label="Direct link to Why This Architecture Matters for Kubernetes Specifically" title="Direct link to Why This Architecture Matters for Kubernetes Specifically" translate="no">​</a></h2>
<p>Kubernetes has its own authentication model, and it aligns naturally with OIDC rather than LDAP. The API server can be configured to accept OIDC tokens directly — meaning the same JWT that grants access to Grafana or ArgoCD can also be used to run <code>kubectl</code> commands. The user's group membership, issued by Authentik at login time, flows into Kubernetes RBAC without any synchronisation job.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">User logs in via Authentik</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         │  JWT with groups claim</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl --token=&lt;jwt&gt; get pods</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         │  API server validates token against</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         │  Authentik OIDC discovery endpoint</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">         ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">RBAC: group "authentik Admins" → ClusterRole cluster-admin</span><br></div></code></pre></div></div>
<p>Under LDAP or Active Directory, achieving the same result requires a bridge: either an LDAP-to-Kubernetes RBAC sync daemon, or Entra ID integration via a Microsoft-specific plugin. With OIDC native to both Authentik and Kubernetes, there is no bridge to maintain.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://docs.devandre.sbs/blog/modern-iam-oidc-vs-ldap-ad#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<p>Most enterprises are modernising <em>toward</em> what we have. They are running Entra ID on top of Active Directory on top of LDAP, progressively lifting applications from the older layers to the newer one, spending engineering effort at each step on migration, compatibility shims, and sync agents.</p>
<p>We started at the top. Every application speaks OIDC. Every user authenticates once through Authentik and receives a token that works everywhere. There is no on-premises directory, no Kerberos, no LDAP connector, no vendor dependency.</p>
<p>The tradeoff is that we operate the identity platform ourselves rather than paying for it as a service. For a self-hosted Kubernetes platform, that is a straightforward and conscious choice — not a constraint.</p>
<p>The protocol stack that enterprises are converging on after 25 years of evolution is the only one we have ever run.</p>]]></content:encoded>
            <category>iam</category>
            <category>sso</category>
            <category>oidc</category>
            <category>oauth2</category>
            <category>authentik</category>
            <category>kubernetes</category>
            <category>enterprise</category>
            <category>security</category>
            <category>identity</category>
            <category>ldap</category>
            <category>active-directory</category>
            <category>self-hosted</category>
        </item>
        <item>
            <title><![CDATA[Building an Enterprise AI Gateway on Kubernetes: LiteLLM, Local Models, and Zero-Trust Guardrails]]></title>
            <link>https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm</link>
            <guid>https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm</guid>
            <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How to build a production AI gateway that routes between local models and cloud APIs, enforces department-level access controls, strips PII before it leaves your network, and traces every call — all behind a single OpenAI-compatible endpoint.]]></description>
            <content:encoded><![CDATA[<p>Most enterprise AI deployments make the same architectural mistake early on: they give every team a direct API key to OpenAI or Anthropic and call it done. The result is predictable — no cost visibility, no access control, no audit trail, and sensitive data being sent to cloud APIs without any guardrails.</p>
<p>A proper enterprise AI gateway changes the shape of the problem. Instead of many teams talking to many APIs, you have one endpoint that handles routing, rate limiting, PII scrubbing, caching, and observability. Teams consume it the same way regardless of whether the model is running on your own hardware or on a cloud provider's GPU fleet.</p>
<p>This post covers the full design of such a gateway, built on Kubernetes with LiteLLM as the proxy layer, Ollama and vLLM for local inference, and Presidio for PII protection — with real configuration that is running in production.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-problem-with-direct-api-access">The Problem With Direct API Access<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#the-problem-with-direct-api-access" class="hash-link" aria-label="Direct link to The Problem With Direct API Access" title="Direct link to The Problem With Direct API Access" translate="no">​</a></h2>
<p>When teams connect directly to cloud LLM APIs, four problems compound quickly.</p>
<p><strong>Cost opacity.</strong> You discover your monthly bill at the end of the month. By then the expensive model that someone used for a test pipeline has been running for three weeks.</p>
<p><strong>No data boundary.</strong> Every prompt goes to an external API unless someone actively intervenes. For organisations handling personal data under GDPR, or financial data under ACPR oversight, this is not a configuration choice — it is a compliance problem.</p>
<p><strong>No access control.</strong> The same API key that lets a developer prototype also lets them run automated batch jobs consuming a million tokens per hour. There is no per-department spending limit, no model tier, no rate limit.</p>
<p><strong>No audit trail.</strong> When something goes wrong — an inappropriate prompt, an unexpected output, a cost spike — you have no record of what was asked, what was answered, or which team was responsible.</p>
<p>A gateway solves all four, and the cost of operating one is low enough that there is no good reason not to.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="architecture-overview">Architecture Overview<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#architecture-overview" class="hash-link" aria-label="Direct link to Architecture Overview" title="Direct link to Architecture Overview" translate="no">​</a></h2>
<p>The gateway sits between every AI consumer (chat interfaces, RAG pipelines, agents, scripts) and every AI provider (local models, cloud APIs). Nothing calls a model directly.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Open WebUI ──► LiteLLM Gateway (:4000)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Agents      ──►      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Scripts     ──►      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Ollama primary   (fast-heron,  :11434)  ← local-first</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Ollama secondary (star-kitten, :11434)  ← local-first</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── vLLM             (star-kitten, :8000)   ← high-throughput</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Groq             (llama-3.1-8b-instant) ← auto-fallback #1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── DeepSeek         (deepseek-chat)        ← auto-fallback #2</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Mistral          (large, small)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Anthropic        (claude-sonnet, haiku)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── OpenAI           (gpt-4o, gpt-4o-mini)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     ├── Gemini           (gemini-2.5-flash)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                     └── NVIDIA NIM       (nemotron-70b, deepseek-r1)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">LiteLLM ──► Valkey cache   (:6379)    ← exact-match prompt dedup, 10 min TTL</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">LiteLLM ──► Langfuse               ← trace every call</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">LiteLLM ──► Postgres               ← virtual keys, spend tracking</span><br></div></code></pre></div></div>
<p>LiteLLM exposes a single OpenAI-compatible endpoint. Every consumer uses the same <code>/v1/chat/completions</code> API regardless of whether the request ends up on a local Ollama instance or a cloud provider. Switching a team from GPT-4o to Mistral Large requires no code changes on their side — only a configuration change in the gateway.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="local-first-routing-with-automatic-cloud-fallback">Local-First Routing With Automatic Cloud Fallback<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#local-first-routing-with-automatic-cloud-fallback" class="hash-link" aria-label="Direct link to Local-First Routing With Automatic Cloud Fallback" title="Direct link to Local-First Routing With Automatic Cloud Fallback" translate="no">​</a></h2>
<p>The central routing principle is local-first: requests go to on-premise models by default and escalate to cloud only when local inference fails.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">router_settings</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">routing_strategy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> least</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">busy</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">num_retries</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">2</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">timeout</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">120</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cooldown_time</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">60</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">allowed_fails</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">3</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">fallbacks</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">qwen3.5:4b</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> groq</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">fallback</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> deepseek</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">chat</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">phi4-mini</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> groq</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">fallback</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> deepseek</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">chat</span><br></div></code></pre></div></div>
<p><code>least-busy</code> distributes requests across backends by in-flight count rather than round-robin. With two Ollama nodes, requests naturally balance toward whichever node is less loaded.</p>
<p>The circuit breaker is the critical piece: after 3 consecutive failures, a backend is marked degraded for 60 seconds. Without this, a hung Ollama process would absorb the full retry budget of every incoming request before timing out. With it, a degraded node is bypassed almost immediately and the request succeeds against the other backend — or against Groq if both local nodes are down.</p>
<p>Some models have <strong>no cloud fallback by design</strong>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># phi3-financial: domain-specific model, no cloud fallback</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># Financial prompts must not leave the cluster</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> phi3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">financial</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ollama/phi3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">financial</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">api_base</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> http</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//ollama</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">primary.ai.svc.cluster.local</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">11434</span><br></div></code></pre></div></div>
<p>The domain-specific fine-tuned model, vision models, and the embedding model are local-only. The gateway enforces this — there is no code path where a financial prompt reaches an external API.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="department-level-access-control">Department-Level Access Control<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#department-level-access-control" class="hash-link" aria-label="Direct link to Department-Level Access Control" title="Direct link to Department-Level Access Control" translate="no">​</a></h2>
<p>Virtual keys map each department to a set of constraints: allowed models, token rate limits, request rate limits, and a monthly budget cap.</p>
<p>Three tiers cover different risk profiles:</p>
<table><thead><tr><th>Tier</th><th>Token limit</th><th>Request limit</th><th>Monthly budget</th><th>Model access</th></tr></thead><tbody><tr><td><strong>premium</strong></td><td>200k TPM</td><td>500 RPM</td><td>$100</td><td>All models including GPT-4o, Claude, Nemotron</td></tr><tr><td><strong>standard</strong></td><td>100k TPM</td><td>200 RPM</td><td>$30</td><td>Local models + Groq, DeepSeek, Mistral Small, GPT-4o-mini</td></tr><tr><td><strong>basic</strong></td><td>50k TPM</td><td>100 RPM</td><td>$5</td><td>Local models only</td></tr></tbody></table>
<p>Each department gets its own key, stored in Vault. When a department's key hits its budget limit, LiteLLM returns HTTP 429 (<code>BudgetExceededError</code>) and the reset happens automatically at the start of the next billing period.</p>
<p>The key metadata — department name, tier, budget — travels through to Langfuse and the Grafana cost dashboard. You can see, per department, how much they have spent, what percentage of their budget is consumed, and which models they are actually using.</p>
<p>This is the kind of visibility that is impossible with direct API keys. When your actuarial team spends $87 of their $100 monthly budget in the first week by routing everything through GPT-4o, you know immediately — and you can have the conversation about model selection before the overage hits.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pii-protection-before-data-leaves-your-network">PII Protection Before Data Leaves Your Network<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#pii-protection-before-data-leaves-your-network" class="hash-link" aria-label="Direct link to PII Protection Before Data Leaves Your Network" title="Direct link to PII Protection Before Data Leaves Your Network" translate="no">​</a></h2>
<p>The most important guardrail is the one that runs before every cloud-bound request: a PII scrubber powered by Microsoft Presidio.</p>
<p>Presidio runs as two in-cluster services — an analyzer that detects PII entity types and an anonymizer that replaces them with typed placeholders. LiteLLM calls them as a <code>pre_call</code> guardrail before forwarding any prompt to an external API.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">"Client jean.dupont@acme.fr, phone +33612345678, wants a quote for policy 78441"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ↓  Presidio pre_call guardrail</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">"Client &lt;EMAIL_ADDRESS&gt;, phone &lt;PHONE_NUMBER&gt;, wants a quote for policy &lt;IN_PAN&gt;"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        ↓  sent to cloud model (GPT-4o, Claude, Mistral, etc.)</span><br></div></code></pre></div></div>
<p>Local models are unaffected — they receive the original prompt because the data never leaves the cluster. Cloud models receive only the anonymized version.</p>
<p>The guardrail runs <code>default_on: true</code>, meaning it is active on every request without any opt-in required. Developers do not need to know it exists. It simply runs.</p>
<p>One important scope decision: the guardrail applies only to <strong>input</strong>. It does not anonymize model responses. This is intentional. Presidio's entity detection is aggressive — it will classify country names, historical figures, and dates as <code>&lt;LOCATION&gt;</code>, <code>&lt;PERSON&gt;</code>, and <code>&lt;DATE_TIME&gt;</code> respectively. A response to a general knowledge question would become unreadable. The compliance goal is protecting user data sent <em>to</em> cloud providers, not transforming what comes back.</p>
<p>A second guardrail runs in parallel using the <code>detect-secrets</code> library, which scans every prompt for credential patterns — API keys, tokens, connection strings. Prompts containing high-confidence real credentials are rejected with HTTP 400 before they reach any model.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="prompt-caching-for-speed-and-cost">Prompt Caching for Speed and Cost<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#prompt-caching-for-speed-and-cost" class="hash-link" aria-label="Direct link to Prompt Caching for Speed and Cost" title="Direct link to Prompt Caching for Speed and Cost" translate="no">​</a></h2>
<p>Identical prompts — same model, same message content — return a cached response from Valkey (Redis-compatible) without hitting inference.</p>
<p>The performance difference is significant: an 80ms cache hit versus a 2,500ms cold call to a local model, or a 600ms cold call to a cloud API. For RAG pipelines that call the same model repeatedly with similar retrieval context, the cache hit rate can be 40–60%.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">litellm_settings</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cache</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cache_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> redis</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">host</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> litellm</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">cache.ai.svc.cluster.local</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">port</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">6379</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">ttl</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">600</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> litellm</span><br></div></code></pre></div></div>
<p>The TTL of 10 minutes is a deliberate trade-off. It is long enough to capture repeated queries in an interactive session but short enough that evolving context — a document being edited, a dataset being updated — does not return stale answers for more than a few minutes.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="full-observability-langfuse--grafana">Full Observability: Langfuse + Grafana<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#full-observability-langfuse--grafana" class="hash-link" aria-label="Direct link to Full Observability: Langfuse + Grafana" title="Direct link to Full Observability: Langfuse + Grafana" translate="no">​</a></h2>
<p>Every request produces a Langfuse trace containing the model used, token counts, latency, cost estimate, department key, and whether guardrails were triggered. The trace is available at the span level — you can inspect the raw prompt, the PII-masked version that was forwarded, and the response.</p>
<p>For cost reporting, a Grafana dashboard queries the LiteLLM PostgreSQL spend tables directly. Eight panels cover the metrics that actually matter in production:</p>
<ul>
<li class="">Total spend and token usage last 24 hours</li>
<li class="">Department budget utilisation with colour thresholds (green / amber / red)</li>
<li class="">Token and request breakdown by model last 30 days</li>
<li class="">An audit trail of the last 50 requests with department attribution</li>
</ul>
<p>The budget utilisation table is the one that gets shared with management. It shows, at a glance, whether any department is approaching their limit — and allows informed conversations about quota adjustments before limits are hit.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-makes-the-gateway-approach-scale">What Makes the Gateway Approach Scale<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#what-makes-the-gateway-approach-scale" class="hash-link" aria-label="Direct link to What Makes the Gateway Approach Scale" title="Direct link to What Makes the Gateway Approach Scale" translate="no">​</a></h2>
<p>The single most valuable property of this architecture is that <strong>adding a new model requires no changes to consumers</strong>.</p>
<p>When a new Ollama model is pulled, it appears in the LiteLLM model list and is immediately available to every team with the right tier. When a cloud provider releases a better model, the swap happens in a single config change — the department-level rate limits, PII guardrails, and cost tracking continue working exactly as before.</p>
<p>The inverse is also true: removing a model, changing a provider, or adjusting a department's budget all happen centrally, with immediate effect, without touching any consumer code.</p>
<p>This is what separates an AI gateway from a collection of API keys. The keys give you access. The gateway gives you control.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="running-it-on-kubernetes">Running It on Kubernetes<a href="https://docs.devandre.sbs/blog/enterprise-ai-gateway-litellm#running-it-on-kubernetes" class="hash-link" aria-label="Direct link to Running It on Kubernetes" title="Direct link to Running It on Kubernetes" translate="no">​</a></h2>
<p>All components run in the <code>ai</code> namespace, managed by a single ArgoCD application. The gateway itself is stateless — it can be scaled horizontally behind a ClusterIP service. The only stateful components are PostgreSQL (for spend tracking and virtual keys) and Valkey (for the prompt cache), both on Longhorn persistent volumes.</p>
<p>The NetworkPolicy setup is worth noting: only LiteLLM pods have egress to port 443. Ollama and Open WebUI are internet-blocked by policy. This means that even if an application-level bug bypassed the gateway, there is no path for Ollama to contact an external API directly.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Only litellm pods can reach external cloud APIs</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">networkPolicy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> allow</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">litellm</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">cloud</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">egress</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">podSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchLabels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> litellm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">egress</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">ports</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">port</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">443</span><br></div></code></pre></div></div>
<p>For organisations that need to demonstrate data controls — whether to auditors, to legal, or to a DPO — this kind of network-layer enforcement is far stronger than an application-level promise.</p>
<hr>
<p>The complete configuration — LiteLLM proxy config, guardrail definitions, NetworkPolicies, Langfuse integration, Grafana dashboard — is documented in the AI Gateway section of the platform documentation.</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>litellm</category>
            <category>kubernetes</category>
            <category>enterprise</category>
            <category>mlops</category>
            <category>self-hosted</category>
            <category>data-sovereignty</category>
            <category>presidio</category>
            <category>langfuse</category>
            <category>ollama</category>
            <category>vllm</category>
            <category>rgpd</category>
            <category>gdpr</category>
        </item>
        <item>
            <title><![CDATA[We Replaced Ollama With vLLM on CPU-Only Kubernetes — Here Is What Changed]]></title>
            <link>https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes</link>
            <guid>https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes</guid>
            <pubDate>Sat, 08 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[We ran Ollama in production on bare-metal ThinkPads with no GPU. Then we replaced it with vLLM. This is the honest account of what broke, what improved, and what the right tool actually is for CPU-only inference in a real cluster.]]></description>
            <content:encoded><![CDATA[<p>Most write-ups about vLLM versus Ollama assume you have a GPU. The benchmarks show impressive VRAM utilisation. The architecture diagrams include CUDA drivers. The recommendation — vLLM wins — comes with an implicit asterisk: <em>assuming you have the hardware for it</em>.</p>
<p>We did not. Our inference cluster is four ThinkPad laptops, each with an i7-8565U (4 cores, 8 threads, up to 4.6 GHz turbo), 16 GB of RAM, and no GPU of any kind. We ran Ollama first. Then we replaced it with vLLM. This is the honest account of that migration: what broke, what improved, and what the tradeoffs actually look like when you run LLM inference on commodity x86 CPUs.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-we-started-with-ollama">Why We Started With Ollama<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#why-we-started-with-ollama" class="hash-link" aria-label="Direct link to Why We Started With Ollama" title="Direct link to Why We Started With Ollama" translate="no">​</a></h2>
<p>Ollama's appeal is real. You pull a model in one command, you get an OpenAI-compatible API, and it works immediately. For a single developer querying a model locally, or for a small team validating whether a self-hosted model is useful at all, there is nothing faster to get started with.</p>
<p>We deployed Ollama as two instances — primary on one ThinkPad, secondary on another — and placed LiteLLM in front of them as a proxy. This gave us model routing, virtual API keys, and Langfuse tracing from day one, without Ollama needing to provide any of those features itself. The setup was intentional: we knew Ollama was not a production server, so we compensated at the proxy layer.</p>
<p>For low concurrency it worked. A single user asking a question about a financial document got a response in 15–25 seconds for a 4B model. Acceptable for internal tooling where users understood the latency.</p>
<p>Then we tried to use it for anything beyond that.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-broke-under-real-load">What Broke Under Real Load<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#what-broke-under-real-load" class="hash-link" aria-label="Direct link to What Broke Under Real Load" title="Direct link to What Broke Under Real Load" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="sequential-processing-is-not-a-configuration-issue">Sequential processing is not a configuration issue<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#sequential-processing-is-not-a-configuration-issue" class="hash-link" aria-label="Direct link to Sequential processing is not a configuration issue" title="Direct link to Sequential processing is not a configuration issue" translate="no">​</a></h3>
<p>Ollama processes one request at a time. When a second request arrives while the first is still generating, it waits. Not in a queue that feeds continuously — it waits for the entire first response to complete before a single token is generated for the second user.</p>
<p>On a CPU with a 4B model taking 20 seconds to respond, two simultaneous users means one of them waits 40 seconds. Five simultaneous users means the last one waits nearly two minutes before their response starts. This is not something you tune away. It is the architecture.</p>
<p>For a RAG pipeline that calls the model in a loop — one call to rerank chunks, one to synthesise an answer, one to generate a follow-up question — you are serialising what should be parallel work. Three sequential calls on a 20-second model is a minute of wall-clock time for a single user query.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="no-metrics-no-visibility">No metrics, no visibility<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#no-metrics-no-visibility" class="hash-link" aria-label="Direct link to No metrics, no visibility" title="Direct link to No metrics, no visibility" translate="no">​</a></h3>
<p>Ollama exposes nothing to Prometheus. No queue depth. No time-to-first-token. No token throughput. No error rates.</p>
<p>When a model started responding slowly — which happened regularly as the loaded model competed for memory with other cluster workloads — we had no signal from Ollama itself. We saw latency spikes in Langfuse traces (because every LiteLLM call was traced), but we could not distinguish between "Ollama is slow" and "the model is doing something computationally expensive" or "the node is memory-constrained". The lack of internal metrics made capacity planning impossible.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="memory-pressure-without-visibility">Memory pressure without visibility<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#memory-pressure-without-visibility" class="hash-link" aria-label="Direct link to Memory pressure without visibility" title="Direct link to Memory pressure without visibility" translate="no">​</a></h3>
<p>A 4B model at 4-bit quantisation is roughly 2.5 GB in memory. Loading two models simultaneously — which Ollama will do if <code>OLLAMA_MAX_LOADED_MODELS</code> is set above one — consumes 5+ GB of system RAM just for model weights. On a 16 GB node running k3s, Longhorn iSCSI, and various other pods, this leaves limited headroom.</p>
<p>Ollama does not tell you its current memory usage in any structured way. You can see the process memory in <code>kubectl top</code>, but you cannot see the split between model weights, KV cache, and pending request buffers. When the node started evicting pods due to memory pressure, we found out from Kubernetes events rather than from Ollama.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-migration-to-vllm">The Migration to vLLM<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#the-migration-to-vllm" class="hash-link" aria-label="Direct link to The Migration to vLLM" title="Direct link to The Migration to vLLM" translate="no">​</a></h2>
<p>vLLM v0.6.6 supports CPU inference via <code>--device=cpu</code>. It is not the primary use case — the vLLM team optimises heavily for NVIDIA CUDA — but the CPU backend is functional and receives the same continuous batching and PagedAttention logic as the GPU path.</p>
<p>Our deployment targets the same fast-heron node (i7-8565U, 16 GB RAM) that previously ran Ollama primary:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">containers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> docker.io/vllm/vllm</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">openai</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">v0.6.6</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">model=microsoft/Phi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">mini</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4k</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">instruct</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">device=cpu</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">dtype=float16</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">env</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> VLLM_CPU_KVCACHE_SPACE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">resources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">requests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">cpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 2000m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 6Gi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">limits</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">cpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 7000m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 14Gi</span><br></div></code></pre></div></div>
<p>A few decisions worth explaining:</p>
<p><strong><code>--dtype=float16</code> on CPU.</strong> CPU inference with float16 works on modern x86 via AVX-512 or AVX2 instructions. The i7-8565U supports AVX2. Using float16 rather than float32 halves the model size in memory and reduces the arithmetic cost per token.</p>
<p><strong><code>VLLM_CPU_KVCACHE_SPACE=2</code>.</strong> This reserves 2 GB of RAM for the KV cache. On CPU, PagedAttention manages this allocation across concurrent requests. Without this setting, vLLM defaults to a conservative allocation that limits concurrency unnecessarily.</p>
<p><strong>7 CPU cores allocated.</strong> We leave one core for the OS, k3s agent, and other system processes. vLLM uses all allocated cores for parallel attention computation and tensor operations across the model's layers.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-actually-improved">What Actually Improved<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#what-actually-improved" class="hash-link" aria-label="Direct link to What Actually Improved" title="Direct link to What Actually Improved" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="concurrent-requests-work">Concurrent requests work<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#concurrent-requests-work" class="hash-link" aria-label="Direct link to Concurrent requests work" title="Direct link to Concurrent requests work" translate="no">​</a></h3>
<p>This is the primary reason for the migration. vLLM's continuous batching means that as soon as one request finishes a decoding step, the next request in the queue gets scheduled. Multiple users can be actively receiving tokens simultaneously rather than waiting in a strict serial queue.</p>
<p>For a RAG pipeline making multiple model calls per user query, this matters enormously. The LiteLLM proxy can dispatch three calls and receive responses as they complete, rather than waiting for each to finish before issuing the next.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="prometheus-metrics-are-real">Prometheus metrics are real<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#prometheus-metrics-are-real" class="hash-link" aria-label="Direct link to Prometheus metrics are real" title="Direct link to Prometheus metrics are real" translate="no">​</a></h3>
<p>vLLM's <code>/metrics</code> endpoint provides everything needed to operate the service properly:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">vllm:num_requests_running          # active concurrent requests right now</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vllm:num_requests_waiting          # queue depth — leading saturation indicator</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vllm:gpu_cache_usage_perc          # KV cache utilisation (same metric, works for CPU)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vllm:time_to_first_token_seconds   # p50/p99 TTFT histograms</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vllm:request_success_total         # request success rate by model</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vllm:num_tokens_generated          # total throughput</span><br></div></code></pre></div></div>
<p>We added a ServiceMonitor and Prometheus now scrapes these every 15 seconds. When latency spikes, we have the queue depth and cache utilisation to diagnose whether the cause is request volume, memory pressure, or model behaviour. This was simply not possible with Ollama.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="fine-tuned-model-serving">Fine-tuned model serving<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#fine-tuned-model-serving" class="hash-link" aria-label="Direct link to Fine-tuned model serving" title="Direct link to Fine-tuned model serving" translate="no">​</a></h3>
<p>We ran a QLoRA fine-tuning job in Google Colab to produce a phi3-financial adapter — a Phi-3-mini-4k-instruct base with a LoRA adapter trained on financial domain data. vLLM can load LoRA adapters and serve them as named models alongside the base:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">model=microsoft/Phi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">mini</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">4k</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">instruct</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">enable</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">lora</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">lora</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">modules</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> phi3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">financial</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">ft=/model</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">cache/phi3</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">financial</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">lora</span><br></div></code></pre></div></div>
<p>Ollama has no equivalent. If you want to serve a fine-tuned model with Ollama, you must convert it to GGUF format and create a Modelfile. vLLM loads the HuggingFace-format LoRA adapter directly, with no conversion step.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-real-tradeoffs-on-cpu">The Real Tradeoffs on CPU<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#the-real-tradeoffs-on-cpu" class="hash-link" aria-label="Direct link to The Real Tradeoffs on CPU" title="Direct link to The Real Tradeoffs on CPU" translate="no">​</a></h2>
<p>Being honest about what you give up matters as much as what you gain.</p>
<p><strong>Time to first token is slower.</strong> On a GPU, a 3B model generates first tokens in 200–500ms. On our i7-8565U with vLLM, it is 3–8 seconds depending on prompt length. For interactive chat this is noticeable. For document processing pipelines where the result matters more than the wait, it is acceptable.</p>
<p><strong>Throughput ceiling is lower.</strong> A single CPU node running vLLM with a 3B model handles roughly 4–8 tokens per second for a single request. A mid-range GPU handles 50–200 tokens per second. We compensate by sizing models conservatively (phi3-mini at 3.8B rather than llama3 at 8B) and routing heavy requests to cloud APIs via LiteLLM when local throughput is insufficient.</p>
<p><strong>One model at a time is practical.</strong> Loading two different models simultaneously on a 16 GB CPU node leaves insufficient headroom for the KV cache when concurrent requests arrive. We run vLLM with a single model loaded and handle model diversity through LiteLLM routing to cloud providers.</p>
<p><strong>Startup is slow.</strong> vLLM on CPU takes 90–120 seconds to initialise — it loads model weights into memory, quantises where applicable, and warms up the attention kernels. We set <code>initialDelaySeconds: 120</code> on the readiness probe. During rolling updates, old pods must stay live until the new pod is ready, which means 2–3 minutes of overlap where both pods are running and consuming memory.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-architecture-after-migration">The Architecture After Migration<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#the-architecture-after-migration" class="hash-link" aria-label="Direct link to The Architecture After Migration" title="Direct link to The Architecture After Migration" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">LiteLLM Gateway</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      ├── vLLM (fast-heron, CPU, Phi-3-mini) ← local fine-tuned model, data stays on-cluster</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      ├── Groq             ← auto-fallback for general queries when local is saturated</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      ├── DeepSeek         ← reasoning tasks</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      ├── Mistral / GPT-4o ← premium tier</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      └── Gemini / Claude  ← premium tier</span><br></div></code></pre></div></div>
<p>vLLM handles the local inference that must stay on-cluster — the fine-tuned domain model and any request where data sovereignty matters. Cloud providers handle general-purpose queries and premium-tier requests where latency or capability matters more than locality.</p>
<p>LiteLLM routes transparently between them. When a department's key reaches its cloud budget, requests stay local. When local is saturated (queue depth &gt; threshold via KEDA ScaledObject), the proxy escalates to the cloud fallback. The application layer sees a single API endpoint throughout.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="should-you-do-this">Should You Do This?<a href="https://docs.devandre.sbs/blog/llm-inference-cpu-kubernetes#should-you-do-this" class="hash-link" aria-label="Direct link to Should You Do This?" title="Direct link to Should You Do This?" translate="no">​</a></h2>
<p>CPU inference with vLLM is viable for models up to 4B parameters on hardware with 16 GB of RAM, when your primary requirements are data sovereignty, correct concurrent request handling, and production observability — and your secondary requirement is throughput.</p>
<p>It is not the right tool if users expect sub-second responses, if you need to serve 7B+ models locally, or if you have the budget for even a single consumer GPU. An RTX 3090 at €800 would give you 10–20× the throughput of a ThinkPad i7 for LLM inference.</p>
<p>But if you are running on commodity hardware, have a genuine data sovereignty requirement, and need a system you can actually operate — with metrics, with concurrent requests, with LoRA adapter support — vLLM on CPU is significantly better than Ollama in the same position.</p>
<p>The migration from Ollama to vLLM was not about GPU. It was about replacing a developer tool with a production server. The CPU happened to be the only hardware available. The improvement was real regardless.</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>vllm</category>
            <category>ollama</category>
            <category>inference</category>
            <category>kubernetes</category>
            <category>cpu</category>
            <category>self-hosted</category>
            <category>mlops</category>
            <category>enterprise</category>
            <category>data-sovereignty</category>
        </item>
        <item>
            <title><![CDATA[Enterprise AI Without Amazon, Microsoft, or Google: A European Perspective]]></title>
            <link>https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds</link>
            <guid>https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds</guid>
            <pubDate>Sun, 02 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[The standard advice is Bedrock, Azure OpenAI, or Vertex AI. But what about organisations that cannot or will not send their data to American servers? Here is the full picture.]]></description>
            <content:encoded><![CDATA[<p>Every article about enterprise AI ends the same way. Use Amazon Bedrock. Use Azure OpenAI Service. Use Google Vertex AI. These platforms offer enterprise-grade compliance, data privacy, and zero-training guarantees.</p>
<p>The advice is correct — for organisations that can use American cloud infrastructure.</p>
<p>A large and growing number of organisations cannot. Some because of cost. Many because of regulation. A few because their data literally cannot cross a border under the law that governs their sector.</p>
<p>This post is for those organisations. It covers two separate problems — data sovereignty and cost — and the concrete options available for each.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-the-standard-advice-falls-short-in-europe">Why the Standard Advice Falls Short in Europe<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#why-the-standard-advice-falls-short-in-europe" class="hash-link" aria-label="Direct link to Why the Standard Advice Falls Short in Europe" title="Direct link to Why the Standard Advice Falls Short in Europe" translate="no">​</a></h2>
<p>The "use Bedrock / Azure OpenAI / Vertex AI" recommendation solves a real problem: it gives you enterprise SLAs, DPAs, and no-training guarantees from a known counterparty. For a US company, or a multinational comfortable with Standard Contractual Clauses, it is a reasonable choice.</p>
<p>But it quietly assumes three things that many European organisations cannot accept:</p>
<p><strong>1. Your data will be processed in the United States.</strong></p>
<p>Even with EU data residency options, your data is processed by an American company subject to US law. Under the Cloud Act (2018), US authorities can compel American cloud providers to hand over data stored anywhere in the world — including data centres located in France or Germany. A DPA and SCCs provide contractual protection. They do not provide technical guarantees.</p>
<p><strong>2. Transfer impact assessments are manageable overhead.</strong></p>
<p>Under the CJEU's Schrems II ruling, any transfer of personal data to a third country requires a Transfer Impact Assessment demonstrating that the destination country's surveillance laws do not undermine GDPR protections. For procurement teams at mid-sized organisations, this is not a checkbox — it is a multi-week legal exercise that many simply decline to undertake.</p>
<p><strong>3. Price per token is acceptable at scale.</strong></p>
<p>At low volumes, cloud APIs are cheap. At enterprise scale — tens of thousands of employee queries per day, RAG pipelines processing thousands of documents, automated workflows calling models in loops — the cost compounds fast.</p>
<p>GPT-4o at $2.50 per million input tokens does not sound expensive until you have 500 employees using it daily for document summarisation. At 2,000 tokens per query, that is one million tokens per day, $2.50 per day — manageable. Add RAG retrieval (another 2,000 tokens per query for retrieved context) and you are at $5/day, $1,825/year, just for GPT-4o input. Multiply by actual enterprise usage patterns and multiply again for any workload that benefits from a more capable model.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="problem-1-data-sovereignty">Problem 1: Data Sovereignty<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#problem-1-data-sovereignty" class="hash-link" aria-label="Direct link to Problem 1: Data Sovereignty" title="Direct link to Problem 1: Data Sovereignty" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-regulatory-landscape-in-france">The Regulatory Landscape in France<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#the-regulatory-landscape-in-france" class="hash-link" aria-label="Direct link to The Regulatory Landscape in France" title="Direct link to The Regulatory Landscape in France" translate="no">​</a></h3>
<p>French and European organisations face a layered set of requirements depending on their sector:</p>
<p><strong>RGPD (GDPR)</strong>
The baseline for all organisations processing personal data of EU residents. Requires that data transferred outside the EU goes to a country with adequate protections, or is covered by SCCs plus a Transfer Impact Assessment. Personal data of employees, customers, or citizens cannot be sent to a third country without this legal basis.</p>
<p><strong>ACPR (banking and insurance)</strong>
The Autorité de contrôle prudentiel et de résolution supervises French banks and insurers. Its guidelines treat cloud outsourcing as a significant operational risk. While ACPR does not prohibit US cloud providers outright, institutions must demonstrate that they can exit a cloud provider without disruption and that sensitive data is protected against third-country access. Mistral AI, as a French company, sidesteps most of these concerns without requiring a Transfer Impact Assessment.</p>
<p><strong>HDS (hébergement de données de santé)</strong>
Health data in France must be hosted by an HDS-certified provider. US cloud providers can obtain HDS certification for their French data centres, but the Cloud Act exposure remains. For the most sensitive health workloads, self-hosting on certified French infrastructure eliminates the residual risk.</p>
<p><strong>SecNumCloud</strong>
ANSSI's qualification framework for cloud providers handling sensitive government data and critical infrastructure. Currently only <strong>OVHcloud</strong> and <strong>Outscale</strong> (a Dassault Systèmes subsidiary) hold this qualification. AWS, Azure, and Google Cloud do not qualify and legally cannot under the current framework, because qualification requires that the provider not be subject to non-European law that could override its data protection obligations.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="european-alternatives-that-actually-exist">European Alternatives That Actually Exist<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#european-alternatives-that-actually-exist" class="hash-link" aria-label="Direct link to European Alternatives That Actually Exist" title="Direct link to European Alternatives That Actually Exist" translate="no">​</a></h3>
<table><thead><tr><th>Provider</th><th>Country</th><th>Regulatory story</th><th>Models available</th></tr></thead><tbody><tr><td><strong>Mistral AI</strong></td><td>🇫🇷 France</td><td>French company, RGPD-compliant, no US law exposure, API with DPA available</td><td>Mistral 7B, Mistral NeMo, Mistral Large, Codestral</td></tr><tr><td><strong>OVHcloud AI Endpoints</strong></td><td>🇫🇷 France</td><td>SecNumCloud-qualified, HDS-certified data centres, data never leaves France</td><td>Open models (Llama, Mistral, etc.) via hosted endpoints</td></tr><tr><td><strong>Aleph Alpha</strong></td><td>🇩🇪 Germany</td><td>German company, DSGVO-first design, on-premise deployable</td><td>Luminous family (multilingual, strong on German/French)</td></tr><tr><td><strong>Scaleway</strong></td><td>🇫🇷 France</td><td>French infrastructure, competitive GPU rental pricing</td><td>Bring your own model via GPU instances or managed endpoints</td></tr></tbody></table>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="mistral-ai-the-default-answer-for-french-enterprises">Mistral AI: The Default Answer for French Enterprises<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#mistral-ai-the-default-answer-for-french-enterprises" class="hash-link" aria-label="Direct link to Mistral AI: The Default Answer for French Enterprises" title="Direct link to Mistral AI: The Default Answer for French Enterprises" translate="no">​</a></h3>
<p>Mistral AI, founded in Paris in 2023, is the clearest answer to the data sovereignty question for most French organisations.</p>
<p><strong>The API path:</strong> <code>la-plateforme.mistral.ai</code> provides a standard OpenAI-compatible API backed by French infrastructure, under a French DPA, with no Transfer Impact Assessment required. Mistral Small (7B-class) is €0.10 per million tokens — comparable to GPT-3.5-Turbo pricing — with Mistral Large available at €2 per million for complex reasoning tasks.</p>
<p><strong>The self-host path:</strong> Mistral releases the weights of its smaller models openly (Mistral 7B, Mistral NeMo 12B, Codestral 22B). You can download the weights, run them on your own GPU infrastructure, and your prompts never touch any external server. No API. No DPA needed. No Transfer Impact Assessment. No data leaves your network.</p>
<p>The pitch to a French enterprise compliance officer is simple: <em>"The model runs on our servers in France. Here is the network egress log showing zero outbound connections to any AI provider during these queries."</em> That is a fundamentally different level of assurance than "we have a DPA with Microsoft."</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="problem-2-cost">Problem 2: Cost<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#problem-2-cost" class="hash-link" aria-label="Direct link to Problem 2: Cost" title="Direct link to Problem 2: Cost" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-real-cost-of-cloud-apis-at-scale">The Real Cost of Cloud APIs at Scale<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#the-real-cost-of-cloud-apis-at-scale" class="hash-link" aria-label="Direct link to The Real Cost of Cloud APIs at Scale" title="Direct link to The Real Cost of Cloud APIs at Scale" translate="no">​</a></h3>
<p>The per-token pricing of cloud AI APIs has dropped dramatically over the past two years, which makes the cost argument harder to make at small scale. But enterprise deployments do not operate at small scale.</p>
<p>Consider a 200-person finance team using AI for:</p>
<ul>
<li class="">Daily portfolio briefings: 5,000 tokens per user × 200 users = 1M tokens/day</li>
<li class="">Document analysis: 20,000 tokens per document × 50 documents/day = 1M tokens/day</li>
<li class="">Internal chatbot queries: 2,000 tokens × 500 queries/day = 1M tokens/day</li>
</ul>
<p>At 3M tokens/day, using GPT-4o-mini ($0.15/1M input + $0.60/1M output, roughly $0.40/1M blended):</p>
<p><strong>Monthly cost: 3M × 30 × $0.40 / 1M = $36/month</strong></p>
<p>That is remarkably cheap. Scale to a 2,000-person organisation with similar usage:</p>
<p><strong>Monthly cost: $360/month</strong></p>
<p>Still cheap. Now use GPT-4o instead of mini ($2.50 blended per million):</p>
<p><strong>Monthly cost at 2,000 users: $2,250/month = $27,000/year</strong></p>
<p>Add a RAG pipeline that doubles token consumption per query. Add a code review agent running on every pull request. Add automated document classification across a document management system with 10,000 new documents per month. The numbers scale with your ambition, and at some point self-hosting becomes the cheaper option.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-self-hosting-math">The Self-Hosting Math<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#the-self-hosting-math" class="hash-link" aria-label="Direct link to The Self-Hosting Math" title="Direct link to The Self-Hosting Math" translate="no">​</a></h3>
<p>A single NVIDIA A100 80GB GPU costs approximately €3/hour on OVHcloud bare-metal. Running Mistral 7B Q4_K_M (quantised to 4-bit):</p>
<ul>
<li class=""><strong>Throughput:</strong> approximately 400 tokens/second at full capacity</li>
<li class=""><strong>Daily cost:</strong> €72 (24 hours at €3/hr)</li>
<li class=""><strong>Daily capacity:</strong> 400 tok/s × 86,400s = 34.5 million tokens</li>
</ul>
<p>At the same 3M tokens/day usage as the example above: <strong>your GPU is idle 91% of the time.</strong> You are paying €72/day to generate tokens that cost €1.20/day on GPT-4o-mini.</p>
<p>The crossover point with GPT-4o-mini is approximately 18M tokens/day — which requires a large organisation with heavy AI integration. Below that, cloud APIs are cheaper on pure token cost.</p>
<p><strong>But token cost is not the only variable.</strong> Once you add:</p>
<ul>
<li class="">Data sovereignty requirements (non-negotiable for regulated sectors)</li>
<li class="">The ability to fine-tune on proprietary data without sending that data to a provider</li>
<li class="">Predictable cost regardless of usage spikes</li>
<li class="">No rate limits or quota exhaustion during peak demand</li>
</ul>
<p>…the self-hosting calculation shifts significantly in favour of owning the GPU.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-architecture-that-makes-both-work">The Architecture That Makes Both Work<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#the-architecture-that-makes-both-work" class="hash-link" aria-label="Direct link to The Architecture That Makes Both Work" title="Direct link to The Architecture That Makes Both Work" translate="no">​</a></h2>
<p>The good news is that you do not have to choose between cloud APIs and self-hosted models permanently. The right architecture lets you use both simultaneously, switch between them without application changes, and add new backends as they become relevant.</p>
<p>That architecture is a <strong>model-agnostic proxy</strong> — a single endpoint your applications call, which routes requests to whatever backend is most appropriate.</p>
<p><a href="https://github.com/BerriAI/litellm" target="_blank" rel="noopener noreferrer" class="">LiteLLM</a> is the open-source implementation of this pattern. It accepts OpenAI-format requests and forwards them to any backend: OpenAI, Anthropic, Mistral, Groq, a self-hosted vLLM instance, or any other OpenAI-compatible endpoint.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># The full model_list in a LiteLLM config.yaml</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">model_list</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># European cloud API — Mistral, French company, EU data residency</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> mistral</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">small</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> mistral/mistral</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">small</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">api_key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> os.environ/MISTRAL_API_KEY</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Self-hosted vLLM on your own GPU — zero data leaves the cluster</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> mistral</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">7b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">local</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> openai/mistralai/Mistral</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">7B</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">Instruct</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">v0.3</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">api_base</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> http</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//vllm.ai.svc.cluster.local</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">8000/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">api_key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> token</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">internal</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Cloud fallback for burst capacity</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> groq</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">fast</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> groq/llama</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3.1</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">instant</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">api_key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> os.environ/GROQ_API_KEY</span><br></div></code></pre></div></div>
<p>Your application calls one endpoint — <code>https://litellm.yourdomain.com/v1/chat/completions</code> — and specifies a model name. The proxy handles routing, retries, fallbacks, and rate limiting. You can move traffic from Groq to Mistral to your own GPU without touching a single line of application code.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-stays-the-same-regardless-of-backend">What Stays the Same Regardless of Backend<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#what-stays-the-same-regardless-of-backend" class="hash-link" aria-label="Direct link to What Stays the Same Regardless of Backend" title="Direct link to What Stays the Same Regardless of Backend" translate="no">​</a></h3>
<p>When you route through a proxy layer, the entire observability and governance stack applies uniformly to every backend:</p>
<ul>
<li class=""><strong>Langfuse tracing</strong> — every request logged with user, model, latency, token count, and cost</li>
<li class=""><strong>Presidio PII masking</strong> — prompts scrubbed before they reach any provider</li>
<li class=""><strong>Rate limiting</strong> — per-team or per-role token budgets enforced at the proxy</li>
<li class=""><strong>RBAC</strong> — virtual keys per department, with model allowlists per key</li>
<li class=""><strong>Prometheus metrics</strong> — request rates, error rates, cost per model per team</li>
</ul>
<p>Switch from Groq to your own GPU: the Langfuse trace still appears. The PII masking still runs. The rate limit still applies. The cost dashboard still updates (with zero for self-hosted requests, since there is no token billing).</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-french-enterprise-pitch">The French Enterprise Pitch<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#the-french-enterprise-pitch" class="hash-link" aria-label="Direct link to The French Enterprise Pitch" title="Direct link to The French Enterprise Pitch" translate="no">​</a></h2>
<p>If you are a consultant or platform engineer working with French organisations, the conversation often goes like this:</p>
<p><strong>Client:</strong> "We want to use AI but our legal team says we cannot send client data to ChatGPT."</p>
<p><strong>Standard advice:</strong> "Use Azure OpenAI with EU data residency and a DPA."</p>
<p><strong>Better answer:</strong> "We run Mistral 7B on OVHcloud SecNumCloud infrastructure in Gravelines, France. Your data never leaves French soil, never touches an American server, and we can prove it with egress logs. When you need a more powerful model for complex reasoning, we route to Mistral Large — still French infrastructure, still the same DPA."</p>
<p>The key difference: the better answer gives the client a <em>technical guarantee</em> rather than a <em>contractual guarantee</em>. A DPA tells you what the provider promises to do with your data. Network logs tell you what actually happened.</p>
<p>For the ACPR, for the CNIL, and for any compliance team that has been through a Schrems II Transfer Impact Assessment, the difference between "we have contractual protections" and "we have zero outbound connections to foreign servers" is very significant.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="where-to-start">Where to Start<a href="https://docs.devandre.sbs/blog/enterprise-ai-beyond-us-clouds#where-to-start" class="hash-link" aria-label="Direct link to Where to Start" title="Direct link to Where to Start" translate="no">​</a></h2>
<table><thead><tr><th>Your situation</th><th>Recommended path</th></tr></thead><tbody><tr><td>Regulated sector (banking, insurance, health), data cannot leave France</td><td>Mistral API via <code>la-plateforme.mistral.ai</code> for quick start; self-hosted vLLM on OVHcloud GPU for full sovereignty</td></tr><tr><td>Government or OIV, SecNumCloud required</td><td>OVHcloud AI Endpoints (qualified); or self-hosted on OVHcloud or Outscale bare-metal</td></tr><tr><td>Cost is the primary constraint, no hard sovereignty requirement</td><td>Groq (free tier, fast) + Mistral Small (cheap, EU) + self-hosted when volume justifies hardware</td></tr><tr><td>Want full control, no external dependencies</td><td>vLLM on your own GPU infrastructure with open Mistral or Llama weights</td></tr><tr><td>Starting out, unsure</td><td>Mistral API + LiteLLM proxy; add self-hosted backends when requirements become clear</td></tr></tbody></table>
<p>The pattern that works at every scale: build on a model-agnostic proxy from day one. Your application does not know whether the model is running in Paris, Frankfurt, or the server room down the hall — and it should not need to.</p>]]></content:encoded>
            <category>ai</category>
            <category>enterprise</category>
            <category>data-sovereignty</category>
            <category>mistral</category>
            <category>vllm</category>
            <category>litellm</category>
            <category>rgpd</category>
            <category>gdpr</category>
            <category>secnumcloud</category>
            <category>mlops</category>
            <category>kubernetes</category>
        </item>
        <item>
            <title><![CDATA[Why Enterprises Should Run vLLM Instead of Ollama for AI Inference]]></title>
            <link>https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference</link>
            <guid>https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference</guid>
            <pubDate>Sun, 02 Aug 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Ollama is a great developer tool. vLLM is what you run when real users are waiting. Here is exactly why the difference matters — and what changes when you move from one to the other.]]></description>
            <content:encoded><![CDATA[<p>Ollama is how most teams first run a large language model locally. You install it in five minutes, run <code>ollama pull mistral</code>, and you have a working API. It feels like magic.</p>
<p>Then you try to serve ten users at once. Or a hundred. Or you need to audit every request for compliance. Or your legal team asks where the data goes. That is when you realise Ollama was built for something else entirely.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ollama-is-a-developer-tool">Ollama Is a Developer Tool<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#ollama-is-a-developer-tool" class="hash-link" aria-label="Direct link to Ollama Is a Developer Tool" title="Direct link to Ollama Is a Developer Tool" translate="no">​</a></h2>
<p>This is not a criticism. Ollama is genuinely excellent at what it is designed for: making it effortless for a single developer to run a model locally for experimentation, prototyping, and exploration. The model management, the simple CLI, the one-command API server — all of it is optimised for the experience of one person on one machine.</p>
<p>The problem starts when you try to carry that tool into production.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-request-at-a-time">One request at a time<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#one-request-at-a-time" class="hash-link" aria-label="Direct link to One request at a time" title="Direct link to One request at a time" translate="no">​</a></h3>
<p>Ollama processes requests sequentially. If two users send a prompt at the same moment, the second one waits for the first to finish completely before a single token is generated for them.</p>
<p>On a fast GPU this might add a second or two of latency. On a CPU cluster — which is where most self-hosted deployments actually run — a 7B model can take 30 to 60 seconds to generate a response. With sequential processing, ten concurrent users means user ten waits up to ten minutes.</p>
<p>This is not a configuration issue. It is a design choice appropriate for its target use case: a developer who sends one request at a time.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="memory-that-cannot-be-shared">Memory that cannot be shared<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#memory-that-cannot-be-shared" class="hash-link" aria-label="Direct link to Memory that cannot be shared" title="Direct link to Memory that cannot be shared" translate="no">​</a></h3>
<p>Every active Ollama request reserves its own slice of GPU or system memory for the key-value cache — the data structure that stores the model's "memory" of the current conversation. When the request finishes, that memory is freed.</p>
<p>There is no mechanism for Ollama to let requests share GPU memory intelligently, to page out inactive contexts, or to reuse cached attention states across requests with the same prefix. Each request starts from scratch.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="no-production-observability">No production observability<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#no-production-observability" class="hash-link" aria-label="Direct link to No production observability" title="Direct link to No production observability" translate="no">​</a></h3>
<p>Ollama exposes no Prometheus metrics, no structured request logs, no latency histograms, no token throughput counters. You cannot build an SLO dashboard around it. You cannot alert on p99 latency or set up autoscaling based on queue depth. You cannot audit which user sent which prompt.</p>
<p>For a personal laptop, none of this matters. For a system processing requests from a company's employees, all of it matters.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="vllm-is-an-inference-engine">vLLM Is an Inference Engine<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#vllm-is-an-inference-engine" class="hash-link" aria-label="Direct link to vLLM Is an Inference Engine" title="Direct link to vLLM Is an Inference Engine" translate="no">​</a></h2>
<p>vLLM was built at UC Berkeley and is maintained by a team whose sole focus is serving language models efficiently in production. Every design decision is oriented around throughput, latency, and resource utilisation under real concurrent load.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="continuous-batching">Continuous batching<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#continuous-batching" class="hash-link" aria-label="Direct link to Continuous batching" title="Direct link to Continuous batching" translate="no">​</a></h3>
<p>This is the most important difference.</p>
<p>Traditional inference servers (including Ollama) process a batch of requests, wait for all of them to finish, then start the next batch. This means fast requests waste time waiting for slow ones in the same batch.</p>
<p>vLLM uses <strong>continuous batching</strong> (also called iteration-level scheduling). The moment any request in the current batch finishes generating a token, a new request from the queue immediately takes its slot. The GPU never waits. Every compute cycle is spent generating tokens for someone.</p>
<p>The practical result: under concurrent load, vLLM serves between 10 and 50 times more tokens per second than a sequential server on the same hardware. This is not marketing copy — it is the measured result of replacing batch boundaries with continuous scheduling.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Ollama (sequential):</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 1: [========== 8s ==========]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 2:                            [========== 8s ==========]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 3:                                                       [== 8s ==]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  Total time for 3 users: 24s</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">vLLM (continuous batching):</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 1: [========== 8s ==========]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 2:     [========== 8s ==========]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  User 3:         [========== 8s ==========]</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  Total time for 3 users: ~10s</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="pagedattention">PagedAttention<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#pagedattention" class="hash-link" aria-label="Direct link to PagedAttention" title="Direct link to PagedAttention" translate="no">​</a></h3>
<p>The key-value cache for a long conversation can be several gigabytes. Managing this naively — allocating a large contiguous block per request, holding it for the full duration — wastes most of the allocated memory most of the time.</p>
<p>vLLM implements <strong>PagedAttention</strong>: it treats the KV cache like virtual memory in an operating system, dividing it into fixed-size pages and allocating only the pages actually needed at each decoding step. Pages from completed requests are immediately reclaimed and reused.</p>
<p>The result is that vLLM can serve three to four times as many concurrent conversations in the same GPU memory as a naive implementation. On a 24 GB GPU running a 7B model, the difference between wasting and efficiently paging that memory is the difference between four concurrent users and sixteen.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="openai-compatible-api--identical-to-what-you-already-use">OpenAI-compatible API — identical to what you already use<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#openai-compatible-api--identical-to-what-you-already-use" class="hash-link" aria-label="Direct link to OpenAI-compatible API — identical to what you already use" title="Direct link to OpenAI-compatible API — identical to what you already use" translate="no">​</a></h3>
<p>vLLM exposes the exact same HTTP API as OpenAI: <code>/v1/chat/completions</code>, <code>/v1/completions</code>, <code>/v1/embeddings</code>. If your application already calls the OpenAI API, it calls vLLM without any code change.</p>
<p>In a LiteLLM proxy configuration, switching from a cloud model to a self-hosted vLLM instance is a single config change:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># Before: cloud API</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> qwen2.5</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">7b</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> groq/llama</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">3.1</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">8b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">instant</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">api_key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> os.environ/GROQ_API_KEY</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># After: self-hosted vLLM — same proxy, same API surface, no application changes</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">model_name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> qwen2.5</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">7b</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> openai/Qwen/Qwen2.5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">7B</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">Instruct</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">api_base</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> http</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//vllm.ai.svc.cluster.local</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">8000/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">api_key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> token</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">local</span><br></div></code></pre></div></div>
<p>All guardrails, Langfuse tracing, PII masking, and rate limiting continue to work identically.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="production-grade-observability-out-of-the-box">Production-grade observability out of the box<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#production-grade-observability-out-of-the-box" class="hash-link" aria-label="Direct link to Production-grade observability out of the box" title="Direct link to Production-grade observability out of the box" translate="no">​</a></h3>
<p>vLLM exposes a Prometheus <code>/metrics</code> endpoint that includes:</p>
<table><thead><tr><th>Metric</th><th>What it tells you</th></tr></thead><tbody><tr><td><code>vllm:num_requests_running</code></td><td>Active concurrent requests</td></tr><tr><td><code>vllm:num_requests_waiting</code></td><td>Queue depth — leading indicator of saturation</td></tr><tr><td><code>vllm:gpu_cache_usage_perc</code></td><td>KV cache utilisation — when this hits 90%, you need more memory</td></tr><tr><td><code>vllm:time_to_first_token_seconds</code></td><td>p50/p99 time-to-first-token — the user-facing latency metric</td></tr><tr><td><code>vllm:request_success_total</code></td><td>Request success rate by model</td></tr><tr><td><code>vllm:num_tokens_generated</code></td><td>Token throughput</td></tr></tbody></table>
<p>You can build a complete Grafana dashboard, set SLO alerts, and wire autoscaling from these metrics. With Ollama you cannot.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="multi-gpu-tensor-parallelism">Multi-GPU tensor parallelism<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#multi-gpu-tensor-parallelism" class="hash-link" aria-label="Direct link to Multi-GPU tensor parallelism" title="Direct link to Multi-GPU tensor parallelism" translate="no">​</a></h3>
<p>If you run a model that does not fit in one GPU's memory, vLLM distributes the model's weights across multiple GPUs automatically using tensor parallelism. You set <code>tensor_parallel_size: 2</code> and the 70B model that needs 40 GB fits across two 24 GB cards.</p>
<p>Ollama does not support this.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-enterprise-requirements-vllm-meets">The Enterprise Requirements vLLM Meets<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#the-enterprise-requirements-vllm-meets" class="hash-link" aria-label="Direct link to The Enterprise Requirements vLLM Meets" title="Direct link to The Enterprise Requirements vLLM Meets" translate="no">​</a></h2>
<p>Beyond raw performance, vLLM satisfies requirements that appear in enterprise procurement checklists and security audits.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="data-sovereignty">Data sovereignty<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#data-sovereignty" class="hash-link" aria-label="Direct link to Data sovereignty" title="Direct link to Data sovereignty" translate="no">​</a></h3>
<p>When vLLM runs inside your Kubernetes cluster, no data leaves your network. Prompts, completions, user identifiers — none of it touches an external API. You can demonstrate this with network policies and egress logs, which is exactly what a CISO or a French ACPR compliance officer will ask for.</p>
<p>Cloud APIs — even enterprise-tier ones with DPAs — require you to trust the provider's infrastructure. Self-hosted vLLM removes that dependency entirely.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="audit-trail">Audit trail<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#audit-trail" class="hash-link" aria-label="Direct link to Audit trail" title="Direct link to Audit trail" translate="no">​</a></h3>
<p>vLLM logs every request with token counts, latency, and model ID. Feeding these logs into your observability stack (Loki, Elasticsearch) gives you a complete audit log: which user sent what, when, how long it took, how many tokens were consumed.</p>
<p>For regulated industries (finance, insurance, healthcare), the ability to produce this log on demand is often a legal requirement.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="no-vendor-lock-in">No vendor lock-in<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#no-vendor-lock-in" class="hash-link" aria-label="Direct link to No vendor lock-in" title="Direct link to No vendor lock-in" translate="no">​</a></h3>
<p>vLLM runs any Hugging Face model — Mistral, Llama, Qwen, Phi, Gemma, Falcon, DeepSeek. You switch models by changing the <code>model</code> argument. You are not bound to any commercial provider's model selection, pricing changes, or API deprecation schedule.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="rbac-integration">RBAC integration<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#rbac-integration" class="hash-link" aria-label="Direct link to RBAC integration" title="Direct link to RBAC integration" translate="no">​</a></h3>
<p>vLLM's API key mechanism integrates with your existing IAM. In a Kubernetes deployment behind LiteLLM, you add a virtual key per team or role, set rate limits and model allowlists per key, and enforce them at the proxy layer — all without touching vLLM's configuration.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="when-ollama-still-makes-sense">When Ollama Still Makes Sense<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#when-ollama-still-makes-sense" class="hash-link" aria-label="Direct link to When Ollama Still Makes Sense" title="Direct link to When Ollama Still Makes Sense" translate="no">​</a></h2>
<p>Ollama is not obsolete. It remains the right tool for:</p>
<ul>
<li class=""><strong>A developer running models locally</strong> on a laptop during development</li>
<li class=""><strong>Exploring a new model</strong> before deciding whether to deploy it to production</li>
<li class=""><strong>A small team</strong> (&lt; 5 people) with no concurrent request requirement</li>
<li class=""><strong>CPU-only hardware</strong> where you value ease of setup over throughput</li>
</ul>
<p>The moment you have more than one user, a compliance requirement, or a throughput target, you have outgrown it.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="deployment-on-kubernetes">Deployment on Kubernetes<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#deployment-on-kubernetes" class="hash-link" aria-label="Direct link to Deployment on Kubernetes" title="Direct link to Deployment on Kubernetes" translate="no">​</a></h2>
<p>A minimal vLLM deployment on Kubernetes with a single GPU looks like this:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> apps/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Deployment</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ai</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">replicas</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">selector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchLabels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">containers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm/vllm</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">openai</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">model</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> Qwen/Qwen2.5</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">7B</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">Instruct</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">tensor</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">parallel</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">size</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"1"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">max</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">model</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">len</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"4096"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">-</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">served</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">model</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">name</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> qwen2.5</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">7b</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">resources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">limits</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">nvidia.com/gpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"1"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 20Gi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">requests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">nvidia.com/gpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"1"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 16Gi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">ports</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">containerPort</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8000</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">readinessProbe</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">httpGet</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">path</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /health</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">port</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8000</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">initialDelaySeconds</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">60</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">periodSeconds</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">10</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ai</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">selector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> vllm</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ports</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">port</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8000</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">targetPort</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">8000</span><br></div></code></pre></div></div>
<p>Add a ServiceMonitor and Prometheus scrapes <code>/metrics</code>. Add a LiteLLM entry and your existing applications route to it transparently. The migration from cloud API to on-premise inference is a one-line config change.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary">Summary<a href="https://docs.devandre.sbs/blog/vllm-vs-ollama-enterprise-inference#summary" class="hash-link" aria-label="Direct link to Summary" title="Direct link to Summary" translate="no">​</a></h2>
<table><thead><tr><th></th><th>Ollama</th><th>vLLM</th></tr></thead><tbody><tr><td>Target use case</td><td>Developer laptop</td><td>Production serving</td></tr><tr><td>Concurrent requests</td><td>Sequential (1 at a time)</td><td>Continuous batching (N at a time)</td></tr><tr><td>KV cache management</td><td>Per-request allocation</td><td>PagedAttention (shared pages)</td></tr><tr><td>Throughput vs. Ollama</td><td>1×</td><td>10–50× under load</td></tr><tr><td>Prometheus metrics</td><td>None</td><td>Full histogram suite</td></tr><tr><td>Multi-GPU</td><td>No</td><td>Tensor parallelism</td></tr><tr><td>OpenAI-compatible API</td><td>Yes</td><td>Yes</td></tr><tr><td>Data sovereignty</td><td>Yes (local)</td><td>Yes (local)</td></tr><tr><td>Audit logging</td><td>None</td><td>Full request log</td></tr><tr><td>Production readiness</td><td>No</td><td>Yes</td></tr></tbody></table>
<p>Ollama is how you start. vLLM is how you scale. The good news: if you built your application on top of an OpenAI-compatible API (directly or through a proxy like LiteLLM), switching between them is a configuration change, not a rewrite.</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>vllm</category>
            <category>ollama</category>
            <category>inference</category>
            <category>kubernetes</category>
            <category>enterprise</category>
            <category>mlops</category>
            <category>self-hosted</category>
        </item>
        <item>
            <title><![CDATA[Self-Hosted Kubernetes: What I Built vs What OpenShift Ships]]></title>
            <link>https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted</link>
            <guid>https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted</guid>
            <pubDate>Wed, 29 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A layer-by-layer comparison between minicloud — a 5-node k3s cluster assembled from CNCF components — and OpenShift Container Platform (OCP) self-hosted. Same problems, different approaches: immutable nodes, control plane management, security posture, upgrades, and what each model teaches you.
]]></description>
            <content:encoded><![CDATA[<p>OpenShift Container Platform is an opinionated enterprise Kubernetes distribution. My minicloud cluster is a 5-node k3s stack assembled component by component from CNCF projects. After going through the full build — GitOps, observability, secrets, registry, OIDC, ingress, storage replication, chaos testing, security patching, upgrades — I can say with some precision what the difference actually is.</p>
<p>It is not that OpenShift does more. It is that OpenShift has already made every choice you would have to make yourself, packaged those choices as a versioned, tested, supported unit, and enforced them at the architecture level. Whether that is a benefit or a constraint depends entirely on what you are trying to do.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-setup">The Setup<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#the-setup" class="hash-link" aria-label="Direct link to The Setup" title="Direct link to The Setup" translate="no">​</a></h2>
<p><strong>minicloud</strong> is a 5-node k3s v1.36.2 cluster on bare-metal Ubuntu 22.04:</p>
<table><thead><tr><th>Node</th><th>IP</th><th>Role</th></tr></thead><tbody><tr><td><code>set-hog</code></td><td>10.0.0.2</td><td>k3s control plane (ThinkPad X390)</td></tr><tr><td><code>fast-skunk</code></td><td>10.0.0.4</td><td>worker</td></tr><tr><td><code>fast-heron</code></td><td>10.0.0.7</td><td>worker</td></tr><tr><td><code>star-kitten</code></td><td>10.0.0.8</td><td>worker</td></tr><tr><td><code>swift-mac</code></td><td>10.0.0.10</td><td>worker (MacBook Pro 2012, Ubuntu 22.04, Longhorn storage)</td></tr></tbody></table>
<p>Every component was chosen, configured, and deployed by hand: ArgoCD for GitOps, Harbor for images, Authentik for OIDC, Longhorn for block storage, NGINX + MetalLB for ingress, Vault + ESO for secrets, Gatekeeper for policy, Falco for runtime security, kube-prometheus-stack for observability.</p>
<p><strong>OpenShift OCP</strong> self-hosted runs on bare metal or VMs. Minimum production footprint: three masters (16 GB RAM, 120 GB disk each) plus two workers. The control plane OS is RHEL CoreOS (RHCOS), an immutable image managed by the cluster itself. Workers can be RHCOS or RHEL 9.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-hardware-reality">The Hardware Reality<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#the-hardware-reality" class="hash-link" aria-label="Direct link to The Hardware Reality" title="Direct link to The Hardware Reality" translate="no">​</a></h2>
<p>Before comparing features, the minimum footprint gap is real:</p>
<table><thead><tr><th></th><th>minicloud (k3s)</th><th>OpenShift OCP</th></tr></thead><tbody><tr><td>Control plane nodes</td><td>1 (ThinkPad X390)</td><td>3 masters minimum</td></tr><tr><td>RAM per control plane node</td><td>~8 GB</td><td>16 GB minimum</td></tr><tr><td>Total minimum cluster RAM</td><td>~20 GB across 5 nodes</td><td>~64 GB across 5 nodes</td></tr><tr><td>Install time</td><td>k3s binary: 5 minutes</td><td>OpenShift IPI installer: 45–90 minutes</td></tr><tr><td>Minimum disk per control plane</td><td>~256 GB NVMe</td><td>120 GB minimum (etcd is I/O sensitive)</td></tr><tr><td>License cost</td><td>Open source (MIT)</td><td>Red Hat subscription (~$10k+/year per cluster)</td></tr></tbody></table>
<p>k3s runs on a ThinkPad. OpenShift cannot. This is not a knock on OpenShift — it bundles a full enterprise platform, and that platform has real resource requirements. But it means the two tools solve different problems at different scales.</p>
<p>The community alternative is <strong>OKD</strong>, OpenShift's free upstream using Fedora CoreOS instead of RHCOS. Same architecture, same operators, no Red Hat subscription. OKD is what to use if you want to evaluate OpenShift's model without the licensing cost.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-1-the-node-os--ubuntu-vs-rhcos">Layer 1: The Node OS — Ubuntu vs RHCOS<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#layer-1-the-node-os--ubuntu-vs-rhcos" class="hash-link" aria-label="Direct link to Layer 1: The Node OS — Ubuntu vs RHCOS" title="Direct link to Layer 1: The Node OS — Ubuntu vs RHCOS" translate="no">​</a></h2>
<p>Your nodes run Ubuntu 22.04. You manage OS patches via <code>unattended-upgrades</code>, kernel reboots via kured, and node configuration via Ansible. Configuration can drift silently. A hand-edited file on <code>fast-heron</code> can differ from <code>star-kitten</code> with no record anywhere.</p>
<p>OpenShift control-plane and worker nodes run <strong>RHEL CoreOS</strong> — an immutable OS. There is no package manager you can call. Configuration is entirely managed by the <strong>Machine Config Operator (MCO)</strong>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> machineconfiguration.openshift.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> MachineConfig</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 99</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">worker</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">sysctl</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">inotify</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">config</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">storage</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">files</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">path</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /etc/sysctl.d/99</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">inotify.conf</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">source</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"data:,fs.inotify.max_user_watches%3D524288"</span><br></div></code></pre></div></div>
<p>Apply that MachineConfig, and MCO drains the target nodes, applies the change via <code>rpm-ostree</code>, reboots, and uncordons. No Ansible playbooks. No SSH. No drift. The node cannot have a configuration that differs from its MachineConfig — that is the constraint the architecture enforces.</p>
<p><strong>What this means concretely:</strong> my Ansible + kured + kube-bench stack covers the same ground as MCO (node configuration, CIS posture, reboot sequencing after patches). The difference is that MCO enforces convergence architecturally; my Ansible requires someone to remember to run the playbook.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-2-the-control-plane--kinesqlite-vs-etcd--cvo">Layer 2: The Control Plane — Kine/SQLite vs etcd + CVO<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#layer-2-the-control-plane--kinesqlite-vs-etcd--cvo" class="hash-link" aria-label="Direct link to Layer 2: The Control Plane — Kine/SQLite vs etcd + CVO" title="Direct link to Layer 2: The Control Plane — Kine/SQLite vs etcd + CVO" translate="no">​</a></h2>
<p>minicloud runs a single control plane node (<code>set-hog</code>) with k3s's Kine adapter replacing etcd with SQLite. This is a deliberate trade-off: single point of failure for the API server, 90-second recovery window on hardware failure, full administrative control over the datastore. Two independent backup mechanisms (k8s CronJob + controller systemd timer) cover the recovery path.</p>
<p>OpenShift requires three masters with a real three-node etcd cluster. Lose one master, the API server keeps scheduling. The etcd cluster is managed entirely by the <strong>etcd Operator</strong>, which is itself managed by the <strong>Cluster Version Operator (CVO)</strong>.</p>
<p>CVO is the part of OpenShift with no equivalent in the k3s ecosystem. It manages every control plane component — API server, controller manager, scheduler, etcd, ingress router, monitoring stack, image registry — as a set of versioned operators. When you run:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">oc adm upgrade --to-latest=true</span><br></div></code></pre></div></div>
<p>CVO:</p>
<ol>
<li class="">Validates the new version payload is safe to apply from the current version</li>
<li class="">Updates control plane operators in a defined dependency order</li>
<li class="">Triggers MCO to update RHCOS on each control plane node (drain → <code>rpm-ostree</code> → reboot → uncordon)</li>
<li class="">Updates all bundled operators (monitoring, logging, router) in the correct sequence</li>
<li class="">Validates each step before proceeding to the next</li>
<li class="">Can pause and resume mid-upgrade</li>
</ol>
<p>My equivalent is system-upgrade-controller (SUC) for the k3s binary + GitHub Actions for release detection + Renovate for Helm chart bumps triggered by the version change. CVO manages the entire platform as a versioned unit. My stack manages the k3s binary and then handles every other component separately. CVO knows that cert-manager version N is compatible with OCP 4.17 because Red Hat tested that combination. My compatibility checks are manual.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-3-security--gatekeeper--falco-vs-sccs--selinux--rhacs">Layer 3: Security — Gatekeeper + Falco vs SCCs + SELinux + RHACS<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#layer-3-security--gatekeeper--falco-vs-sccs--selinux--rhacs" class="hash-link" aria-label="Direct link to Layer 3: Security — Gatekeeper + Falco vs SCCs + SELinux + RHACS" title="Direct link to Layer 3: Security — Gatekeeper + Falco vs SCCs + SELinux + RHACS" translate="no">​</a></h2>
<p>This is where the gap is most meaningful.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="security-context-constraints-vs-pod-security-admission">Security Context Constraints vs Pod Security Admission<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#security-context-constraints-vs-pod-security-admission" class="hash-link" aria-label="Direct link to Security Context Constraints vs Pod Security Admission" title="Direct link to Security Context Constraints vs Pod Security Admission" translate="no">​</a></h3>
<p>Kubernetes ships Pod Security Admission (PSA) with three built-in levels: <code>privileged</code>, <code>baseline</code>, <code>restricted</code>. They apply at the namespace level, are all-or-nothing within a level, and cannot be customized.</p>
<p>OpenShift ships <strong>Security Context Constraints (SCCs)</strong> as a more granular replacement that predates PSA and remains the primary enforcement mechanism. SCCs are attached to service accounts:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> security.openshift.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> SecurityContextConstraints</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> restricted</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">v2</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">allowPrivilegedContainer</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">allowHostDirVolumePlugin</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">runAsUser</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> MustRunAsRange      </span><span class="token comment" style="color:#999988;font-style:italic"># enforces non-root with a dynamic UID range per namespace</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">seLinuxContext</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> MustRunAs           </span><span class="token comment" style="color:#999988;font-style:italic"># mandatory SELinux labelling on every container</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">fsGroup</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> MustRunAs</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">seccompProfiles</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> runtime/default</span><br></div></code></pre></div></div>
<p>The critical difference from PSA: <code>MustRunAsRange</code> assigns a UID from a namespace-specific range. If two namespaces both use the <code>restricted-v2</code> SCC, their pods get different UIDs. A compromised process that escapes its container cannot write files owned by another namespace's pods. PSA cannot express this — it either allows non-root (no specific UID) or denies root (any non-zero UID).</p>
<p>My equivalent is Gatekeeper/OPA with custom rego policies. I can get close to SCC behavior, but I wrote every constraint manually. SCCs are built in and enforced by default on every pod in every namespace without any admission webhook configuration.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="selinux-vs-apparmor">SELinux vs AppArmor<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#selinux-vs-apparmor" class="hash-link" aria-label="Direct link to SELinux vs AppArmor" title="Direct link to SELinux vs AppArmor" translate="no">​</a></h3>
<p>Every RHCOS node runs SELinux in enforcing mode. Pod processes receive mandatory SELinux labels. File system access is controlled at the kernel level by these labels — a process cannot read a file unless its label permits it, regardless of Unix permissions. You cannot disable SELinux on a RHCOS node without MCO.</p>
<p>Ubuntu nodes (minicloud) default to AppArmor. AppArmor is profile-based: you define what a process can access, and anything not in the profile is denied. It is effective, but it is opt-in per workload and does not provide the cross-process isolation that SELinux mandatory labels give you.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="rhacs-vs-falco--harbor-trivy--gatekeeper">RHACS vs Falco + Harbor Trivy + Gatekeeper<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#rhacs-vs-falco--harbor-trivy--gatekeeper" class="hash-link" aria-label="Direct link to RHACS vs Falco + Harbor Trivy + Gatekeeper" title="Direct link to RHACS vs Falco + Harbor Trivy + Gatekeeper" translate="no">​</a></h3>
<p>Red Hat Advanced Cluster Security (RHACS, originally StackRox) is a full container security platform available via OperatorHub. It covers:</p>
<ul>
<li class="">Vulnerability scanning for container images (similar to Harbor Trivy)</li>
<li class="">Runtime threat detection (similar to Falco)</li>
<li class="">Network segmentation enforcement with visual network topology</li>
<li class="">Compliance reporting against CIS, NIST, PCI-DSS, SOC2 out of the box</li>
<li class="">Risk scoring per deployment based on CVEs, runtime behavior, and network exposure</li>
</ul>
<p>My stack does the same work using four separate tools: Falco (runtime), Harbor Trivy (image scanning), Gatekeeper (policy), kube-bench (compliance). Each is configured and maintained separately. RHACS integrates all of these into a single operator with a unified UI.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-4-networking--flannel--metallb-vs-ovn-kubernetes">Layer 4: Networking — Flannel + MetalLB vs OVN-Kubernetes<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#layer-4-networking--flannel--metallb-vs-ovn-kubernetes" class="hash-link" aria-label="Direct link to Layer 4: Networking — Flannel + MetalLB vs OVN-Kubernetes" title="Direct link to Layer 4: Networking — Flannel + MetalLB vs OVN-Kubernetes" translate="no">​</a></h2>
<p>minicloud uses <strong>Flannel</strong> (k3s default, VXLAN encapsulation) for the pod network and <strong>MetalLB</strong> for LoadBalancer IP assignment via L2 ARP advertisement. Adding <strong>NGINX Ingress Controller</strong> as a DaemonSet on top gives HTTP/HTTPS routing. Three components, each independently versioned and configured.</p>
<p>OpenShift ships <strong>OVN-Kubernetes</strong> as its default CNI. OVN-Kubernetes is built on Open Virtual Network, which provides:</p>
<ul>
<li class="">Distributed L3 routing (each node handles its own east-west traffic, no centralized gateway)</li>
<li class="">Hardware offload support (via SR-IOV or SmartNICs on nodes that have them)</li>
<li class=""><strong>AdminNetworkPolicy</strong> — a cluster-scoped network policy that takes precedence over namespace-scoped NetworkPolicy. Platform admins can enforce baseline segmentation that tenant teams cannot override.</li>
<li class="">Egress IP assignment (stable outbound IP per namespace or pod selector for firewall allowlisting)</li>
</ul>
<p><strong>Routes vs Ingress:</strong> OpenShift has an <code>Ingress</code> compatible resource but also ships <code>Route</code> — a first-class CRD that predates the Ingress spec and carries more configuration surface:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> route.openshift.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Route</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">host</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">service.apps.cluster.example.com</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">to</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> my</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">service</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">tls</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">termination</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> edge</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">insecureEdgeTerminationPolicy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Redirect</span><br></div></code></pre></div></div>
<p>The HAProxy-based router is a core CVO-managed component, not a Helm chart. Wildcard DNS (<code>*.apps.cluster.example.com</code>) points to the router VIP. Every Route gets a hostname under that wildcard automatically. My equivalent is cert-manager (TLS) + NGINX DaemonSet (routing) + MetalLB (VIP) + explicit DNS records per service — four separate components where OCP has one.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-5-the-developer-experience">Layer 5: The Developer Experience<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#layer-5-the-developer-experience" class="hash-link" aria-label="Direct link to Layer 5: The Developer Experience" title="Direct link to Layer 5: The Developer Experience" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="operators-vs-helm-charts">Operators vs Helm Charts<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#operators-vs-helm-charts" class="hash-link" aria-label="Direct link to Operators vs Helm Charts" title="Direct link to Operators vs Helm Charts" translate="no">​</a></h3>
<p>minicloud deploys everything via Helm charts managed by ArgoCD. Each chart is an independent versioned dependency. Renovate opens PRs when new chart versions ship.</p>
<p>OpenShift's primary delivery mechanism is <strong>Operators</strong> from <strong>OperatorHub</strong> — a curated marketplace of certified, tested operators. An Operator is a controller that manages a specific application using Kubernetes-native CRDs. Installing Prometheus on OpenShift:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> operators.coreos.com/v1alpha1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Subscription</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> prometheus</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> openshift</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">monitoring</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">channel</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> stable</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">installPlanApproval</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Automatic</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> prometheus</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">source</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> redhat</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">operators</span><br></div></code></pre></div></div>
<p>The <strong>Operator Lifecycle Manager (OLM)</strong> handles installation, dependency resolution, and updates. An Operator that declares a dependency on cert-manager will have OLM install cert-manager automatically. Helm has no dependency resolution — you install the dependency manually and hope the version is compatible.</p>
<p>The trade-off: Operators are more powerful but less portable. A Helm chart runs anywhere Helm runs. An OLM subscription only works on a cluster with OLM installed (OpenShift, or OLM installed separately on vanilla Kubernetes).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-console">The Console<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#the-console" class="hash-link" aria-label="Direct link to The Console" title="Direct link to The Console" translate="no">​</a></h3>
<p>k3s has no built-in web console. My platform surface is ArgoCD (GitOps), Grafana (metrics/logs/traces), Harbor (images), Backstage (IDP/catalog), Homer (dashboard). Each has its own authentication flow, even with Authentik OIDC federating them.</p>
<p>OpenShift ships a full web console with two perspectives:</p>
<ul>
<li class=""><strong>Administrator</strong>: cluster-wide resources, node status, operator management, event streams, quota consumption, network topology</li>
<li class=""><strong>Developer</strong>: project-scoped views, topology graphs showing service connections, build pipelines, integrated log tailing per pod</li>
</ul>
<p>Both use the same OpenShift OAuth session. One login, full visibility across all namespaces the user has access to. The console is a CVO-managed component — it upgrades with the cluster and is always compatible with the version running.</p>
<p>For teams where not everyone is a platform engineer, this matters. On minicloud, debugging a failing pod requires knowing to go to ArgoCD for sync status, Grafana for logs, kubectl for events. On OpenShift, the console surfaces all of that in a single view.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="component-mapping">Component Mapping<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#component-mapping" class="hash-link" aria-label="Direct link to Component Mapping" title="Direct link to Component Mapping" translate="no">​</a></h2>
<p>Assembling minicloud meant independently choosing and wiring together the equivalent of every built-in OpenShift component:</p>
<table><thead><tr><th>Component</th><th>minicloud</th><th>OpenShift OCP</th></tr></thead><tbody><tr><td>GitOps</td><td>ArgoCD (Helm, self-managed)</td><td>OpenShift GitOps = certified ArgoCD</td></tr><tr><td>CI/CD pipelines</td><td>GitHub Actions (external)</td><td>OpenShift Pipelines = Tekton</td></tr><tr><td>Image registry</td><td>Harbor (Helm)</td><td>Built-in integrated registry</td></tr><tr><td>Authentication</td><td>Authentik OIDC (Helm)</td><td>Built-in OAuth server</td></tr><tr><td>Ingress</td><td>NGINX + MetalLB (Helm)</td><td>HAProxy Router (CVO-managed)</td></tr><tr><td>TLS</td><td>cert-manager (Helm)</td><td>cert-manager (OperatorHub)</td></tr><tr><td>Storage</td><td>Longhorn (Helm)</td><td>OpenShift Data Foundation = Rook/Ceph</td></tr><tr><td>Monitoring</td><td>kube-prometheus-stack (Helm)</td><td>cluster-monitoring-operator (CVO-managed)</td></tr><tr><td>Logging</td><td>Loki (Helm)</td><td>OpenShift Logging = Loki or Elasticsearch</td></tr><tr><td>Tracing</td><td>Tempo (Helm)</td><td>OpenShift Distributed Tracing = Tempo/Jaeger</td></tr><tr><td>Secrets</td><td>Vault + ESO (Helm)</td><td>Vault (OperatorHub) or Secrets Store CSI</td></tr><tr><td>Policy enforcement</td><td>Gatekeeper/OPA (Helm)</td><td>Built-in SCCs + optional Gatekeeper</td></tr><tr><td>Runtime security</td><td>Falco (Helm)</td><td>RHACS (Red Hat Advanced Cluster Security)</td></tr><tr><td>Image scanning</td><td>Harbor Trivy</td><td>RHACS or built-in registry scanning</td></tr><tr><td>Node updates</td><td>system-upgrade-controller + GH Actions</td><td>Cluster Version Operator (CVO)</td></tr><tr><td>Node configuration</td><td>Ansible</td><td>Machine Config Operator</td></tr><tr><td>CIS hardening</td><td>kube-bench + Ansible (manual post-upgrade)</td><td>Built-in CIS L2, SELinux enforced</td></tr><tr><td>Service mesh</td><td>not deployed</td><td>OpenShift Service Mesh = Istio + Kiali</td></tr><tr><td>Developer console</td><td>Backstage + Homer + Grafana</td><td>Full OpenShift web console</td></tr><tr><td>Dependency updates</td><td>Renovate (self-hosted)</td><td>Renovate — not an OCP feature, same either way</td></tr></tbody></table>
<p>The notable pattern: the tools in the left column are the same upstream CNCF projects that OpenShift packages in the right column. ArgoCD is ArgoCD. cert-manager is cert-manager. Tempo is Tempo. OpenShift adds testing, compatibility guarantees, support contracts, and delivery via OLM. It does not replace the underlying technology.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-openshift-gives-you-that-you-cannot-easily-replicate">What OpenShift Gives You That You Cannot Easily Replicate<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#what-openshift-gives-you-that-you-cannot-easily-replicate" class="hash-link" aria-label="Direct link to What OpenShift Gives You That You Cannot Easily Replicate" title="Direct link to What OpenShift Gives You That You Cannot Easily Replicate" translate="no">​</a></h2>
<p><strong>Node immutability:</strong> MCO + RHCOS makes node drift impossible by architecture. My Ansible approach requires discipline — an SSH session on <code>fast-heron</code> at 2am can leave the node permanently different from its intended state. RHCOS rejects that.</p>
<p><strong>Platform-level upgrade coordination:</strong> CVO treats the entire cluster as a versioned artifact. When upgrading from OCP 4.16 to 4.17, CVO knows the correct order for updating every component because Red Hat tested that exact sequence. My SUC + Renovate approach upgrades k3s and then each Helm chart independently — compatibility between versions is my problem.</p>
<p><strong>Out-of-box CIS Level 2 compliance:</strong> OCP passes CIS L2 on install. My cluster needs kube-bench to verify, and passing it requires post-install Ansible work. After a k3s upgrade, I re-run kube-bench because the binary update can reintroduce findings.</p>
<p><strong>Enterprise support path:</strong> A failing OCP cluster has a Red Hat support ticket with a service level. A failing k3s cluster has Stack Overflow and the k3s GitHub issues.</p>
<p><strong>OpenShift Local (CRC):</strong> Red Hat ships a single-VM OCP install for local development. If you need OpenShift-specific features (SCCs, Routes, OperatorHub) in development, CRC gets you there without building a multi-node cluster.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-minicloud-has-that-openshift-cannot-give-you">What minicloud Has That OpenShift Cannot Give You<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#what-minicloud-has-that-openshift-cannot-give-you" class="hash-link" aria-label="Direct link to What minicloud Has That OpenShift Cannot Give You" title="Direct link to What minicloud Has That OpenShift Cannot Give You" translate="no">​</a></h2>
<p><strong>Hardware flexibility:</strong> OCP cannot run on a ThinkPad. k3s can. The entire minicloud platform runs on hardware you could buy at a laptop repair shop for under €1,000 total.</p>
<p><strong>Component choice:</strong> OCP's built-in monitoring stack (cluster-monitoring-operator) cannot be replaced. It is how OCP monitors itself. My Prometheus can be swapped for VictoriaMetrics, reconfigured, or extended without CVO fighting me.</p>
<p><strong>Cost at small scale:</strong> Open source plus electricity costs versus a Red Hat subscription. For a portfolio cluster or a small team, the subscription model has no justification.</p>
<p><strong>Learning depth:</strong> Building a cluster from CNCF primitives forces understanding at every layer. An OpenShift engineer who has never built a cluster from scratch often does not know why cert-manager exists, what problem MetalLB solves, or how etcd leader election works. The platform hides it. Building minicloud means knowing exactly what each component does because you had to make it work.</p>
<p><strong>Upstream velocity:</strong> k3s typically tracks upstream Kubernetes within days of a release. OCP ships new Kubernetes versions on a 4-month delay as Red Hat completes integration testing. minicloud ran k3s v1.36.2 while many OCP clusters were still on 1.31.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-conclusion-that-actually-matters">The Conclusion That Actually Matters<a href="https://docs.devandre.sbs/blog/minicloud-vs-openshift-self-hosted#the-conclusion-that-actually-matters" class="hash-link" aria-label="Direct link to The Conclusion That Actually Matters" title="Direct link to The Conclusion That Actually Matters" translate="no">​</a></h2>
<p>By building minicloud component by component, I assembled the functional equivalent of OpenShift using the same upstream CNCF projects that OpenShift packages. GitOps, observability, secrets management, image registry, OIDC, policy enforcement, runtime security, canary deployments, chaos testing, backup and DR — all present on both platforms.</p>
<p>OpenShift's value proposition is everything around those components:</p>
<ul>
<li class="">Red Hat tested all of them together at a specific version matrix</li>
<li class="">CVO automates the upgrade sequencing across the entire platform as a unit</li>
<li class="">MCO enforces node immutability so configuration drift is architecturally impossible</li>
<li class="">SCCs and SELinux provide a security model stronger than what PSA + AppArmor can deliver</li>
<li class="">OperatorHub gives you a curated, certified component marketplace with OLM dependency resolution</li>
<li class="">The support contract gives you a call to make when the cluster is down at 3am</li>
</ul>
<p>What neither platform handles for you: container image CVE patching and application Helm/OLM chart updates. Renovate runs identically on k3s and OCP. That layer is always yours.</p>
<p>The choice is not about which platform is technically superior. It is about what you are optimizing for. A regulated enterprise with a 100-person platform team and a compliance requirement optimizes for the guarantees OpenShift provides. A platform engineer building a portfolio cluster, learning the full stack, or running a cost-constrained production environment optimizes for everything that makes minicloud the right answer.</p>
<p>Both are valid. Knowing which model fits which context — and why — is the actual skill.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>openshift</category>
            <category>okd</category>
            <category>platform-engineering</category>
            <category>devops</category>
            <category>cncf</category>
            <category>security</category>
            <category>gitops</category>
            <category>bare-metal</category>
        </item>
        <item>
            <title><![CDATA[Designing High Availability on Bare-Metal Kubernetes — Layer by Layer]]></title>
            <link>https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes</link>
            <guid>https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes</guid>
            <pubDate>Tue, 28 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[HA on a self-managed k3s cluster is not one setting — it is six independent layers, each with a concrete trade-off. This post walks through every layer on minicloud, what was validated by a live chaos game day, and how the same concerns map to EKS, GKE, and AKS.
]]></description>
            <content:encoded><![CDATA[<p>"High availability" is one of those terms that everyone agrees matters and almost nobody defines precisely. On a managed Kubernetes provider, you tick a checkbox for multi-AZ and move on. On a self-managed cluster, you make six independent architectural decisions, each with its own failure mode, trade-off, and operational cost.</p>
<p>This post documents every HA layer on <strong>minicloud</strong> — a 5-node k3s cluster on ThinkPad laptops — explains the reasoning behind each trade-off, and maps each layer to how EKS, GKE, and AKS solve the same problem.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-cluster">The Cluster<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#the-cluster" class="hash-link" aria-label="Direct link to The Cluster" title="Direct link to The Cluster" translate="no">​</a></h2>
<p>Five machines:</p>
<table><thead><tr><th>Node</th><th>IP</th><th>Role</th></tr></thead><tbody><tr><td><code>set-hog</code></td><td>10.0.0.2</td><td>k3s control plane (ThinkPad X390)</td></tr><tr><td><code>fast-skunk</code></td><td>10.0.0.4</td><td>worker</td></tr><tr><td><code>fast-heron</code></td><td>10.0.0.7</td><td>worker</td></tr><tr><td><code>star-kitten</code></td><td>10.0.0.8</td><td>worker</td></tr><tr><td><code>swift-mac</code></td><td>10.0.0.10</td><td>worker + Longhorn storage (MacBook Pro 2012, Ubuntu 22.04)</td></tr></tbody></table>
<p>Every HA decision below was made for this specific context. The reasoning is transferable; the numbers are not.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-1--control-plane-deliberately-single-node">Layer 1 — Control Plane: Deliberately Single Node<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-1--control-plane-deliberately-single-node" class="hash-link" aria-label="Direct link to Layer 1 — Control Plane: Deliberately Single Node" title="Direct link to Layer 1 — Control Plane: Deliberately Single Node" translate="no">​</a></h2>
<p>This is the most important HA decision on the cluster, and the answer is: no HA at this layer.</p>
<p><code>set-hog</code> runs the k3s API server, scheduler, controller-manager, and Kine/SQLite datastore. It is one ThinkPad. If it crashes, the control plane is gone until it reboots — roughly 90 seconds.</p>
<p><strong>What actually happens when the control plane goes down:</strong></p>
<ul>
<li class="">Running pods on all four workers <strong>keep running</strong>. kubelet is a local process; it does not need the API server to manage existing pods.</li>
<li class="">No new scheduling. No Deployments roll out. No ConfigMaps update. No secrets rotate.</li>
<li class="">Recovery is automatic when <code>set-hog</code> reboots and k3s starts.</li>
</ul>
<p><strong>Why not HA control plane?</strong> k3s HA requires <code>--cluster-init</code> on the first server node plus two additional server nodes with <code>--server</code>. That switches the datastore from Kine/SQLite to embedded etcd with Raft consensus across three nodes. For a 5-node cluster, three machines in control-plane role is a bad ratio — and the operational overhead of managing a Raft cluster is real. Given that control plane downtime does not take down running workloads and recovery takes 90 seconds, the trade-off is clear.</p>
<p><strong>What managed providers do instead:</strong></p>
<ul>
<li class=""><strong>EKS:</strong> API server replicated across multiple AZs. etcd is a multi-AZ cluster AWS manages entirely. Control plane goes down → you never notice.</li>
<li class=""><strong>GKE:</strong> Same model. The control plane is so opaque that GKE Standard doesn't even charge for it separately; it's part of the cluster SLA.</li>
<li class=""><strong>AKS:</strong> Same model. Azure manages the control plane HA; you pay only for worker VMs.</li>
</ul>
<p>The managed approach eliminates this failure mode entirely. The cost on EKS is $0.10/hr ($73/month) before any workers — for the control plane alone. On minicloud, <code>set-hog</code> runs on hardware already owned.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-2--workers-four-nodes-cross-node-distribution">Layer 2 — Workers: Four Nodes, Cross-Node Distribution<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-2--workers-four-nodes-cross-node-distribution" class="hash-link" aria-label="Direct link to Layer 2 — Workers: Four Nodes, Cross-Node Distribution" title="Direct link to Layer 2 — Workers: Four Nodes, Cross-Node Distribution" translate="no">​</a></h2>
<p>All workload pods run on four workers. The k3s scheduler distributes replicas by default using <code>PodTopologySpread</code> semantics — multi-replica Deployments land on different nodes without explicit configuration.</p>
<p><strong>The swift-mac exception:</strong> <code>swift-mac</code> is a MacBook Pro 2012. It has no IPMI, no BMC, no remote power-cycle capability (Apple SMC only responds to physical button presses). If the OS hangs, manual intervention is required. StatefulSets that require guaranteed automated recovery are pinned away from <code>swift-mac</code> using node affinity rules:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">affinity</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeAffinity</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">requiredDuringSchedulingIgnoredDuringExecution</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">nodeSelectorTerms</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">matchExpressions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> kubernetes.io/hostname</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> NotIn</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">              </span><span class="token key atrule" style="color:#00a4db">values</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">swift</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">mac</span><span class="token punctuation" style="color:#393A34">]</span><br></div></code></pre></div></div>
<p><code>swift-mac</code> runs stateless workloads and Longhorn storage replicas (where it adds capacity, not critical path availability).</p>
<p><strong>What managed providers do instead:</strong> cloud worker nodes are VMs with full hypervisor-level power control. If an AWS EC2 instance hangs, the node group terminates and replaces it automatically. Node auto-repair is available on GKE (default on Autopilot). On bare-metal, hung nodes require human attention.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-3--applications-replicas-pdbs-and-argo-rollouts">Layer 3 — Applications: Replicas, PDBs, and Argo Rollouts<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-3--applications-replicas-pdbs-and-argo-rollouts" class="hash-link" aria-label="Direct link to Layer 3 — Applications: Replicas, PDBs, and Argo Rollouts" title="Direct link to Layer 3 — Applications: Replicas, PDBs, and Argo Rollouts" translate="no">​</a></h2>
<p>This is where most of the HA work lives. The control plane and storage layers define the ceiling; the application layer determines whether workloads actually survive failures within that ceiling.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="replica-count">Replica Count<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#replica-count" class="hash-link" aria-label="Direct link to Replica Count" title="Direct link to Replica Count" translate="no">​</a></h3>
<p>Production workloads run a minimum of 3 replicas, spread across workers. The number 3 is deliberate: it tolerates 1 pod failure and still serves traffic while the replacement starts. With 2 replicas, a pod kill plus a slow start leaves you at 1 replica — no redundancy.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="poddisruptionbudgets">PodDisruptionBudgets<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#poddisruptionbudgets" class="hash-link" aria-label="Direct link to PodDisruptionBudgets" title="Direct link to PodDisruptionBudgets" translate="no">​</a></h3>
<p>Every production workload has a PDB preventing Kubernetes from evicting more than one replica simultaneously during voluntary disruptions (node drains, cluster upgrades):</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> policy/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> PodDisruptionBudget</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">pdb</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">minAvailable</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">2</span><span class="token plain">        </span><span class="token comment" style="color:#999988;font-style:italic"># at least 2 replicas must be Ready at all times</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">selector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchLabels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><br></div></code></pre></div></div>
<p>Without a PDB, the k3s upgrade drain could evict all three replicas from a node simultaneously, causing a brief outage. The PDB prevents this — the drain waits for a replacement to become Ready before evicting the next pod.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="argo-rollouts-zero-downtime-deployments">Argo Rollouts: Zero-Downtime Deployments<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#argo-rollouts-zero-downtime-deployments" class="hash-link" aria-label="Direct link to Argo Rollouts: Zero-Downtime Deployments" title="Direct link to Argo Rollouts: Zero-Downtime Deployments" translate="no">​</a></h3>
<p>Plain Kubernetes Deployments use <code>RollingUpdate</code> strategy, which provides basic HA during deploys. Production services on minicloud use <strong>Argo Rollouts</strong> for more control:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> argoproj.io/v1alpha1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Rollout</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">replicas</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">3</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">strategy</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">canary</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">stableService</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">stable</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">canaryService</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">canary</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">trafficRouting</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">nginx</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">stableIngress</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">steps</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">setWeight</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">20</span><span class="token plain">      </span><span class="token comment" style="color:#999988;font-style:italic"># send 20% to new version</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">pause</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain">          </span><span class="token comment" style="color:#999988;font-style:italic"># wait for analysis</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">setWeight</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">50</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">pause</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token key atrule" style="color:#00a4db">duration</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 60s</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">setWeight</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">100</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">analysis</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">templates</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">templateName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> success</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">rate</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">startingStep</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> service</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">name</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> platform</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">demo</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">canary</span><br></div></code></pre></div></div>
<p>The key HA property: the stable replica set stays fully live throughout the rollout. A new version that fails its success-rate analysis is automatically rolled back — the stable set absorbs all traffic, and the canary is torn down. No human intervention needed, no outage window.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-phase-81-chaos-game-day-proved">What Phase 81 Chaos Game Day Proved<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#what-phase-81-chaos-game-day-proved" class="hash-link" aria-label="Direct link to What Phase 81 Chaos Game Day Proved" title="Direct link to What Phase 81 Chaos Game Day Proved" translate="no">​</a></h3>
<p>In Phase 81, three chaos experiments ran against production workloads:</p>
<p><strong>Experiment 1 — Pod kill (PodChaos):</strong></p>
<ul>
<li class="">Killed 1 of 3 <code>platform-demo</code> replicas</li>
<li class="">NGINX EndpointSlice watch excluded the pod before kill completed</li>
<li class="">Replacement pod: <code>Ready</code> in 16 seconds</li>
<li class="">HTTP availability: <strong>100%</strong> (measured, not estimated)</li>
</ul>
<p><strong>Experiment 2 — Database latency (NetworkChaos):</strong></p>
<ul>
<li class="">200ms artificial delay on <code>backstage → postgresql</code> traffic</li>
<li class="">Cold-path DB queries: +200ms latency (expected)</li>
<li class="">Cached-path requests: unaffected</li>
<li class="">Backstage remained functional throughout</li>
</ul>
<p><strong>Experiment 3 — CPU stress (StressChaos):</strong></p>
<ul>
<li class="">2 workers at 80% load on <code>platform-demo-staging</code> pods</li>
<li class="">cgroup CPU limit (200m) throttled the stressor — node-level impact: zero</li>
<li class="">HTTP p95 latency: stayed within SLO</li>
</ul>
<p>These are measured results on real production workloads, not simulations on throwaway test services.</p>
<p><strong>What managed providers do instead:</strong> cloud providers offer similar Deployment strategies natively (EKS Deployment, GKE Rollout), but Argo Rollouts adds traffic-weight control and metric-gated promotion that managed providers do not include out of the box. Argo Rollouts works identically on EKS/GKE/AKS — this is a workload-level pattern, not a provider-level one.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-4--storage-longhorn-replication">Layer 4 — Storage: Longhorn Replication<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-4--storage-longhorn-replication" class="hash-link" aria-label="Direct link to Layer 4 — Storage: Longhorn Replication" title="Direct link to Layer 4 — Storage: Longhorn Replication" translate="no">​</a></h2>
<p>Persistent storage HA is the hardest layer to get right on bare-metal. Cloud providers give you EBS Multi-AZ (EKS), Persistent Disk (GKE), or Azure Disk (AKS) — all with built-in replication handled by the storage backend.</p>
<p>On bare-metal, that replication is your responsibility. The answer is <strong>Longhorn</strong>: a cloud-native distributed block storage system that runs entirely inside Kubernetes.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-longhorn-replication-works">How Longhorn Replication Works<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#how-longhorn-replication-works" class="hash-link" aria-label="Direct link to How Longhorn Replication Works" title="Direct link to How Longhorn Replication Works" translate="no">​</a></h3>
<p>Each Longhorn PVC is configured with <code>numberOfReplicas: 2</code> (the default). Longhorn maintains two replica copies of the volume data on two separate nodes:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">PVC (16 Gi)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├── Replica A → fast-heron  /var/lib/longhorn/replicas/...</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── Replica B → star-kitten /var/lib/longhorn/replicas/...</span><br></div></code></pre></div></div>
<p>If <code>fast-heron</code> goes down, the volume degrades to Replica B (healthy). Kubernetes reschedules the pod to a node where Replica B is accessible. The volume comes back online. No data is lost.</p>
<p>If both <code>fast-heron</code> and <code>star-kitten</code> go down simultaneously, the volume is inaccessible. That is the failure mode <code>numberOfReplicas: 2</code> accepts. With 4 workers, simultaneous double-node failure is considered acceptable.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="swift-mac-as-storage-node">swift-mac as Storage Node<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#swift-mac-as-storage-node" class="hash-link" aria-label="Direct link to swift-mac as Storage Node" title="Direct link to swift-mac as Storage Node" translate="no">​</a></h3>
<p><code>swift-mac</code> has the largest available disk in the cluster. Its Longhorn storage is used for capacity, but always with a replica on a ThinkPad worker — <code>swift-mac</code> is never the single point of storage for any volume.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="longhorn-ha-during-upgrades">Longhorn HA During Upgrades<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#longhorn-ha-during-upgrades" class="hash-link" aria-label="Direct link to Longhorn HA During Upgrades" title="Direct link to Longhorn HA During Upgrades" translate="no">​</a></h3>
<p>During a k3s node upgrade, the upgrade Plan drains the node. A draining node loses its Longhorn replica. Volumes temporarily degrade to 1 replica (still accessible, but no redundancy during drain). This is why upgrade Plans run with <code>concurrency: 1</code> — only one node drains at a time, keeping replica degradation to a minimum window.</p>
<p><strong>What managed providers do instead:</strong></p>
<table><thead><tr><th></th><th>Longhorn (bare-metal)</th><th>EBS (EKS)</th><th>Persistent Disk (GKE)</th><th>Azure Disk (AKS)</th></tr></thead><tbody><tr><td>Replication</td><td>Software-defined across nodes</td><td>Hardware-level within AZ</td><td>Hardware-level, multi-zone option</td><td>Hardware-level within AZ</td></tr><tr><td>Multi-AZ</td><td>No (single site)</td><td>EBS Multi-Attach (limited)</td><td>Regional PD (available)</td><td>Zone-redundant disk (available)</td></tr><tr><td>Snapshot</td><td>Longhorn snapshots to MinIO/S3</td><td>EBS snapshots to S3</td><td>Persistent Disk snapshots</td><td>Azure Disk snapshots</td></tr><tr><td>Restore</td><td>Longhorn UI or PVC from snapshot</td><td>EBS restore to new volume</td><td>GKE volume restore</td><td>AKS restore</td></tr><tr><td>Operational cost</td><td>You manage replica health, node affinity, backup schedules</td><td>Zero — AWS manages it</td><td>Zero — Google manages it</td><td>Zero — Azure manages it</td></tr></tbody></table>
<p>The managed storage story is compelling: cloud provider disks replicate at the hardware layer, beneath Kubernetes entirely. The performance characteristics are guaranteed, the replication is invisible, and snapshots are one API call. The trade-off is cost ($0.10–$0.20/GB/month for managed SSDs) and that you're tied to the provider's storage abstraction.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-5--ingress-and-network-nginx-daemonset--metallb">Layer 5 — Ingress and Network: NGINX DaemonSet + MetalLB<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-5--ingress-and-network-nginx-daemonset--metallb" class="hash-link" aria-label="Direct link to Layer 5 — Ingress and Network: NGINX DaemonSet + MetalLB" title="Direct link to Layer 5 — Ingress and Network: NGINX DaemonSet + MetalLB" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="nginx-as-daemonset">NGINX as DaemonSet<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#nginx-as-daemonset" class="hash-link" aria-label="Direct link to NGINX as DaemonSet" title="Direct link to NGINX as DaemonSet" translate="no">​</a></h3>
<p>The NGINX ingress controller runs as a <strong>DaemonSet</strong> — one pod per worker node. All four workers (<code>fast-skunk</code>, <code>fast-heron</code>, <code>star-kitten</code>, <code>swift-mac</code>) run an NGINX pod listening for traffic.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">External traffic → 10.0.0.200 (MetalLB VIP) → any NGINX pod → target pod</span><br></div></code></pre></div></div>
<p>If one worker goes down, its NGINX pod goes with it — but the remaining three workers' NGINX pods continue serving all routes. The VIP re-advertises within seconds.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="metallb-layer-2-failover">MetalLB Layer 2 Failover<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#metallb-layer-2-failover" class="hash-link" aria-label="Direct link to MetalLB Layer 2 Failover" title="Direct link to MetalLB Layer 2 Failover" translate="no">​</a></h3>
<p>MetalLB in L2 mode assigns <code>10.0.0.200</code> as the VIP for the cluster. In L2 mode, one node "owns" the VIP at any time and responds to ARP requests for that IP. The owning node is elected by MetalLB's speaker pods.</p>
<p>If the owning node fails:</p>
<ol>
<li class="">ARP cache on the router expires (typically 30–60 seconds, configurable)</li>
<li class="">MetalLB speakers elect a new owner from remaining healthy nodes</li>
<li class="">The new owner starts responding to ARP for <code>10.0.0.200</code></li>
<li class="">Traffic resumes</li>
</ol>
<p>Failover time in practice: under 30 seconds. This is the weakest HA link in the network layer — ARP cache expiry is the bottleneck. BGP mode (MetalLB supports it) would give sub-second failover, but requires a BGP-capable router.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="nginx-endpointslice-watches">NGINX EndpointSlice Watches<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#nginx-endpointslice-watches" class="hash-link" aria-label="Direct link to NGINX EndpointSlice Watches" title="Direct link to NGINX EndpointSlice Watches" translate="no">​</a></h3>
<p>NGINX watches EndpointSlice objects for every Service. When a pod is killed (during chaos experiments, pod evictions, or upgrades), Kubernetes updates the EndpointSlice before the pod terminates. NGINX removes the pod from its upstream pool before any traffic reaches it.</p>
<p>This is why the Phase 81 pod-kill experiment showed 100% HTTP availability: NGINX had already stopped routing to the killed pod by the time the kill signal landed.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="cloudflare-tunnel-public-ha">Cloudflare Tunnel: Public HA<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#cloudflare-tunnel-public-ha" class="hash-link" aria-label="Direct link to Cloudflare Tunnel: Public HA" title="Direct link to Cloudflare Tunnel: Public HA" translate="no">​</a></h3>
<p>Public services (<code>backstage.devandre.sbs</code>, <code>homer.devandre.sbs</code>, etc.) go through a Cloudflare Tunnel running as systemd on the controller. Cloudflare's network handles global load balancing and DDoS protection upstream of the cluster. The tunnel itself is a single point of failure at the controller — but:</p>
<ul>
<li class=""><code>cloudflared</code> runs with <code>Restart=always</code> and <code>StartLimitIntervalSec=0</code></li>
<li class="">Controller reboots recover the tunnel automatically</li>
<li class="">Cloudflare's edge caches recent responses, absorbing brief tunnel interruptions for static content</li>
</ul>
<p><strong>What managed providers do instead:</strong></p>
<ul>
<li class=""><strong>EKS:</strong> AWS Load Balancer Controller provisions ALBs directly from Ingress objects. Multi-AZ, auto-scaling, native TLS termination at the load balancer layer. MetalLB and NGINX DaemonSet complexity disappears.</li>
<li class=""><strong>GKE:</strong> GKE Ingress provisions a Google Cloud Load Balancer. Global HTTP(S) load balancing, Anycast IPs, Cloud Armor WAF integration — all from a single Ingress annotation.</li>
<li class=""><strong>AKS:</strong> Azure Load Balancer or Application Gateway via the AGIC controller. Comparable model to GKE.</li>
</ul>
<p>The managed approach moves load balancing entirely outside Kubernetes — the load balancer itself has provider-grade HA, not pod-grade HA. The trade-off is cost (ALB pricing, GLB pricing) and provider lock-in on the load balancer layer.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-6--observability-ha-for-the-ha-stack">Layer 6 — Observability: HA for the HA Stack<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#layer-6--observability-ha-for-the-ha-stack" class="hash-link" aria-label="Direct link to Layer 6 — Observability: HA for the HA Stack" title="Direct link to Layer 6 — Observability: HA for the HA Stack" translate="no">​</a></h2>
<p>An HA architecture you cannot observe is not an HA architecture — it is a guess. The observability stack is what turns the above layers into something measurable.</p>
<p><strong>What runs:</strong></p>
<ul>
<li class=""><strong>Prometheus + Grafana:</strong> cluster and application SLOs, node resource dashboards, custom <code>ChaosGameDayActive</code> alert</li>
<li class=""><strong>Loki:</strong> log aggregation from all 5 nodes via OTel Collector (DaemonSet), with Promtail as the collection agent</li>
<li class=""><strong>Tempo:</strong> distributed tracing for instrumented services (platform-demo, backstage)</li>
<li class=""><strong>AlertManager:</strong> routes alerts to notification channels with inhibit rules to suppress known-false-positives during chaos testing</li>
</ul>
<p><strong>The inhibit rule that makes chaos testing honest:</strong></p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">inhibit_rules</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">source_matchers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token string" style="color:#e3116c">'alertname = "ChaosGameDayActive"'</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">target_matchers</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token string" style="color:#e3116c">'alertname =~ "KubePodCrashLooping|KubePodNotReady"'</span><span class="token punctuation" style="color:#393A34">]</span><br></div></code></pre></div></div>
<p>When a chaos experiment is running, <code>ChaosGameDayActive</code> fires (chaos controller metrics show <code>status=Injecting</code>). This inhibits <code>KubePodCrashLooping</code> and <code>KubePodNotReady</code> alerts — so intentional pod kills don't flood Slack with false alerts. When the experiment ends, inhibition lifts and the alerting resumes normal operation.</p>
<p><strong>What managed providers do instead:</strong></p>
<ul>
<li class="">EKS: CloudWatch Container Insights, EKS add-on metrics, AWS Managed Grafana (paid)</li>
<li class="">GKE: Cloud Monitoring with GKE integration, Cloud Logging</li>
<li class="">AKS: Azure Monitor for Containers, Log Analytics workspace</li>
</ul>
<p>Managed observability is faster to start (a few clicks vs. helm charts and ServiceMonitors) but less flexible — you can't add custom Prometheus rules or tune the alert inhibition logic without significant workarounds. On bare-metal, you own the full observability pipeline: more work, full control.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-complete-ha-map">The Complete HA Map<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#the-complete-ha-map" class="hash-link" aria-label="Direct link to The Complete HA Map" title="Direct link to The Complete HA Map" translate="no">​</a></h2>
<table><thead><tr><th>Layer</th><th>minicloud decision</th><th>Failure mode accepted</th><th>Managed provider equivalent</th></tr></thead><tbody><tr><td><strong>Control plane</strong></td><td>Single <code>set-hog</code></td><td>90s scheduling gap on reboot</td><td>Multi-AZ, provider-managed, invisible</td></tr><tr><td><strong>Datastore</strong></td><td>Kine/SQLite, nightly backup</td><td>~23h RPO</td><td>etcd with sub-minute replication</td></tr><tr><td><strong>Workers</strong></td><td>4 nodes, <code>swift-mac</code> isolated for StatefulSets</td><td><code>swift-mac</code> hang = manual recovery</td><td>Auto-repair, VM-level power control</td></tr><tr><td><strong>Pods</strong></td><td>3 replicas, PDB, Argo Rollouts canary</td><td>—</td><td>Same patterns apply on managed k8s</td></tr><tr><td><strong>Storage</strong></td><td>Longhorn 2-replica volumes</td><td>Double-node loss = volume inaccessible</td><td>Provider disk with hardware replication</td></tr><tr><td><strong>Ingress</strong></td><td>NGINX DaemonSet + MetalLB L2</td><td>ARP cache expiry = ~30s VIP failover</td><td>Provider ALB/GLB, sub-second failover</td></tr><tr><td><strong>Observability</strong></td><td>Prometheus + Loki + Tempo + AlertManager</td><td>You operate the stack</td><td>Managed CloudWatch / Cloud Monitoring</td></tr></tbody></table>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-this-teaches-that-managed-kubernetes-doesnt">What This Teaches That Managed Kubernetes Doesn't<a href="https://docs.devandre.sbs/blog/high-availability-bare-metal-kubernetes#what-this-teaches-that-managed-kubernetes-doesnt" class="hash-link" aria-label="Direct link to What This Teaches That Managed Kubernetes Doesn't" title="Direct link to What This Teaches That Managed Kubernetes Doesn't" translate="no">​</a></h2>
<p>Running HA on bare-metal forces you to understand each layer independently because each one can fail independently.</p>
<p>On EKS, you set <code>--node-count 3</code> and get worker redundancy, storage replication, load balancer failover, and control plane HA all at once — from a single API call. The system works, the failure modes are rare, and you never have to think about MetalLB ARP cache expiry or Longhorn replica count during node drains.</p>
<p>What you lose: the mental model of <em>why</em> it works. When something does go wrong on a managed cluster — and things do go wrong — engineers who only know the "tick the HA checkbox" path struggle to diagnose whether the failure is at the control plane layer, the storage layer, or the network layer.</p>
<p>On bare-metal, you cannot avoid building that mental model. The six layers above are not abstractions. They are decisions I made, configured, tested with live chaos experiments, and documented. Each one maps directly to a concept that appears in production managed Kubernetes incidents.</p>
<p>The same Argo Rollout that protects production deployments on minicloud works identically on EKS. The same PDB that blocks the k3s upgrade drain from evicting all replicas works identically on GKE. The same Prometheus inhibit rule that suppresses false alerts during chaos testing works identically on AKS.</p>
<p>The difference is that on bare-metal, you cannot skip the understanding to get to the result.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>high-availability</category>
            <category>bare-metal</category>
            <category>platform-engineering</category>
            <category>longhorn</category>
            <category>argo-rollouts</category>
            <category>nginx</category>
            <category>metallb</category>
            <category>chaos-engineering</category>
            <category>eks</category>
            <category>gke</category>
            <category>aks</category>
        </item>
        <item>
            <title><![CDATA[Goodbye Microsoft Teams: Running Your Own Video Conferencing with Jitsi Meet on Kubernetes]]></title>
            <link>https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative</link>
            <guid>https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative</guid>
            <pubDate>Tue, 28 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A deep dive into self-hosting Jitsi Meet as a full Microsoft Teams replacement — architecture, WebRTC internals, Kubernetes deployment, Authentik SSO, and solving the SFR 5G DS-Lite CGNAT problem with a direct IPv6 media path. Everything you need to understand and build it yourself.
]]></description>
            <content:encoded><![CDATA[<p>Microsoft Teams costs money. It sends your meeting data to servers you don't control. It requires accounts in a Microsoft tenant. And if the licensing changes, your video conferencing disappears overnight.</p>
<p>Jitsi Meet costs nothing, runs on hardware you own, keeps your data inside your network, and works with any browser — no app install required.</p>
<p>This is the story of how I deployed it on a bare-metal Kubernetes cluster, solved a tricky network problem with SFR 5G mobile users, and wired it up to a company-wide SSO system. By the end of this post, you'll understand how WebRTC video calls actually work, and have a clear map for deploying Jitsi yourself.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-is-jitsi-meet">What Is Jitsi Meet?<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#what-is-jitsi-meet" class="hash-link" aria-label="Direct link to What Is Jitsi Meet?" title="Direct link to What Is Jitsi Meet?" translate="no">​</a></h2>
<p>Jitsi Meet is a fully open-source video conferencing platform. You open a browser, type a room name, and start a call. No account required for participants, no app to install, no per-seat licensing.</p>
<p>Under the hood it uses <strong>WebRTC</strong> — the same standard that Google Meet, Zoom's browser client, and Discord video all use. The difference is that with Jitsi, you run the servers yourself.</p>
<p>The platform is maintained by 8x8 (the company that acquired the Jitsi project from Atlassian), but the code is 100% open source under the Apache 2.0 license.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-not-just-use-teams-or-zoom">Why Not Just Use Teams or Zoom?<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#why-not-just-use-teams-or-zoom" class="hash-link" aria-label="Direct link to Why Not Just Use Teams or Zoom?" title="Direct link to Why Not Just Use Teams or Zoom?" translate="no">​</a></h3>
<table><thead><tr><th></th><th>Microsoft Teams</th><th>Zoom</th><th>Jitsi (self-hosted)</th></tr></thead><tbody><tr><td><strong>Cost</strong></td><td>€4–12.50/user/month</td><td>€139/year/host</td><td>Free</td></tr><tr><td><strong>Data location</strong></td><td>Microsoft datacenters</td><td>Zoom datacenters</td><td>Your servers</td></tr><tr><td><strong>Browser support</strong></td><td>Chrome, Edge (limited Firefox)</td><td>All browsers</td><td>All browsers</td></tr><tr><td><strong>Account required</strong></td><td>Yes (Microsoft account)</td><td>Yes for hosts</td><td>No</td></tr><tr><td><strong>No-app join</strong></td><td>Limited</td><td>Yes</td><td>Yes</td></tr><tr><td><strong>Custom branding</strong></td><td>Enterprise tier</td><td>Enterprise tier</td><td>Free</td></tr><tr><td><strong>API access</strong></td><td>Yes (Graph API)</td><td>Yes</td><td>Yes</td></tr><tr><td><strong>SSO integration</strong></td><td>Azure AD</td><td>SAML/OIDC ($)</td><td>Any OIDC provider</td></tr><tr><td><strong>On-premise</strong></td><td>Teams Rooms only</td><td>No</td><td>Full stack</td></tr></tbody></table>
<p>The tradeoff is clear: you trade money and vendor lock-in for the operational responsibility of running the infrastructure.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-jitsi-works-the-four-core-components">How Jitsi Works: The Four Core Components<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#how-jitsi-works-the-four-core-components" class="hash-link" aria-label="Direct link to How Jitsi Works: The Four Core Components" title="Direct link to How Jitsi Works: The Four Core Components" translate="no">​</a></h2>
<p>Jitsi is not a single application — it's four services that work together. Understanding what each one does is the key to deploying and troubleshooting it confidently.</p>
<div style="text-align:center;margin:2rem 0"><img src="https://docs.devandre.sbs/img/blog/jitsi/jitsi-architecture.svg" alt="Jitsi Meet full system architecture diagram" style="max-width:100%;border-radius:8px"><div style="color:#8b949e;font-size:0.9rem;margin-top:0.5rem"><p>Full architecture: Jitsi stack, TURN relay, SSO, and the three media paths</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-jitsi-web--the-frontend">1. Jitsi Web — The Frontend<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#1-jitsi-web--the-frontend" class="hash-link" aria-label="Direct link to 1. Jitsi Web — The Frontend" title="Direct link to 1. Jitsi Web — The Frontend" translate="no">​</a></h3>
<p>This is the web application you see when you open <code>meet.devandre.sbs</code>. It's a React/JavaScript application that:</p>
<ul>
<li class="">Serves the meeting UI</li>
<li class="">Loads the configuration (which XMPP server to connect to, which TURN servers to use)</li>
<li class="">Uses the browser's WebRTC APIs to capture your camera and microphone</li>
</ul>
<p>It's entirely static files. No backend logic — it just hands control over to the browser's WebRTC engine once loaded.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-prosody--the-signaling-server">2. Prosody — The Signaling Server<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#2-prosody--the-signaling-server" class="hash-link" aria-label="Direct link to 2. Prosody — The Signaling Server" title="Direct link to 2. Prosody — The Signaling Server" translate="no">​</a></h3>
<p>Prosody is an XMPP server. XMPP is a chat protocol (the same one WhatsApp was originally built on), and Jitsi reuses it for <strong>signaling</strong> — the messages that coordinate the call setup before any video flows.</p>
<p>When you join a room, your browser connects to Prosody over a WebSocket and sends messages like:</p>
<ul>
<li class="">"I want to join room <code>myroom</code>"</li>
<li class="">"Here are my ICE candidates (my network addresses)"</li>
<li class="">"Here is my SDP offer (what audio/video codecs I support)"</li>
</ul>
<p>Prosody forwards these messages to the other participants and to Jicofo.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-jicofo--the-conference-orchestrator">3. Jicofo — The Conference Orchestrator<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#3-jicofo--the-conference-orchestrator" class="hash-link" aria-label="Direct link to 3. Jicofo — The Conference Orchestrator" title="Direct link to 3. Jicofo — The Conference Orchestrator" translate="no">​</a></h3>
<p>Jicofo stands for <strong>Jitsi Conference Focus</strong>. It's the brains of the operation:</p>
<ul>
<li class="">Creates the conference when the first person joins</li>
<li class="">Tells JVB to allocate a new endpoint for each participant</li>
<li class="">Sends each participant the SDP offer/answer with JVB's network addresses</li>
<li class="">Manages participant lifecycle (join, leave, mute)</li>
</ul>
<p>Think of Jicofo as the conference room manager: it reserves the room, hands out name tags (ICE candidates), and makes sure everyone knows where to sit.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="4-jvb--the-video-bridge-the-critical-one">4. JVB — The Video Bridge (The Critical One)<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#4-jvb--the-video-bridge-the-critical-one" class="hash-link" aria-label="Direct link to 4. JVB — The Video Bridge (The Critical One)" title="Direct link to 4. JVB — The Video Bridge (The Critical One)" translate="no">​</a></h3>
<p>JVB stands for <strong>Jitsi Video Bridge</strong>. This is where all the actual video traffic flows through.</p>
<p>JVB is an <strong>SFU — Selective Forwarding Unit</strong>. Here's what that means in plain English:</p>
<blockquote>
<p>In a normal video call between 3 people, each person would need to upload their video to the other 2. With 10 people, that's 9 upload streams each. It scales terribly.</p>
<p>An SFU sits in the middle. Each person uploads <strong>one stream</strong> to the SFU. The SFU then <strong>forwards</strong> the right streams to the right people. 3 people → 3 upload streams total, not 6.</p>
</blockquote>
<p>Crucially, JVB does <strong>not decode your video</strong>. It forwards encrypted packets. The content of your video never leaves the encrypted stream, even though it passes through the JVB server.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-a-call-is-actually-established">How a Call Is Actually Established<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#how-a-call-is-actually-established" class="hash-link" aria-label="Direct link to How a Call Is Actually Established" title="Direct link to How a Call Is Actually Established" translate="no">​</a></h2>
<p>The connection process sounds complicated, but it follows a clear sequence. Here's what happens between "clicking Join" and "seeing your colleague's face":</p>
<div style="text-align:center;margin:2rem 0"><img src="https://docs.devandre.sbs/img/blog/jitsi/jitsi-call-flow.svg" alt="Jitsi call establishment sequence diagram" style="max-width:100%;border-radius:8px"><div style="color:#8b949e;font-size:0.9rem;margin-top:0.5rem"><p>Step-by-step: from browser click to live SRTP video</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-1-authentication">Step 1: Authentication<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-1-authentication" class="hash-link" aria-label="Direct link to Step 1: Authentication" title="Direct link to Step 1: Authentication" translate="no">​</a></h3>
<p>Before seeing anything, your browser hits the NGINX ingress which forwards the request to Authentik. If you have a valid SSO session, you're let through immediately. If not, you're redirected to the Authentik login page (username + TOTP code). Once authenticated, the Jitsi Web UI loads.</p>
<p>This means <strong>no one can join a meeting without a company account</strong>. The room name is not a secret — the SSO layer is the gate.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-2-signaling-xmpp">Step 2: Signaling (XMPP)<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-2-signaling-xmpp" class="hash-link" aria-label="Direct link to Step 2: Signaling (XMPP)" title="Direct link to Step 2: Signaling (XMPP)" translate="no">​</a></h3>
<p>Your browser connects to Prosody over a WebSocket and sends a "join room" request. Prosody passes this to Jicofo, which tells JVB to create a new endpoint for you. JVB replies with its network addresses — its <strong>ICE candidates</strong>.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-3-ice--finding-the-best-network-path">Step 3: ICE — Finding the Best Network Path<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-3-ice--finding-the-best-network-path" class="hash-link" aria-label="Direct link to Step 3: ICE — Finding the Best Network Path" title="Direct link to Step 3: ICE — Finding the Best Network Path" translate="no">​</a></h3>
<p>This is the step most people don't know about. <strong>ICE (Interactive Connectivity Establishment)</strong> is the process where your browser and JVB negotiate the best way to reach each other.</p>
<p>ICE works by both sides listing all their network addresses (called <strong>candidates</strong>), then trying each one in priority order until they find one that works:</p>
<ul>
<li class=""><strong>Host candidates</strong>: direct IP addresses (LAN IPs, Tailscale IPs, IPv6 addresses)</li>
<li class=""><strong>Server-reflexive candidates</strong>: your public IP as seen from a STUN server</li>
<li class=""><strong>Relayed candidates</strong>: addresses on a TURN relay server</li>
</ul>
<p>The browser tries them all in parallel. The first one that gets a successful STUN ping response is selected.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-4-dtls--srtp">Step 4: DTLS + SRTP<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-4-dtls--srtp" class="hash-link" aria-label="Direct link to Step 4: DTLS + SRTP" title="Direct link to Step 4: DTLS + SRTP" translate="no">​</a></h3>
<p>Once ICE selects a path, the browser and JVB perform a <strong>DTLS handshake</strong> — essentially TLS over UDP. From this handshake, both sides derive encryption keys. From that point on, all audio and video is encrypted as <strong>SRTP</strong> (Secure Real-time Transport Protocol).</p>
<p>The video stream is encrypted end-to-end in the sense that it's always in an encrypted SRTP packet. JVB forwards these packets without ever having the decryption key.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-deployment-jitsi-on-kubernetes">The Deployment: Jitsi on Kubernetes<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-deployment-jitsi-on-kubernetes" class="hash-link" aria-label="Direct link to The Deployment: Jitsi on Kubernetes" title="Direct link to The Deployment: Jitsi on Kubernetes" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-kubernetes">Why Kubernetes?<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#why-kubernetes" class="hash-link" aria-label="Direct link to Why Kubernetes?" title="Direct link to Why Kubernetes?" translate="no">​</a></h3>
<p>Running Jitsi as four Docker Compose services on a single VM works fine for a small team. The reasons to move to Kubernetes are:</p>
<ul>
<li class=""><strong>Automatic restarts</strong> if a component crashes</li>
<li class=""><strong>Resource limits</strong> to prevent one service starving the others</li>
<li class=""><strong>GitOps</strong> — every configuration change is a git commit, not a manual edit on a server</li>
<li class=""><strong>Secrets management</strong> via Vault + External Secrets Operator (no passwords in git)</li>
<li class=""><strong>Observability</strong> — Prometheus scraping, Grafana dashboards, Loki logs</li>
</ul>
<p>The Jitsi stack in this setup runs in a dedicated <code>collab</code> namespace on k3s.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-helm-chart-and-values">The Helm Chart and Values<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-helm-chart-and-values" class="hash-link" aria-label="Direct link to The Helm Chart and Values" title="Direct link to The Helm Chart and Values" translate="no">​</a></h3>
<p>The community-maintained <code>jitsi-contrib</code> Helm chart deploys all four components with a single <code>helm install</code>. The key configuration decisions:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># helm-values/jitsi-values.yaml (simplified)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">publicURL</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://meet.devandre.sbs"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">tz</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Europe/Paris"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># No per-meeting JWT auth — Authentik handles access control</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># at the HTTP level before anyone reaches Jitsi</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">enableAuth</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">enableGuests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">jvb</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># JVB must use the host's network interfaces directly</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># so it can bind to the real IP and IPv6 addresses</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">useHostNetwork</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Pin JVB to the node with the right network config</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kubernetes.io/hostname</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> star</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">kitten</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Advertise the LAN IP so Tailscale/LAN clients can reach it directly</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">publicIPs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"10.0.0.8"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># The media port — must match the UFW rule and SFR box firewall</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">UDPPort</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">10000</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">prosody</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># Inject TURN config via ConfigMap + ESO secret</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">extraEnvFrom</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">configMapRef</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> jitsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">coturn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">config    </span><span class="token comment" style="color:#999988;font-style:italic"># TURN_HOST, TURN_PORT</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">secretRef</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> jitsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">coturn</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">secret    </span><span class="token comment" style="color:#999988;font-style:italic"># TURN_CREDENTIALS (HMAC)</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-jvb-hostnetwork-true-decision">The JVB <code>hostNetwork: true</code> Decision<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-jvb-hostnetwork-true-decision" class="hash-link" aria-label="Direct link to the-jvb-hostnetwork-true-decision" title="Direct link to the-jvb-hostnetwork-true-decision" translate="no">​</a></h3>
<p>This is the most important configuration choice. By default, a Kubernetes pod gets its own virtual network interface with a private pod IP (<code>10.42.x.x</code>). That's fine for web services, but fatal for a video bridge.</p>
<p>JVB needs to send UDP packets directly to your browser's IP. With a pod network, the packets would be source-NAT'd to the node's IP by <code>kube-proxy</code> — and JVB would think all clients are coming from the node itself, destroying ICE.</p>
<p>With <code>hostNetwork: true</code>, the JVB pod shares the host's network namespace. It binds to <code>star-kitten</code>'s actual interfaces: <code>10.0.0.8</code> (LAN), <code>100.x.x.x</code> (Tailscale), and all IPv6 addresses assigned by the SFR router. Every interface becomes an ICE candidate.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="secrets-management">Secrets Management<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#secrets-management" class="hash-link" aria-label="Direct link to Secrets Management" title="Direct link to Secrets Management" translate="no">​</a></h3>
<p>No passwords are hardcoded. All secrets flow from Vault through the External Secrets Operator:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Vault secret/platform/jitsi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  ├── jvb-auth-user          → Kubernetes Secret jitsi-jvb-secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  ├── jvb-auth-password      →   (used by prosody + jvb)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  ├── jicofo-auth-password   → Kubernetes Secret jitsi-jicofo-secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  └── coturn-secret          → Kubernetes Secret jitsi-coturn-secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                                 (HMAC key for TURN auth tokens)</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-sso-integration-authentik">The SSO Integration: Authentik<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-sso-integration-authentik" class="hash-link" aria-label="Direct link to The SSO Integration: Authentik" title="Direct link to The SSO Integration: Authentik" translate="no">​</a></h2>
<p>Every app on this platform is protected by Authentik, an open-source identity provider. For Jitsi, the setup uses <strong>forward-auth</strong> at the NGINX ingress layer.</p>
<p>Here's how it works:</p>
<ol>
<li class="">A request arrives at <code>meet.devandre.sbs</code></li>
<li class="">NGINX sends a sub-request to Authentik's <code>/outpost.goauthentik.io/auth/nginx</code> endpoint</li>
<li class="">Authentik checks if the request has a valid session cookie</li>
<li class="">If yes: NGINX forwards the request to Jitsi Web, also injecting the username as <code>X-authentik-username</code></li>
<li class="">If no: NGINX returns a 302 redirect to the Authentik login page</li>
</ol>
<p>The entire authentication flow is handled before a single Jitsi component sees the request. Jitsi itself doesn't know or care about authentication — the NGINX ingress already filtered out unauthenticated users.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">nginx.ingress.kubernetes.io/configuration-snippet: |</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  auth_request     /outpost.goauthentik.io/auth/nginx;</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  error_page       401 = @goauthentik_proxy_signin;</span><br></div></code></pre></div></div>
<p>The benefit: any change to who can access Jitsi (new users, MFA policies, group restrictions) is made in Authentik, not in Jitsi's configuration. Jitsi doesn't need to know about your user directory.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-turn-server-reaching-clients-behind-nat">The TURN Server: Reaching Clients Behind NAT<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-turn-server-reaching-clients-behind-nat" class="hash-link" aria-label="Direct link to The TURN Server: Reaching Clients Behind NAT" title="Direct link to The TURN Server: Reaching Clients Behind NAT" translate="no">​</a></h2>
<p>Most home and office networks use NAT (Network Address Translation). Your laptop has a private IP like <code>192.168.1.50</code>, but the internet sees it as your router's public IP <code>37.65.x.x</code>. This creates a problem for WebRTC: how does JVB send video packets to <code>192.168.1.50</code> when it only knows the public IP?</p>
<p>STUN helps for most cases by discovering the public IP and port. But some firewalls and carrier NATs are strict enough that STUN doesn't work. That's where <strong>TURN</strong> comes in.</p>
<p>A TURN server is a relay. Instead of connecting directly to JVB, the client connects to the TURN server and says "relay my packets to JVB". The TURN server forwards everything in both directions.</p>
<p>In this setup, Coturn runs on the controller (the ThinkPad X390 that also runs MAAS and NAT for the cluster), exposed via port-forward on the home router.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">turn.devandre.sbs → 37.65.57.112 (public IP) → router NAT → 192.168.1.130 (controller)</span><br></div></code></pre></div></div>
<p>Coturn uses <strong>time-limited HMAC tokens</strong> for authentication. Prosody generates a fresh token when you join a meeting. The token encodes your username and an expiry timestamp, signed with a shared secret. Even if someone intercepts the token, it stops working after 24 hours.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-sfr-5g-problem--and-the-ipv6-solution">The SFR 5G Problem — and the IPv6 Solution<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-sfr-5g-problem--and-the-ipv6-solution" class="hash-link" aria-label="Direct link to The SFR 5G Problem — and the IPv6 Solution" title="Direct link to The SFR 5G Problem — and the IPv6 Solution" translate="no">​</a></h2>
<p>This is the most interesting part of the deployment, and the problem that took the longest to diagnose.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-problem-ds-lite-blocks-inbound-ipv4">The Problem: DS-Lite Blocks Inbound IPv4<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-problem-ds-lite-blocks-inbound-ipv4" class="hash-link" aria-label="Direct link to The Problem: DS-Lite Blocks Inbound IPv4" title="Direct link to The Problem: DS-Lite Blocks Inbound IPv4" translate="no">​</a></h3>
<p>SFR (a French mobile carrier) uses a technology called <strong>DS-Lite</strong> on their 5G network. In DS-Lite, your phone gets a real public IPv6 address, but its IPv4 traffic is tunneled through a shared carrier-grade NAT (CGNAT) called an AFTR.</p>
<p>The consequence: <strong>inbound IPv4 connections to your phone are blocked at the carrier level</strong>. The AFTR sits between your phone and the internet, and it doesn't forward unsolicited inbound packets.</p>
<p>This breaks TURN. WebRTC browsers always request <code>REQUESTED-ADDRESS-FAMILY=IPv4</code> when allocating a TURN relay address. The TURN server gives you a relay IPv4 address, but when JVB tries to send media to it, the packet never reaches the phone — it's blocked at the AFTR.</p>
<div style="text-align:center;margin:2rem 0"><img src="https://docs.devandre.sbs/img/blog/jitsi/jitsi-network-paths.svg" alt="Jitsi network media paths diagram" style="max-width:100%;border-radius:8px"><div style="color:#8b949e;font-size:0.9rem;margin-top:0.5rem"><p>The three media paths: LAN/Tailscale, IPv6 direct (SFR 5G), and TURN relay fallback</p></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-diagnosis">The Diagnosis<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-diagnosis" class="hash-link" aria-label="Direct link to The Diagnosis" title="Direct link to The Diagnosis" translate="no">​</a></h3>
<p>The phone's ICE negotiation appeared to be working — the STUN packets from the phone were arriving at <code>star-kitten</code>'s network interface. <code>tcpdump</code> captured them clearly. But JVB never responded.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># tcpdump on star-kitten — packets visible at NIC level:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 21:17:32 2a0d:e487:22af:6804::1 &gt; 2a02:8424:6ee0:be01:fa75:a4ff:fef9:2fe9: UDP 108</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 21:17:32 2a0d:e487:22af:6804::1 &gt; 2a02:8424:6ee0:be01:fa75:a4ff:fef9:2fe9: UDP 108</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># (zero outbound packets from JVB)</span><br></div></code></pre></div></div>
<p>The firewall was the culprit. Ubuntu's UFW was configured with IPv4 rules only — <code>ufw allow 10000/udp</code> adds an iptables rule for IPv4, but the IPv6 equivalent (ip6tables) was an empty chain with policy DROP.</p>
<p>The packets arrived at the NIC. The firewall dropped them before they reached JVB's socket.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-fix">The Fix<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#the-fix" class="hash-link" aria-label="Direct link to The Fix" title="Direct link to The Fix" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># On star-kitten — this adds BOTH IPv4 and IPv6 rules:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo ufw allow 10000/udp</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Creates:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">#   iptables  -A ufw-user-input -p udp --dport 10000 -j ACCEPT</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">#   ip6tables -A ufw6-user-input -p udp --dport 10000 -j ACCEPT</span><br></div></code></pre></div></div>
<p>And on the SFR home router (GR140IG), three IPv6 firewall rules to allow inbound traffic to the cluster (Sécurité → Accès → Réseau v6):</p>
<table><thead><tr><th>Rule name</th><th>Destination</th><th>Port</th><th>Protocol</th></tr></thead><tbody><tr><td><code>jvb-v6</code></td><td><code>2a02:8424:6ee0:be01:fa75:a4ff:fef9:2fe9</code></td><td>10000</td><td>UDP</td></tr><tr><td><code>coturn-turn-v6</code></td><td><code>2a02:8424:6ee0:be01:df85:1432:24b6:4494</code></td><td>3478</td><td>TCP + UDP</td></tr><tr><td><code>coturn-relay-v6</code></td><td>same</td><td>49152–49199</td><td>UDP</td></tr></tbody></table>
<p>After the fix, the result was immediate:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ICE state: Completed</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Selected pair: [fa75:a4ff:fef9:2fe9]:10000/udp/host → [2a0d:e487:…]:57806/udp/prflx</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">DTLS 1.2 complete</span><br></div></code></pre></div></div>
<p>The phone connected in under one second with zero TURN relay, using a direct IPv6 path between the 5G network and <code>star-kitten</code>'s IPv6 address — bypassing CGNAT entirely.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="setting-it-up-yourself-a-practical-guide">Setting It Up Yourself: A Practical Guide<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#setting-it-up-yourself-a-practical-guide" class="hash-link" aria-label="Direct link to Setting It Up Yourself: A Practical Guide" title="Direct link to Setting It Up Yourself: A Practical Guide" translate="no">​</a></h2>
<p>Here's a condensed step-by-step for deploying Jitsi on your own Kubernetes cluster.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="prerequisites">Prerequisites<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#prerequisites" class="hash-link" aria-label="Direct link to Prerequisites" title="Direct link to Prerequisites" translate="no">​</a></h3>
<ul>
<li class="">A Kubernetes cluster (k3s, EKS, GKE — doesn't matter)</li>
<li class="">NGINX Ingress Controller</li>
<li class="">cert-manager for TLS certificates</li>
<li class="">A domain name with DNS control</li>
<li class="">A node where JVB will run (needs a public or routable IP)</li>
</ul>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-1--add-the-helm-repository">Step 1 — Add the Helm Repository<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-1--add-the-helm-repository" class="hash-link" aria-label="Direct link to Step 1 — Add the Helm Repository" title="Direct link to Step 1 — Add the Helm Repository" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">helm repo add jitsi-contrib https://jitsi-contrib.github.io/jitsi-helm/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">helm repo update</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-2--generate-random-passwords">Step 2 — Generate Random Passwords<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-2--generate-random-passwords" class="hash-link" aria-label="Direct link to Step 2 — Generate Random Passwords" title="Direct link to Step 2 — Generate Random Passwords" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># These go in Kubernetes Secrets or Vault</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">JICOFO_PASSWORD=$(openssl rand -hex 32)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">JVB_PASSWORD=$(openssl rand -hex 32)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TURN_SECRET=$(openssl rand -hex 32)</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-3--create-the-namespace-and-secrets">Step 3 — Create the Namespace and Secrets<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-3--create-the-namespace-and-secrets" class="hash-link" aria-label="Direct link to Step 3 — Create the Namespace and Secrets" title="Direct link to Step 3 — Create the Namespace and Secrets" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl create namespace jitsi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl create secret generic jitsi-jicofo-secret -n jitsi \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --from-literal=JICOFO_AUTH_PASSWORD=$JICOFO_PASSWORD</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl create secret generic jitsi-jvb-secret -n jitsi \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --from-literal=JVB_AUTH_PASSWORD=$JVB_PASSWORD</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl create secret generic jitsi-turn-secret -n jitsi \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --from-literal=TURN_CREDENTIALS=$TURN_SECRET</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-4--write-your-values-file">Step 4 — Write Your Values File<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-4--write-your-values-file" class="hash-link" aria-label="Direct link to Step 4 — Write Your Values File" title="Direct link to Step 4 — Write Your Values File" translate="no">​</a></h3>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># values.yaml</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">publicURL</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"https://meet.yourdomain.com"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">tz</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"Europe/Paris"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">enableAuth</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">enableGuests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">web</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">ingress</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">enabled</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">ingressClassName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> nginx</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">cert-manager.io/cluster-issuer</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> letsencrypt</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">prod</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">hosts</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">host</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> meet.yourdomain.com</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">paths</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">/</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">tls</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">secretName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> jitsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">tls</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">hosts</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">meet.yourdomain.com</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">jvb</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">useHostNetwork</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain">          </span><span class="token comment" style="color:#999988;font-style:italic"># Critical — do not skip this</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">kubernetes.io/hostname</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> YOUR_NODE_NAME</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">publicIPs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"YOUR_NODE_PUBLIC_IP"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">UDPPort</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">10000</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">xmpp</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">existingSecretName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> jitsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">jvb</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">jicofo</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">xmpp</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">existingSecretName</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> jitsi</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">jicofo</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">coturn</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">enabled</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain">    </span><span class="token comment" style="color:#999988;font-style:italic"># Run Coturn separately for more control</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-5--open-the-firewall">Step 5 — Open the Firewall<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-5--open-the-firewall" class="hash-link" aria-label="Direct link to Step 5 — Open the Firewall" title="Direct link to Step 5 — Open the Firewall" translate="no">​</a></h3>
<p>On the node where JVB will run:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Allow WebRTC media traffic</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo ufw allow 10000/udp</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Verify both IPv4 and IPv6 rules were added:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo ufw status numbered</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Should show rules 3 and 4 for port 10000/udp</span><br></div></code></pre></div></div>
<p>Also open UDP 10000 on your router/cloud security group pointing to that node.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-6--install">Step 6 — Install<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-6--install" class="hash-link" aria-label="Direct link to Step 6 — Install" title="Direct link to Step 6 — Install" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">helm install jitsi jitsi-contrib/jitsi-meet \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -n jitsi \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -f values.yaml</span><br></div></code></pre></div></div>
<p>Check that all pods are running:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl get pods -n jitsi</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># NAME                          READY   STATUS    RESTARTS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># jitsi-web-xxx                 1/1     Running   0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># jitsi-prosody-xxx             1/1     Running   0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># jitsi-jicofo-xxx              1/1     Running   0</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># jitsi-jvb-xxx                 1/1     Running   0</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="step-7--test">Step 7 — Test<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#step-7--test" class="hash-link" aria-label="Direct link to Step 7 — Test" title="Direct link to Step 7 — Test" translate="no">​</a></h3>
<p>Open <code>https://meet.yourdomain.com/test</code> in two different browsers (or browser + phone). If video flows in both directions, ICE completed successfully.</p>
<p>To check which ICE candidate was selected, open the browser developer console and run:</p>
<div class="language-javascript codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-javascript codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic">// In Chrome/Edge — shows the selected ICE pair</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> pc </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token constant" style="color:#36acaa">APP</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">conference</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">_room</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">rtc</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">_peerConnections</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">values</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">next</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">value</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">peerconnection</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token keyword" style="color:#00009f">const</span><span class="token plain"> stats </span><span class="token operator" style="color:#393A34">=</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">await</span><span class="token plain"> pc</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">getStats</span><span class="token punctuation" style="color:#393A34">(</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">stats</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">forEach</span><span class="token punctuation" style="color:#393A34">(</span><span class="token parameter">s</span><span class="token plain"> </span><span class="token arrow operator" style="color:#393A34">=&gt;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token keyword control-flow" style="color:#00009f">if</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">s</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">type</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">===</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'candidate-pair'</span><span class="token plain"> </span><span class="token operator" style="color:#393A34">&amp;&amp;</span><span class="token plain"> s</span><span class="token punctuation" style="color:#393A34">.</span><span class="token property-access">nominated</span><span class="token punctuation" style="color:#393A34">)</span><span class="token plain"> </span><span class="token console class-name">console</span><span class="token punctuation" style="color:#393A34">.</span><span class="token method function property-access" style="color:#d73a49">log</span><span class="token punctuation" style="color:#393A34">(</span><span class="token plain">s</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">)</span><span class="token punctuation" style="color:#393A34">;</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="coturn-running-your-own-turn-server">Coturn: Running Your Own TURN Server<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#coturn-running-your-own-turn-server" class="hash-link" aria-label="Direct link to Coturn: Running Your Own TURN Server" title="Direct link to Coturn: Running Your Own TURN Server" translate="no">​</a></h2>
<p>For users who can't connect directly (strict corporate firewalls, certain mobile networks), a TURN server is the fallback.</p>
<p>Coturn is the most widely deployed open-source TURN server. Here's the minimum configuration:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># /etc/coturn/turnserver.conf</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># The IP Coturn listens on (your server's LAN IP)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">listening-ip=192.168.1.130</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Optional: add IPv6 if your server has a public IPv6</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">listening-ip=2001:db8::1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Map private listening IP to public IP for external clients</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">external-ip=203.0.113.1/192.168.1.130</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">external-ip=2001:db8::1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">listening-port=3478</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">min-port=49152</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">max-port=49199</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">realm=yourdomain.com</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># HMAC authentication (time-limited tokens — more secure than user/password)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">use-auth-secret</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">static-auth-secret=YOUR_RANDOM_SECRET_HERE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Only allow relay to your JVB node (security!)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">allowed-peer-ip=10.0.0.0-10.255.255.255</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">no-loopback-peers</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">no-multicast-peers</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">log-file=stdout</span><br></div></code></pre></div></div>
<p>Run it as a Docker container:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">docker run -d --name coturn \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --net=host \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --restart=always \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -v /etc/coturn:/etc/coturn:ro \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  coturn/coturn:4.6 \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -c /etc/coturn/turnserver.conf</span><br></div></code></pre></div></div>
<p>Then add the TURN config to Prosody's environment:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">TURN_HOST=turn.yourdomain.com</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TURN_PORT=3478</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TURN_TRANSPORT=udp</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TURN_CREDENTIALS=YOUR_RANDOM_SECRET_HERE</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="observability-knowing-when-something-is-wrong">Observability: Knowing When Something Is Wrong<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#observability-knowing-when-something-is-wrong" class="hash-link" aria-label="Direct link to Observability: Knowing When Something Is Wrong" title="Direct link to Observability: Knowing When Something Is Wrong" translate="no">​</a></h2>
<p>A self-hosted video platform needs monitoring. Three signals matter most:</p>
<p><strong>1. JVB conference count</strong> — are active calls happening?</p>
<div class="language-promql codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-promql codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">jitsi_jvb_conferences</span><br></div></code></pre></div></div>
<p><strong>2. ICE failures</strong> — are clients failing to connect?</p>
<div class="language-promql codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-promql codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">rate(jitsi_jvb_ice_failed_total[5m])</span><br></div></code></pre></div></div>
<p><strong>3. TURN allocation failures</strong> — is Coturn accepting connections?</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># From Coturn logs</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">docker logs coturn 2&gt;&amp;1 | grep -i "error\|failed" | tail -20</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="cost-comparison-self-hosted-vs-saas">Cost Comparison: Self-Hosted vs SaaS<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#cost-comparison-self-hosted-vs-saas" class="hash-link" aria-label="Direct link to Cost Comparison: Self-Hosted vs SaaS" title="Direct link to Cost Comparison: Self-Hosted vs SaaS" translate="no">​</a></h2>
<p>For a team of 20 people:</p>
<table><thead><tr><th>Solution</th><th>Monthly cost</th><th>Data location</th><th>Control</th></tr></thead><tbody><tr><td>Microsoft Teams Essentials</td><td>€38 (€1.90/user)</td><td>Microsoft EU</td><td>Low</td></tr><tr><td>Microsoft 365 Business Basic</td><td>€120 (€6/user)</td><td>Microsoft EU</td><td>Low</td></tr><tr><td>Zoom Pro</td><td>€115/month (10 hosts)</td><td>Zoom datacenters</td><td>Low</td></tr><tr><td><strong>Jitsi (self-hosted)</strong></td><td><strong>~€5 electricity</strong></td><td><strong>Your rack</strong></td><td><strong>Full</strong></td></tr></tbody></table>
<p>The €5/month is an estimate for the extra power draw of dedicating one machine to the task. If it runs on hardware you already own for other purposes (as in this setup), the marginal cost is essentially zero.</p>
<p>The real cost is engineering time to set up and maintain it — roughly 8–10 hours initial setup, then 1–2 hours per month for updates and monitoring review.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="lessons-learned">Lessons Learned<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#lessons-learned" class="hash-link" aria-label="Direct link to Lessons Learned" title="Direct link to Lessons Learned" translate="no">​</a></h2>
<p><strong>UFW's IPv6 rules are separate from IPv4 rules.</strong> <code>sudo ufw allow 10000/udp</code> adds both, but if you add the rule via iptables directly, you may only get IPv4. Always verify with <code>sudo ufw status numbered</code> and look for both the IPv4 and "Anywhere (v6)" entries.</p>
<p><strong>TURN cannot bridge IPv4 and IPv6.</strong> This is a fundamental WebRTC constraint. If a client's public IPv4 is behind carrier NAT (DS-Lite, CGNAT), TURN IPv4 relay is useless. The only solution is a direct IPv6 path — which requires the server to have a public IPv6 and the firewall to allow inbound IPv6 UDP.</p>
<p><strong><code>hostNetwork: true</code> on JVB is non-negotiable.</strong> Without it, ICE will never work correctly. You'll see candidates, but the STUN ping-pong will fail because the source IP of JVB's packets won't match any candidate.</p>
<p><strong>Authentik forward-auth is simpler than Jitsi's built-in JWT auth.</strong> Jitsi has its own JWT-based token system for room-level access control. It works, but it requires generating tokens for each meeting and distributing them. Authentik forward-auth at the ingress level is simpler and gives you all the access control you need for an internal team setup.</p>
<p><strong>The Helm chart's <code>coturn.enabled=false</code> path is underserved.</strong> When you run Coturn externally, the chart doesn't inject the TURN config into Prosody. You need to do it manually via <code>extraEnvFrom</code> with a ConfigMap and Secret. This is documented in the chart but easy to miss.</p>
<p><strong>Disable WebSocket transport when running behind Cloudflare.</strong> The <code>jitsi-contrib</code> chart has two WebSocket options: <code>websockets.colibri.enabled</code> (JVB signaling) and <code>websockets.xmpp.enabled</code> (Prosody). Both must be <code>false</code> when you proxy the domain through Cloudflare. Cloudflare's proxy layer interferes with the WebSocket upgrade on those paths, causing silent connection failures that are hard to distinguish from ICE problems. With them disabled, JVB uses SCTP over DTLS for signaling, which flows cleanly through the media channel.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">websockets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">colibri</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">enabled</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">xmpp</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">enabled</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><br></div></code></pre></div></div>
<p><strong>Authentik <code>forward_single</code> vs <code>forward_domain</code> — one provider per application.</strong> The <code>forward_domain</code> provider (which covers <code>*.devandre.sbs</code>) can only be assigned to a single Authentik application at a time. If you try to reuse it for Jitsi after it's already assigned to another app, you'll get "Application with this provider already exists." The solution: create a dedicated <code>forward_single</code> provider for Jitsi (<code>external_host: https://meet.devandre.sbs</code>), create a new application pointing to it, then PATCH the Embedded Outpost to add the new provider to its <code>providers</code> list. One provider, one application — always.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whats-next">What's Next<a href="https://docs.devandre.sbs/blog/jitsi-self-hosted-teams-alternative#whats-next" class="hash-link" aria-label="Direct link to What's Next" title="Direct link to What's Next" translate="no">​</a></h2>
<p>This deployment covers a team that's all connected to the same Tailscale network or behind the same carrier. For a deployment that needs to support <strong>large public meetings</strong> (100+ participants), the next step would be:</p>
<ul>
<li class="">Multiple JVB instances with <strong>Octo Cascade</strong> (JVB-to-JVB federation)</li>
<li class=""><strong>Jibri</strong> for meeting recording and live streaming</li>
<li class=""><strong>Jigasi</strong> for PSTN dial-in via SIP</li>
</ul>
<p>For the current use case — a 5-node bare-metal cluster serving a team of under 50 — a single JVB instance handles everything comfortably. JVB's forwarding is efficient: in a 10-person call, each participant uploads one stream, and JVB fans it out to the other 9. CPU usage on a single JVB stays under 30% for calls of that size.</p>
<hr>
<p>The full configuration lives in the <a href="https://github.com/KanmegneTabouguie/minicloud-gitops" target="_blank" rel="noopener noreferrer" class="">minicloud-gitops</a> repository under <code>helm-values/jitsi-values.yaml</code> and <code>manifests/jitsi/</code>.</p>]]></content:encoded>
            <category>jitsi</category>
            <category>webrtc</category>
            <category>kubernetes</category>
            <category>self-hosted</category>
            <category>video-conferencing</category>
            <category>teams-alternative</category>
            <category>ipv6</category>
            <category>turn</category>
            <category>coturn</category>
            <category>authentik</category>
            <category>sso</category>
            <category>platform-engineering</category>
        </item>
        <item>
            <title><![CDATA[Your Kubernetes Cluster Doesn't Run etcd — Mine Doesn't Either]]></title>
            <link>https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd</link>
            <guid>https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd</guid>
            <pubDate>Tue, 28 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[k3s replaces etcd with Kine/SQLite — one file on one machine. This post explains exactly what that means for backups, HA, and recovery on a bare-metal cluster, and contrasts it with how EKS, GKE, and AKS manage the same problem invisibly.
]]></description>
            <content:encoded><![CDATA[<p>Every Kubernetes tutorial mentions etcd. The architecture diagrams show a three-node etcd cluster with Raft consensus, leader election, and peer replication. If you run EKS, GKE, or AKS, that cluster exists somewhere — you just can never see it.</p>
<p>If you run k3s, you don't have etcd at all.</p>
<p>This post explains what k3s actually uses, what it means to manage backups and recovery yourself, and where that leaves you compared to a managed provider.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-etcd-actually-does-one-paragraph">What etcd Actually Does (One Paragraph)<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#what-etcd-actually-does-one-paragraph" class="hash-link" aria-label="Direct link to What etcd Actually Does (One Paragraph)" title="Direct link to What etcd Actually Does (One Paragraph)" translate="no">​</a></h2>
<p>etcd is a distributed key-value store that Kubernetes uses as its single source of truth. Every object you create — pods, secrets, ConfigMaps, RBAC roles, everything — is written to etcd. When the API server restarts, it reads from etcd to rebuild its in-memory state. When a controller reconciles, it watches etcd for changes.</p>
<p>Lose etcd, and the cluster becomes a read-only snapshot: running pods keep running (kubelet is independent), but no new scheduling, no config changes, no secret rotation. Corrupt etcd without a backup, and the cluster state is gone.</p>
<p>This is why every architecture diagram shows three etcd nodes. Raft consensus requires an odd quorum: three nodes tolerate one failure, five nodes tolerate two. A single etcd node has no tolerance.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-k3s-actually-uses">What k3s Actually Uses<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#what-k3s-actually-uses" class="hash-link" aria-label="Direct link to What k3s Actually Uses" title="Direct link to What k3s Actually Uses" translate="no">​</a></h2>
<p>k3s replaces etcd with <strong>Kine</strong> — a shim that translates the etcd v3 gRPC API into SQL queries. k3s passes all its normal etcd calls to Kine, and Kine writes them into a <strong>SQLite file</strong>:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">/var/lib/rancher/k3s/server/db/state.db</span><br></div></code></pre></div></div>
<p>One file. On one machine. No replication, no consensus, no peer nodes.</p>
<p>On my cluster, that machine is <code>set-hog</code> — a ThinkPad X390 running the k3s control plane. The file is about 55 MB after months of running 20+ workloads across 5 nodes.</p>
<p>This is not a compromise or a limitation — it is a deliberate design choice for small clusters. SQLite is <a href="https://www.sqlite.org/mostdeployed.html" target="_blank" rel="noopener noreferrer" class="">the most widely deployed database engine in the world</a>, its WAL mode handles concurrent reads without locking writes, and for a cluster under roughly 1,000 nodes it performs fine. k3s also supports swapping Kine's backend to PostgreSQL or MySQL if you need more throughput or multi-writer access.</p>
<p>The consequence is architectural simplicity: there is no etcd cluster to manage, no TLS peer certs, no quorum to maintain. There is one file to back up and one file to restore.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-two-backup-mechanisms">The Two Backup Mechanisms<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#the-two-backup-mechanisms" class="hash-link" aria-label="Direct link to The Two Backup Mechanisms" title="Direct link to The Two Backup Mechanisms" translate="no">​</a></h2>
<p>Because the state lives in one file, backup is straightforward — but I run two independent mechanisms because they have different failure modes.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="mechanism-1--controller-systemd-timer-0230-utc">Mechanism 1 — Controller systemd timer (02:30 UTC)<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#mechanism-1--controller-systemd-timer-0230-utc" class="hash-link" aria-label="Direct link to Mechanism 1 — Controller systemd timer (02:30 UTC)" title="Direct link to Mechanism 1 — Controller systemd timer (02:30 UTC)" translate="no">​</a></h3>
<p>Runs on the MAAS controller (<code>ktayl-ThinkPad-X390</code>), SSH-ing into <code>set-hog</code> to copy the file. Crucially, this runs <strong>outside Kubernetes</strong> — it has no dependency on the API server or on any pod being healthy.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">#!/bin/bash</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">set -euo pipefail</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TIMESTAMP=$(date -u +%Y%m%d-%H%M%S)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">BACKUP_KEY="kine/kine-${TIMESTAMP}.db.gz"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">TMP_DB="/tmp/kine-backup-${TIMESTAMP}.db"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># .backup holds a read transaction for the duration of the copy — WAL-safe.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># It produces a binary snapshot consistent to a single point in time.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh ubuntu@10.0.0.2 \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  "sudo sqlite3 /var/lib/rancher/k3s/server/db/state.db \".backup ${TMP_DB}\" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   &amp;&amp; sudo cat ${TMP_DB} \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">   ; sudo rm -f ${TMP_DB}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | gzip -9 \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | mc pipe "minilocal/db-backups/${BACKUP_KEY}"</span><br></div></code></pre></div></div>
<p>30-day retention. Files named <code>kine-YYYYMMDD-HHMMSS.db.gz</code>. This is the backup you can restore from even if k3s itself is the problem.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="mechanism-2--kubernetes-cronjob-0330-utc">Mechanism 2 — Kubernetes CronJob (03:30 UTC)<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#mechanism-2--kubernetes-cronjob-0330-utc" class="hash-link" aria-label="Direct link to Mechanism 2 — Kubernetes CronJob (03:30 UTC)" title="Direct link to Mechanism 2 — Kubernetes CronJob (03:30 UTC)" translate="no">​</a></h3>
<p>Runs inside the cluster, one hour after the systemd timer. A pod mounts the SQLite file via hostPath on <code>set-hog</code> and writes a binary backup directly to MinIO:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sqlite3 /db/state.db ".backup /backup/state-$(date +%Y%m%d%H%M%S).db"</span><br></div></code></pre></div></div>
<p>7-file retention in bucket <code>k3s-backup/</code>. <strong>If the control plane is dead, this job cannot run</strong> — which is exactly why the systemd timer exists.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-backup-and-not-dump">Why <code>.backup</code> and Not <code>.dump</code><a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#why-backup-and-not-dump" class="hash-link" aria-label="Direct link to why-backup-and-not-dump" title="Direct link to why-backup-and-not-dump" translate="no">​</a></h3>
<p>SQLite has two export methods: <code>.dump</code> produces SQL text (INSERT statements, CREATE TABLE, etc.), and <code>.backup</code> produces a binary copy.</p>
<p>The critical difference is consistency. <code>.dump</code> reads pages sequentially without holding a snapshot transaction — if k3s writes a new pod object mid-dump, the resulting SQL can describe an inconsistent state. <code>.backup</code> holds a single read transaction for the entire operation, so the output is always consistent to one point in time. This matters most under load, but the correct choice is <code>.backup</code> regardless.</p>
<p>Both mechanisms now use <code>.backup</code>. The compressed binary output is about 55 MB for this cluster.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="health-check">Health Check<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#health-check" class="hash-link" aria-label="Direct link to Health Check" title="Direct link to Health Check" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "systemctl status kine-backup.timer --no-pager &amp;&amp; \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  ~/.local/bin/mc ls minilocal/db-backups/kine/ | tail -3 &amp;&amp; \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  ~/.local/bin/mc ls minilocal/k3s-backup/ | tail -3"</span><br></div></code></pre></div></div>
<p>Expected output shows both buckets with a file dated within the last 24 hours.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ha-intentionally-absent">HA: Intentionally Absent<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#ha-intentionally-absent" class="hash-link" aria-label="Direct link to HA: Intentionally Absent" title="Direct link to HA: Intentionally Absent" translate="no">​</a></h2>
<p>A true HA k3s setup requires three server nodes with <code>--cluster-init</code> on the first and <code>--server</code> on the others. That switches the embedded datastore to real etcd (k3s bundles etcd for this mode) with Raft consensus across the three nodes. Lose one, the cluster keeps scheduling.</p>
<p>The minicloud cluster does not do this. <code>set-hog</code> is the single control plane. If it crashes:</p>
<ul>
<li class=""><strong>Running pods keep running.</strong> kubelet on each worker is a separate process; it keeps managing its local pods regardless of API server health.</li>
<li class=""><strong>No new scheduling.</strong> No API server means no new pod creation, no ConfigMap updates, no Deployment rollouts.</li>
<li class=""><strong>Recovery time = reboot time.</strong> <code>set-hog</code> reboots in roughly 90 seconds. k3s starts automatically. The cluster self-heals.</li>
</ul>
<p>Adding two more control-plane nodes would cost two more machines, two more OS installs, and ongoing management of a Raft cluster — for a portfolio cluster that runs on ThinkPads. The trade-off is clear: single-node control plane, fast recovery, zero quorum complexity.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="recovery-disk-replaced-or-corruption">Recovery: Disk Replaced or Corruption<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#recovery-disk-replaced-or-corruption" class="hash-link" aria-label="Direct link to Recovery: Disk Replaced or Corruption" title="Direct link to Recovery: Disk Replaced or Corruption" translate="no">​</a></h2>
<p>This is the procedure when <code>set-hog</code> needs a new disk or <code>state.db</code> is corrupt:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># 1. Install fresh k3s on set-hog (same version)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh set-hog "curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.36.2+k3s1 sh -"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 2. Stop k3s before touching the database</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh set-hog "sudo systemctl stop k3s"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 3. Find the latest binary backup in MinIO</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "~/.local/bin/mc ls minilocal/db-backups/kine/ | tail -3"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># e.g. kine-20260728-030001.db.gz</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 4. Decompress and transfer to set-hog</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "~/.local/bin/mc cat minilocal/db-backups/kine/kine-20260728-030001.db.gz \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  | gunzip | ssh ubuntu@10.0.0.2 'sudo tee /var/lib/rancher/k3s/server/db/state.db &gt; /dev/null'"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 5. Fix ownership and restart</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh set-hog "sudo chown root:root /var/lib/rancher/k3s/server/db/state.db \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  &amp;&amp; sudo systemctl start k3s"</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># 6. Verify</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "kubectl get nodes &amp;&amp; kubectl get pods -A | grep -v Running | grep -v Completed"</span><br></div></code></pre></div></div>
<p><strong>Data loss window:</strong> up to 23 hours for objects created between the last backup and the crash. Application data lives in Longhorn PVCs (separate physical storage on worker nodes) — PVC data is not in this backup.</p>
<p><strong>Worker re-registration:</strong> Workers re-register with the API server automatically after it comes back. No action needed.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-managed-providers-compare">How Managed Providers Compare<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#how-managed-providers-compare" class="hash-link" aria-label="Direct link to How Managed Providers Compare" title="Direct link to How Managed Providers Compare" translate="no">​</a></h2>
<table><thead><tr><th></th><th>minicloud (k3s/Kine)</th><th>EKS</th><th>GKE</th><th>AKS</th></tr></thead><tbody><tr><td><strong>Datastore</strong></td><td>SQLite (1 file, 1 machine)</td><td>etcd, provider-managed, multi-AZ</td><td>etcd, Google-managed</td><td>etcd, Azure-managed</td></tr><tr><td><strong>HA</strong></td><td>No — single control plane node</td><td>Yes — etcd across 3 AZs, provider SLA</td><td>Yes — fully opaque, SLA-backed</td><td>Yes — fully managed</td></tr><tr><td><strong>RPO</strong></td><td>~23h (nightly backup at 02:30 UTC)</td><td>Sub-minute (continuous replication)</td><td>Sub-minute</td><td>Sub-minute</td></tr><tr><td><strong>RTO</strong></td><td>90s (set-hog reboot) + restore time</td><td>Provider restores automatically, usually invisible</td><td>Provider restores automatically</td><td>Provider restores automatically</td></tr><tr><td><strong>Backup format</strong></td><td>Binary SQLite (<code>.db.gz</code>) in your MinIO</td><td>etcd snapshot — you cannot access it</td><td>etcd snapshot — you cannot access it</td><td>etcd snapshot — you cannot access it</td></tr><tr><td><strong>Restore</strong></td><td>You do it, full procedure above</td><td>Not user-accessible</td><td>Not user-accessible</td><td>Not user-accessible</td></tr><tr><td><strong>What you own</strong></td><td>Backup schedule, format, retention, restore procedure</td><td>PDB design, workload drain tolerance</td><td>PDB design, workload drain tolerance</td><td>PDB design, workload drain tolerance</td></tr><tr><td><strong>Cost</strong></td><td>Electricity + MinIO storage on existing hardware</td><td>$0.10/hr control plane ($73/mo) + etcd storage fees</td><td>Free control plane on Standard; Autopilot has per-workload cost</td><td>Free control plane; pay for node VMs</td></tr><tr><td><strong>Observability</strong></td><td><code>sqlite3 state.db ".dbinfo"</code>, systemd timer logs, MinIO bucket</td><td>CloudWatch, EKS upgrade insights</td><td>Cloud Logging, GKE upgrade notifications</td><td>Azure Monitor</td></tr></tbody></table>
<p>The managed HA story is straightforward: providers run etcd on infrastructure you never see, replicate it across availability zones, and take automatic snapshots before every upgrade. Sub-minute RPO, automatic recovery, zero operational overhead.</p>
<p>What they take away in exchange: you cannot access the backup, cannot run a point-in-time restore to an arbitrary timestamp, and cannot move the state to a different cloud. If the provider loses your etcd data (which has not happened at scale), your only recourse is their support process.</p>
<p>On bare-metal, the backup files are yours. They live in MinIO on your controller. You can restore them to any compatible k3s install without asking anyone. The operational cost is real — you designed the backup, you verified it runs, you wrote the restore procedure — but the control is yours.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-asymmetry-that-is-easy-to-forget">The Asymmetry That Is Easy to Forget<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#the-asymmetry-that-is-easy-to-forget" class="hash-link" aria-label="Direct link to The Asymmetry That Is Easy to Forget" title="Direct link to The Asymmetry That Is Easy to Forget" translate="no">​</a></h2>
<p>Managed providers back up etcd automatically. But they do it <em>for their own recovery purposes</em>, not yours. The snapshot they take before an upgrade is not something you can trigger, download, or restore from. If you accidentally delete 200 namespaces with <code>kubectl delete ns --all</code>, no managed provider will restore your cluster state to five minutes ago.</p>
<p>On minicloud, you can. The binary backup is a complete point-in-time copy of the cluster state. Restore it, restart k3s, and the deleted namespaces come back — minus anything created in the intervening hours.</p>
<p>This is not a reason to prefer bare-metal over managed Kubernetes in general. It is a reason to understand what "backup" means in each model before you assume it covers your scenarios.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-actual-costs">The Actual Costs<a href="https://docs.devandre.sbs/blog/kubernetes-datastore-kine-sqlite-vs-etcd#the-actual-costs" class="hash-link" aria-label="Direct link to The Actual Costs" title="Direct link to The Actual Costs" translate="no">​</a></h2>
<p><strong>Managed Kubernetes (EKS example):</strong></p>
<ul>
<li class="">Control plane: $0.10/hr = $73/month</li>
<li class="">etcd storage: included</li>
<li class="">Backup: included (but not user-accessible for point-in-time restore)</li>
<li class="">Total for control plane + datastore: $73/month before any worker nodes</li>
</ul>
<p><strong>minicloud:</strong></p>
<ul>
<li class="">Hardware: ThinkPads already owned</li>
<li class="">MinIO: running on controller, storage on existing 98 GB NVMe</li>
<li class="">Backup storage per file: ~55 MB compressed, 30-day retention = ~1.6 GB for 30 files</li>
<li class="">Total incremental cost for control plane datastore: near zero</li>
</ul>
<p>The comparison is not "SQLite is better than etcd." SQLite has no HA, no sub-minute RPO, and would be the wrong choice for a production cluster with hundreds of nodes and a team depending on it 24/7. The comparison is about understanding what each model costs and what it gives you — so that when you do use EKS or GKE, you know exactly which part of the problem they are solving and which parts remain yours.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>etcd</category>
            <category>kine</category>
            <category>sqlite</category>
            <category>backup</category>
            <category>platform-engineering</category>
            <category>bare-metal</category>
            <category>eks</category>
            <category>gke</category>
            <category>aks</category>
        </item>
        <item>
            <title><![CDATA[Kubernetes Upgrades: What Managed Providers Handle for You and What You Own Yourself]]></title>
            <link>https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed</link>
            <guid>https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed</guid>
            <pubDate>Tue, 28 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A concrete look at upgrading Kubernetes — comparing EKS, GKE, and AKS one-click upgrades against the system-upgrade-controller Plans and GitHub Actions automation I built for my 5-node bare-metal k3s cluster. Every decision documented, every gotcha included.
]]></description>
            <content:encoded><![CDATA[<p>A Kubernetes upgrade is never just changing a version number. There is a node drain, a binary swap, a control plane migration, a pod eviction sequence, and — if you are running bare-metal — nobody to call when it goes wrong.</p>
<p>Managed Kubernetes providers handle most of that for you. Self-managed clusters make you own all of it. This post documents both sides concretely: what EKS, GKE, and AKS actually do during an upgrade, and what I built to automate the same process on my 5-node k3s cluster running on ThinkPad laptops.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-setup">The Setup<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-setup" class="hash-link" aria-label="Direct link to The Setup" title="Direct link to The Setup" translate="no">​</a></h2>
<p><strong>minicloud</strong> is a 5-node k3s cluster on bare-metal Ubuntu 22.04:</p>
<table><thead><tr><th>Node</th><th>IP</th><th>Role</th></tr></thead><tbody><tr><td><code>set-hog</code></td><td>10.0.0.2</td><td>k3s control plane (ThinkPad X390)</td></tr><tr><td><code>fast-skunk</code></td><td>10.0.0.4</td><td>worker</td></tr><tr><td><code>fast-heron</code></td><td>10.0.0.7</td><td>worker</td></tr><tr><td><code>star-kitten</code></td><td>10.0.0.8</td><td>worker</td></tr><tr><td><code>swift-mac</code></td><td>10.0.0.10</td><td>worker (MacBook Pro 2012, Ubuntu 22.04)</td></tr></tbody></table>
<p>k3s replaces etcd with Kine/SQLite on <code>set-hog</code>. No cloud. No managed control plane. When <code>set-hog</code> needs to upgrade, I own the sequencing, the drain, and the recovery.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-managed-kubernetes-handles-upgrades">How Managed Kubernetes Handles Upgrades<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#how-managed-kubernetes-handles-upgrades" class="hash-link" aria-label="Direct link to How Managed Kubernetes Handles Upgrades" title="Direct link to How Managed Kubernetes Handles Upgrades" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="eks-amazon">EKS (Amazon)<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#eks-amazon" class="hash-link" aria-label="Direct link to EKS (Amazon)" title="Direct link to EKS (Amazon)" translate="no">​</a></h3>
<p>EKS splits the upgrade into two independent steps, and this split is intentional.</p>
<p><strong>Control plane upgrade</strong> is one API call:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">aws eks update-cluster-version \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --name my-cluster \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --kubernetes-version 1.31</span><br></div></code></pre></div></div>
<p>AWS manages the etcd migration, replaces the API server pods across multiple AZs, and handles the transition from the old version to the new one without downtime on the control plane side. You never see the machines it runs on.</p>
<p><strong>Node group upgrade</strong> is separate. Managed node groups do a rolling replace: a new EC2 instance comes up with the new AMI, gets registered, the old node is cordoned and drained, then terminated. You can tune max unavailable nodes. Spot instance node groups require more care — the eviction + replacement race can leave you under-capacity briefly.</p>
<p>EKS auto-upgrade exists (<code>enableAutoUpgrade</code>) but most production teams disable it and handle upgrades on a maintenance schedule. The reason: add-on compatibility. EKS clusters carry VPC CNI, kube-proxy, and CoreDNS as managed add-ons, each with their own upgrade path that must be sequenced with the control plane version. AWS will warn you about version skew but will not block an upgrade that creates it.</p>
<p><strong>What you still own on EKS:</strong> add-on upgrades (VPC CNI, CoreDNS, kube-proxy), PodDisruptionBudget design, workload drain tolerance, post-upgrade validation.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="gke-google">GKE (Google)<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#gke-google" class="hash-link" aria-label="Direct link to GKE (Google)" title="Direct link to GKE (Google)" translate="no">​</a></h3>
<p>GKE's upgrade model is the most automated of the three. <strong>Release channels</strong> (Rapid, Regular, Stable) handle upgrades automatically on a schedule aligned with upstream Kubernetes releases — typically 2–4 weeks after a release hits upstream.</p>
<p>When GKE upgrades a node pool, it uses <strong>surge upgrades</strong> by default: it provisions an extra node before draining the old one, so you maintain full capacity throughout. The surge node count and max unavailable are tunable via <code>--max-surge</code> and <code>--max-unavailable</code>.</p>
<p>GKE also has <strong>maintenance windows</strong> — you define a time window when automatic upgrades are allowed. For production clusters, this is how teams prevent unexpected node churn during business hours.</p>
<p>The control plane upgrade on GKE is fully opaque. Google handles it, it is covered by their SLA, and you cannot observe the individual steps. For most teams this is a feature, not a gap.</p>
<p><strong>What you still own on GKE:</strong> maintenance window configuration, PDB definitions, ensuring workloads tolerate eviction, validating add-on behaviour on new minor versions.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="aks-azure">AKS (Azure)<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#aks-azure" class="hash-link" aria-label="Direct link to AKS (Azure)" title="Direct link to AKS (Azure)" translate="no">​</a></h3>
<p>AKS upgrades are the closest to manual of the three managed options. There is no automatic upgrade by default — you schedule it:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">az aks upgrade \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --resource-group my-rg \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --name my-cluster \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  --kubernetes-version 1.31.0</span><br></div></code></pre></div></div>
<p>AKS performs a rolling upgrade: the control plane first, then node pools one surge node at a time. Like GKE, AKS uses a surge node approach — it provisions a new node, moves workloads, then removes the old node.</p>
<p>AKS also supports <strong>node image upgrades</strong> separately from Kubernetes version upgrades. You can update the OS image (kernel patches, containerd versions) without changing the Kubernetes minor version — useful for CVE patching between upgrades.</p>
<p><strong>What you still own on AKS:</strong> triggering upgrades (or configuring auto-upgrade policies), PDB design, node pool sequencing if you have multiple pools with different taints.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-common-pattern">The Common Pattern<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-common-pattern" class="hash-link" aria-label="Direct link to The Common Pattern" title="Direct link to The Common Pattern" translate="no">​</a></h3>
<p>All three providers share the same upgrade sequence under the hood:</p>
<ol>
<li class="">Upgrade the control plane (invisible to you, handled by provider)</li>
<li class="">For each worker node: cordon → drain → replace binary or AMI → uncordon</li>
<li class="">Verify node readiness before moving to the next</li>
</ol>
<p>What they remove from your plate: managing the etcd data migration, sequencing the API server version across replicas, handling the control plane downtime window, and recovering from partial failures mid-upgrade.</p>
<p>What they cannot remove from your plate: designing workloads that tolerate eviction.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="how-i-handle-upgrades-on-bare-metal-k3s">How I Handle Upgrades on Bare-Metal k3s<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#how-i-handle-upgrades-on-bare-metal-k3s" class="hash-link" aria-label="Direct link to How I Handle Upgrades on Bare-Metal k3s" title="Direct link to How I Handle Upgrades on Bare-Metal k3s" translate="no">​</a></h2>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-tool-system-upgrade-controller">The Tool: system-upgrade-controller<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-tool-system-upgrade-controller" class="hash-link" aria-label="Direct link to The Tool: system-upgrade-controller" title="Direct link to The Tool: system-upgrade-controller" translate="no">​</a></h3>
<p>k3s's upgrade mechanism is <a href="https://github.com/rancher/system-upgrade-controller" target="_blank" rel="noopener noreferrer" class="">system-upgrade-controller</a> — a Kubernetes controller that reads <code>Plan</code> CRDs and runs upgrade Jobs on matching nodes.</p>
<p>The Plan CRD is declarative. You commit a target version, ArgoCD syncs it, the controller handles the rest:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> upgrade.cattle.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Plan</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">server</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> system</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">concurrency</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchExpressions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">role.kubernetes.io/control</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">plane</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists       </span><span class="token comment" style="color:#999988;font-style:italic"># not matchLabels: "true" — the value varies across versions</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cordon</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">drain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">force</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">ignoreDaemonSets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain">     </span><span class="token comment" style="color:#999988;font-style:italic"># required: Longhorn DaemonSet would block drain otherwise</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">deleteEmptydirData</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">timeout</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">120</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">upgrade</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rancher/k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">tolerations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CriticalAddonsOnly</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">effect</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> NoExecute</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">effect</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> NoSchedule</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> upgrade.cattle.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Plan</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">agent</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> system</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">concurrency</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchExpressions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> node</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">role.kubernetes.io/control</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">plane</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> DoesNotExist</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cordon</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">drain</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">force</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">ignoreDaemonSets</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">deleteEmptydirData</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">timeout</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">120</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">prepare</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rancher/k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain">prepare</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">server</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># blocks until server Plan completes</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">upgrade</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rancher/k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">tolerations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">key</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> CriticalAddonsOnly</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">effect</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> NoExecute</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">effect</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> NoSchedule</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">operator</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Exists</span><br></div></code></pre></div></div>
<p><strong>Upgrade sequence enforced by these Plans:</strong></p>
<ol>
<li class=""><code>k3s-server</code> Plan runs on <code>set-hog</code> (control plane) — cordon, drain, install new k3s binary, uncordon</li>
<li class=""><code>k3s-agent</code> Plan's <code>prepare</code> step waits for server Plan to complete</li>
<li class="">Workers upgrade one at a time (<code>concurrency: 1</code>) — fast-skunk, fast-heron, star-kitten, swift-mac</li>
</ol>
<p>This mirrors what EKS, GKE, and AKS all do internally. The difference is that here it is visible, auditable YAML checked into git.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-gotchas-undocumented">The Gotchas (Undocumented)<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-gotchas-undocumented" class="hash-link" aria-label="Direct link to The Gotchas (Undocumented)" title="Direct link to The Gotchas (Undocumented)" translate="no">​</a></h3>
<p>Three issues that are not in the system-upgrade-controller docs and that I hit when initially writing these Plans:</p>
<p><strong>1 — <code>matchLabels: "true"</code> breaks on some k3s versions</strong></p>
<p>The <code>node-role.kubernetes.io/control-plane</code> label exists across all k3s versions, but its value (<code>""</code> vs <code>"true"</code>) varies. <code>matchLabels: "true"</code> silently matches nothing on clusters where the value is empty. The fix is <code>operator: Exists</code> — match on the key regardless of value.</p>
<p><strong>2 — <code>cordon: true</code> alone does not evict pods</strong></p>
<p><code>cordon: true</code> prevents new pods from being scheduled on the node. It does not evict existing pods. Without the <code>drain:</code> block, running pods stay on the node during the upgrade, including StatefulSets with PVCs — which can cause data corruption if the k3s binary restarts under them.</p>
<p><strong>3 — <code>ignoreDaemonSets: true</code> is mandatory with Longhorn</strong></p>
<p>Longhorn runs a DaemonSet (<code>longhorn-manager</code>) on every node. A drain without <code>ignoreDaemonSets: true</code> will wait for that DaemonSet pod to terminate before proceeding — but DaemonSet pods are immediately rescheduled, so the wait never ends. The drain hangs until <code>timeout</code> fires, then fails.</p>
<p><strong>4 — ArgoCD <code>selfHeal</code> conflicts with SUC upgrade Jobs</strong></p>
<p>system-upgrade-controller creates Job pods on target nodes during the upgrade. ArgoCD, if <code>selfHeal: true</code> is active on the sync, sees these Job pods as "out of sync" resources (they are not in git) and may delete them mid-upgrade. The safe practice: pause auto-sync or add an <code>ignoreDifferences</code> entry for Job resources before triggering an upgrade.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-automation-weekly-github-actions">The Automation: Weekly GitHub Actions<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-automation-weekly-github-actions" class="hash-link" aria-label="Direct link to The Automation: Weekly GitHub Actions" title="Direct link to The Automation: Weekly GitHub Actions" translate="no">​</a></h3>
<p>Committing a new version by hand works, but it requires remembering to check. I built a GitHub Actions workflow that runs every Monday at 08:00 UTC, fetches the latest k3s release from the GitHub API, and opens a PR if it finds a newer version:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> k3s upgrade PR</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">on</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">schedule</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">cron</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'0 8 * * 1'</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">workflow_dispatch</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">inputs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">dry_run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> boolean</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">default</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">jobs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">check-and-bump</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">runs-on</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ubuntu</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">permissions</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">contents</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> write</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">pull-requests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> write</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">steps</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">uses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> actions/checkout@v4</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">with</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">token</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> $</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> secrets.GITOPS_TOKEN </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Get latest k3s release</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          LATEST=$(curl -sf \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            "https://api.github.com/repos/k3s-io/k3s/releases/latest" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            | jq -r '.tag_name')</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          echo "latest=$LATEST" &gt;&gt; "$GITHUB_OUTPUT"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Get current version from Plan YAML</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> current</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          # grep '^ *version:' skips comment lines that also contain the word 'version:'</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          CURRENT=$(grep -m1 '^ *version:' manifests/system-upgrade/01-k3s-plans.yaml \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            | awk '{print $2}')</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          echo "current=$CURRENT" &gt;&gt; "$GITHUB_OUTPUT"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Compare and bump</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          if [[ "${{ steps.latest.outputs.latest }}" != "${{ steps.current.outputs.current }}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">             &amp;&amp; "${{ inputs.dry_run }}" != "true" ]]; then</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            # bump version in both Plans (server + agent share the same version line)</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            sed -i "s/${{ steps.current.outputs.current }}/${{ steps.latest.outputs.latest }}/g" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">              manifests/system-upgrade/01-k3s-plans.yaml</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">            # ... then open a PR</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">          fi</span><br></div></code></pre></div></div>
<p>The PR body includes a pre-merge checklist:</p>
<ul>
<li class="">Read the k3s release notes for API deprecations</li>
<li class="">Check the containerd version bump (Chaos Mesh's <code>socketPath</code> is coupled to the containerd socket path — a containerd major version bump can break chaos experiments)</li>
<li class="">Verify no PodDisruptionBudgets block the drain</li>
<li class="">Check Longhorn volume replica count</li>
<li class="">Take a kine/SQLite backup <strong>before</strong> the upgrade</li>
</ul>
<p>The last point is what a managed provider does silently before every upgrade. On bare-metal, the checklist enforces it.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="side-by-side-comparison">Side-by-Side Comparison<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#side-by-side-comparison" class="hash-link" aria-label="Direct link to Side-by-Side Comparison" title="Direct link to Side-by-Side Comparison" translate="no">​</a></h2>
<table><thead><tr><th>Dimension</th><th>minicloud (k3s bare-metal)</th><th>EKS</th><th>GKE</th><th>AKS</th></tr></thead><tbody><tr><td><strong>Who triggers the upgrade</strong></td><td>Developer — PR to bump <code>version:</code> in git</td><td>Developer or auto-upgrade policy</td><td>Release channel (automatic) or developer</td><td>Developer (or auto-upgrade policy)</td></tr><tr><td><strong>Control plane migration</strong></td><td>system-upgrade-controller on <code>set-hog</code> — visible</td><td>AWS — opaque, zero downtime</td><td>Google — opaque, SLA-backed</td><td>Azure — rolling, visible progress in portal</td></tr><tr><td><strong>Worker sequencing</strong></td><td><code>concurrency: 1</code>, server Plan first, then agent Plan</td><td>Managed node group: surge + drain per node</td><td>Surge upgrade: new node before draining old</td><td>Surge: new node before draining old</td></tr><tr><td><strong>Pre-upgrade backup</strong></td><td>Manual kine/SQLite backup via PR checklist</td><td>AWS backs up etcd automatically</td><td>Google backs up etcd automatically</td><td>Azure backs up etcd automatically</td></tr><tr><td><strong>Rollback</strong></td><td>Restore kine backup + reinstall old binary on each node</td><td>Node group rollback possible; control plane rollback not supported</td><td>Not supported (no rollback to previous minor version)</td><td>Not supported</td></tr><tr><td><strong>Add-on sequencing</strong></td><td>Manual (ArgoCD app versions are independent)</td><td>Managed add-ons require separate upgrade step</td><td>Managed automatically by GKE</td><td>Manual for most add-ons</td></tr><tr><td><strong>Version lag</strong></td><td>You choose when; k3s releases follow upstream by ~1–2 weeks</td><td>N-2 supported versions; new versions available ~2 months post-upstream</td><td>Release channels: Rapid (~2 weeks), Regular (~4 weeks), Stable (~6 weeks)</td><td>~2 months post-upstream for GA support</td></tr><tr><td><strong>Observability</strong></td><td><code>kubectl get nodes -w</code>, ArgoCD sync status, Longhorn health</td><td>CloudWatch Container Insights, EKS upgrade insights dashboard</td><td>Cloud Logging, GKE upgrade notifications</td><td>Azure Monitor, AKS upgrade events</td></tr><tr><td><strong>What breaks silently</strong></td><td>DaemonSet drain hang, ArgoCD selfHeal deleting SUC Jobs, <code>swift-mac</code> needs manual power-cycle after OS hang</td><td>Add-on version skew after control plane upgrade</td><td>Rare — GKE handles most compatibility internally</td><td>Node pool version skew if you have multiple pools</td></tr><tr><td><strong>Cost</strong></td><td>Electricity (hardware already owned)</td><td>$0.10/hr per cluster ($73/month control plane alone)</td><td>Free control plane on Standard tier; Autopilot adds per-workload cost</td><td>Free control plane; pay for node VMs</td></tr></tbody></table>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-honest-trade-off">The Honest Trade-off<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#the-honest-trade-off" class="hash-link" aria-label="Direct link to The Honest Trade-off" title="Direct link to The Honest Trade-off" translate="no">​</a></h2>
<p>Managed providers remove the mechanical parts: binary installation, etcd migration, surge node provisioning, post-upgrade readiness checks. They do not remove the design work: PodDisruptionBudgets, drain tolerance, resource limits that allow eviction, and workload health checks.</p>
<p>Self-managed k3s removes none of the mechanical parts. You write the Plan CRDs. You tune the drain spec. You build the automation. You own the backup. But the upside is that every step is in git, every decision is auditable, and you understand what is actually happening when you run <code>kubectl get nodes -w</code> and watch a node disappear and come back.</p>
<p>The GitHub Actions workflow I built opens a PR once a week if k3s releases something new. The PR body is a six-point checklist. Merging it takes two minutes. The upgrade itself takes about twenty minutes across five nodes, unattended.</p>
<p>That is the self-managed bargain: more work upfront to understand the system, less mystery when something goes wrong.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-gets-automated-vs-what-stays-manual">What Gets Automated vs What Stays Manual<a href="https://docs.devandre.sbs/blog/kubernetes-upgrades-self-managed-vs-managed#what-gets-automated-vs-what-stays-manual" class="hash-link" aria-label="Direct link to What Gets Automated vs What Stays Manual" title="Direct link to What Gets Automated vs What Stays Manual" translate="no">​</a></h2>
<p><strong>Automated:</strong></p>
<ul>
<li class="">Weekly detection of new k3s releases (GitHub Actions)</li>
<li class="">PR with bumped version in both Plans (server + agent)</li>
<li class="">Node drain and upgrade sequence (system-upgrade-controller)</li>
<li class="">ArgoCD sync of the updated Plans</li>
</ul>
<p><strong>Still manual:</strong></p>
<ul>
<li class="">Reading the release notes for breaking changes</li>
<li class="">kine/SQLite backup before merge</li>
<li class="">Post-upgrade validation (<code>kubectl get nodes</code>, <code>kubectl get pods -A</code>, Longhorn volume health)</li>
<li class=""><code>swift-mac</code> manual intervention if the upgrade stalls (Apple SMC does not support remote power-cycle)</li>
</ul>
<p>The manual items are intentionally manual. A fully autonomous upgrade that skips the release notes check and the backup is a fast path to a production incident. The PR is not a gate to slow things down — it is the moment where a human reads the release notes and decides the upgrade is safe to apply.</p>
<p>That is the same decision a platform team makes when they un-pause a GKE maintenance window or approve an EKS node group upgrade. The difference is that on bare-metal, the decision and its consequences are entirely yours.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>upgrades</category>
            <category>platform-engineering</category>
            <category>devops</category>
            <category>eks</category>
            <category>gke</category>
            <category>aks</category>
            <category>system-upgrade-controller</category>
            <category>gitops</category>
        </item>
        <item>
            <title><![CDATA[Security Patching a Self-Managed Kubernetes Cluster — Five Layers, Zero Magic]]></title>
            <link>https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes</link>
            <guid>https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes</guid>
            <pubDate>Tue, 28 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[On a managed Kubernetes provider, security patching is largely invisible. On a self-managed k3s cluster, you own every layer: OS kernel patches, k3s binary CVEs, container base images, Helm chart versions, and CIS posture drift. This post documents the full patching stack on minicloud — what runs automatically, what requires a PR, and how each layer compares to EKS, GKE, and AKS.
]]></description>
            <content:encoded><![CDATA[<p>Managed Kubernetes providers make security patching look simple. You enable auto-upgrade on GKE, you click "update node group" on EKS, and the CVE goes away. What actually happens is that the provider patches the OS image, replaces the node, validates the binary, and restores your workloads — all in the time it takes to refresh the AWS console.</p>
<p>On a self-managed cluster, none of that is automatic. You own the OS. You own the runtime. You own the base images. You own the Helm chart versions. And when a CVE drops, you own the decision about which layer it lives in and which mechanism will close it.</p>
<p>This post documents all five patching layers on <strong>minicloud</strong> — a 5-node k3s cluster on bare-metal ThinkPads — what's automated, what requires a PR, and where the gaps were and how they were closed.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-patching-surface">The Patching Surface<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-patching-surface" class="hash-link" aria-label="Direct link to The Patching Surface" title="Direct link to The Patching Surface" translate="no">​</a></h2>
<p>Security patches on a Kubernetes cluster don't form a single queue. They live across five independent layers, each with a different toolchain, different cadence, and different failure mode if ignored.</p>
<table><thead><tr><th>Layer</th><th>What it covers</th><th>Worst-case if ignored</th></tr></thead><tbody><tr><td>OS packages</td><td>glibc, OpenSSL, kernel CVEs</td><td>Node-level compromise via unpatched kernel</td></tr><tr><td>k3s binary</td><td>k3s, containerd, runc, CNI plugins</td><td>Container escape, privilege escalation</td></tr><tr><td>Container base images</td><td><code>FROM golang:1.25</code>, <code>FROM node:22-alpine</code>, etc.</td><td>Vulnerable runtime inside every pod</td></tr><tr><td>Helm chart versions</td><td>Application chart updates with CVE fixes</td><td>Workload-level vulnerabilities (e.g. Grafana auth bypass)</td></tr><tr><td>CIS posture</td><td>kubelet config, RBAC, audit policy</td><td>Cluster misconfiguration drifts after upgrades</td></tr></tbody></table>
<p>Each layer requires its own tool and its own trigger. There is no single "patch everything" button on bare-metal.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-1--os-packages-unattended-upgrades--kured">Layer 1 — OS Packages: <code>unattended-upgrades</code> + kured<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#layer-1--os-packages-unattended-upgrades--kured" class="hash-link" aria-label="Direct link to layer-1--os-packages-unattended-upgrades--kured" title="Direct link to layer-1--os-packages-unattended-upgrades--kured" translate="no">​</a></h2>
<p>All five nodes run <strong>Ubuntu 22.04</strong>. OS-level security patches (glibc, OpenSSL, curl, kernel CVEs) arrive through <code>apt</code> from the Ubuntu security pocket.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="automatic-patch-download">Automatic patch download<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#automatic-patch-download" class="hash-link" aria-label="Direct link to Automatic patch download" title="Direct link to Automatic patch download" translate="no">​</a></h3>
<p><code>unattended-upgrades</code> is configured on every node to apply security pocket updates automatically:</p>
<div class="language-ini codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-ini codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># /etc/apt/apt.conf.d/50unattended-upgrades</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Unattended-Upgrade::Allowed-Origins {</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    "${distro_id}:${distro_codename}-security";</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">};</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Unattended-Upgrade::Automatic-Reboot "false";   // kured handles reboots</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Unattended-Upgrade::Remove-Unused-Dependencies "true";</span><br></div></code></pre></div></div>
<p><code>Automatic-Reboot "false"</code> is intentional — rebooting a Kubernetes node during a working day without draining it first would evict pods non-gracefully. Instead, <code>unattended-upgrades</code> writes <code>/var/run/reboot-required</code> when a kernel or libc patch requires a reboot. That file is the handoff signal to kured.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="automated-kernel-reboot-sequencing-kured">Automated kernel reboot sequencing: kured<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#automated-kernel-reboot-sequencing-kured" class="hash-link" aria-label="Direct link to Automated kernel reboot sequencing: kured" title="Direct link to Automated kernel reboot sequencing: kured" translate="no">​</a></h3>
<p><strong>kured</strong> (Kubernetes Reboot Daemon) runs as a DaemonSet — one pod per node. It watches for <code>/var/run/reboot-required</code> on each node's host filesystem and, when it finds one, issues a Kubernetes-native drain followed by a reboot:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kured pod sees /var/run/reboot-required on fast-heron</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ acquires reboot lock (only one node reboots at a time)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ kubectl cordon fast-heron</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ kubectl drain fast-heron (respects PDBs — waits for Longhorn rebalance)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ nsenter → systemctl reboot</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ node comes back → kubelet re-registers → kured uncordons</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">→ releases lock → next node can proceed</span><br></div></code></pre></div></div>
<p>The cluster has been running kured for over three weeks. Current status:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl get ds -n kured</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># NAME    DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># kured   5         5         5       5            5</span><br></div></code></pre></div></div>
<p>One pod per node, including <code>set-hog</code> (control plane). The drain respects all PodDisruptionBudgets — Longhorn's DaemonSet is <code>ignoreDaemonSets: true</code>, and application PDBs enforce minimum replica counts. A kernel patch that lands on <code>fast-heron</code> at 03:00 will have the node back in service before morning.</p>
<p><strong>The swift-mac caveat:</strong> <code>swift-mac</code> is a MacBook Pro 2012. kured can drain and reboot it via normal Kubernetes mechanisms. If the MacBook hangs during the boot process (Apple SMC behaviour), kured cannot power-cycle it — physical intervention is required. This is a known gap accepted for this hardware.</p>
<p><strong>What managed providers do instead:</strong> cloud worker nodes are VMs. OS patching means replacing the VM with a new one built from a patched AMI (EKS) or a new node image (GKE, AKS). There is no in-place kernel patch and no reboot — the node is terminated and a fresh one joins. The "dirty node" problem disappears. kured is unnecessary.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-2--k3s-binary-system-upgrade-controller--weekly-github-actions">Layer 2 — k3s Binary: system-upgrade-controller + Weekly GitHub Actions<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#layer-2--k3s-binary-system-upgrade-controller--weekly-github-actions" class="hash-link" aria-label="Direct link to Layer 2 — k3s Binary: system-upgrade-controller + Weekly GitHub Actions" title="Direct link to Layer 2 — k3s Binary: system-upgrade-controller + Weekly GitHub Actions" translate="no">​</a></h2>
<p>k3s bundles containerd, runc, and CNI plugins into a single binary. A CVE in any of these components (including the k3s API server itself) is fixed by upgrading k3s. The binary version also carries the Kubernetes minor version — <code>v1.36.2+k3s1</code> means k3s 1 on top of Kubernetes 1.36.2.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="detection-weekly-github-actions-workflow">Detection: weekly GitHub Actions workflow<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#detection-weekly-github-actions-workflow" class="hash-link" aria-label="Direct link to Detection: weekly GitHub Actions workflow" title="Direct link to Detection: weekly GitHub Actions workflow" translate="no">​</a></h3>
<p>A workflow runs every Monday at 08:00 UTC, fetches the latest k3s release from the GitHub API, and compares it to the version in the system-upgrade Plans:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Get latest k3s release</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    LATEST=$(curl -sf \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      "https://api.github.com/repos/k3s-io/k3s/releases/latest" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      | jq -r '.tag_name')</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Get current version</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">|</span><span class="token scalar string" style="color:#e3116c"></span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">    CURRENT=$(grep -m1 '^ *version:' \</span><br></div><div class="token-line" style="color:#393A34"><span class="token scalar string" style="color:#e3116c">      manifests/system-upgrade/01-k3s-plans.yaml | awk '{print $2}')</span><br></div></code></pre></div></div>
<p>If versions differ, the workflow bumps <code>version:</code> in both system-upgrade Plans and opens a PR with a six-point pre-merge checklist: release notes, containerd version check, PDB review, Longhorn replica health, kine/SQLite backup.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="application-system-upgrade-controller-plans">Application: system-upgrade-controller Plans<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#application-system-upgrade-controller-plans" class="hash-link" aria-label="Direct link to Application: system-upgrade-controller Plans" title="Direct link to Application: system-upgrade-controller Plans" translate="no">​</a></h3>
<p>Merging the PR triggers ArgoCD sync → system-upgrade-controller reads the new Plan → upgrades run:</p>
<ol>
<li class=""><code>k3s-server</code> Plan: cordon <code>set-hog</code>, drain (with <code>ignoreDaemonSets: true</code>, 120s timeout), swap binary, uncordon</li>
<li class=""><code>k3s-agent</code> Plan's <code>prepare</code> step waits for server completion</li>
<li class="">Workers upgrade one at a time (<code>concurrency: 1</code>) — drain, swap, uncordon</li>
</ol>
<p>The whole sequence runs unattended. Monitor with:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ssh controller "kubectl get nodes -w &amp;&amp; kubectl get jobs -n system-upgrade -w"</span><br></div></code></pre></div></div>
<p><strong>What managed providers do instead:</strong> the k3s binary equivalent on EKS is the node AMI + Kubernetes control plane version. AWS patches the control plane silently. Node AMIs are updated via managed node group rolling replace — new AMI, new node, no in-place binary upgrade. GKE does the same via node pool auto-upgrade on release channels. You never touch a binary.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-3--container-base-images-renovate--harbortrivy">Layer 3 — Container Base Images: Renovate + Harbor/Trivy<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#layer-3--container-base-images-renovate--harbortrivy" class="hash-link" aria-label="Direct link to Layer 3 — Container Base Images: Renovate + Harbor/Trivy" title="Direct link to Layer 3 — Container Base Images: Renovate + Harbor/Trivy" translate="no">​</a></h2>
<p>This is the most frequently overlooked patching layer and the one that affects the most CVEs in practice. Every custom image built from <code>FROM ubuntu:22.04</code>, <code>FROM golang:1.25-alpine</code>, or <code>FROM node:22-alpine</code> inherits the CVE surface of that base image at build time. When <code>ubuntu:22.04</code> patches a critical OpenSSL vulnerability, every image built on top of it needs a rebuild.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-was-missing">What was missing<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#what-was-missing" class="hash-link" aria-label="Direct link to What was missing" title="Direct link to What was missing" translate="no">​</a></h3>
<p>The six image repos (minicloud-backstage, minicloud-open-webui, minicloud-onlyoffice, minicloud-plane, platform-demo, ktayl-solution-web) had no automated mechanism to detect when their base images had new security releases. A CVE in <code>golang:1.25-alpine</code> would sit unpatched until someone noticed.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-fix-self-hosted-renovate-across-all-repos">The fix: self-hosted Renovate across all repos<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-fix-self-hosted-renovate-across-all-repos" class="hash-link" aria-label="Direct link to The fix: self-hosted Renovate across all repos" title="Direct link to The fix: self-hosted Renovate across all repos" translate="no">​</a></h3>
<p><strong>Renovate</strong> is a dependency update tool that watches package manifests — Dockerfiles, <code>go.mod</code>, <code>package.json</code>, Helm chart <code>targetRevision</code>, ArgoCD Application <code>targetRevision</code> — and opens PRs when newer versions are available.</p>
<p>A single GitHub Actions workflow in <code>minicloud-gitops</code> runs Renovate every Monday 06:00 UTC across all seven platform repos:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># .github/workflows/renovate.yml</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Renovate</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">on</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">schedule</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">cron</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">'0 6 * * 1'</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># Monday 06:00 UTC</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">workflow_dispatch</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">inputs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">dry_run</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">type</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> boolean</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">default</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">false</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">jobs</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">renovate</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">runs-on</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ubuntu</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">latest</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">steps</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">uses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> actions/checkout@v4</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">uses</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> renovatebot/github</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">action@v46.1.21</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">with</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">configurationFile</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> .github/renovate</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">global.json</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">token</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> $</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> secrets.GITOPS_TOKEN </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        </span><span class="token key atrule" style="color:#00a4db">env</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">LOG_LEVEL</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> info</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">          </span><span class="token key atrule" style="color:#00a4db">RENOVATE_DRY_RUN</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> $</span><span class="token punctuation" style="color:#393A34">{</span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> inputs.dry_run == true </span><span class="token important">&amp;&amp;</span><span class="token plain"> 'full' </span><span class="token punctuation" style="color:#393A34">|</span><span class="token punctuation" style="color:#393A34">|</span><span class="token plain"> 'null' </span><span class="token punctuation" style="color:#393A34">}</span><span class="token punctuation" style="color:#393A34">}</span><br></div></code></pre></div></div>
<p>The global config lists all seven repos:</p>
<div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token property" style="color:#36acaa">"repositories"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/minicloud-gitops"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/minicloud-backstage"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/minicloud-open-webui"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/minicloud-onlyoffice"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/minicloud-plane"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/platform-demo"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token string" style="color:#e3116c">"KanmegneTabouguie/ktayl-solution-web"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">]</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token property" style="color:#36acaa">"onboarding"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean" style="color:#36acaa">false</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token property" style="color:#36acaa">"requireConfig"</span><span class="token operator" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"optional"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">}</span><br></div></code></pre></div></div>
<p>Each repo has its own <code>renovate.json</code> that enables the relevant managers and groups updates:</p>
<table><thead><tr><th>Repo</th><th>Managers</th><th>Grouping strategy</th></tr></thead><tbody><tr><td><code>minicloud-gitops</code></td><td><code>argocd</code>, <code>helm-values</code></td><td>Minor/patch grouped weekly; major requires dashboard approval</td></tr><tr><td><code>minicloud-backstage</code></td><td><code>dockerfile</code>, <code>npm</code></td><td>npm packages grouped; Backstage major version = manual review</td></tr><tr><td><code>minicloud-open-webui</code></td><td><code>dockerfile</code></td><td>Label <code>check-default-changes</code> — Open WebUI changes env defaults between versions</td></tr><tr><td><code>minicloud-onlyoffice</code></td><td><code>dockerfile</code></td><td>Label <code>check-ca-cert</code> — CA injection path changes with Node.js version inside image</td></tr><tr><td><code>platform-demo</code></td><td><code>dockerfile</code>, <code>gomod</code></td><td>Go modules grouped; golang major = manual review</td></tr><tr><td><code>minicloud-plane</code></td><td><code>dockerfile</code>, <code>gomod</code></td><td>Same — NATS client compatibility check on major</td></tr><tr><td><code>ktayl-solution-web</code></td><td><code>dockerfile</code>, <code>npm</code></td><td>Astro + Tailwind grouped; Astro major = manual review</td></tr></tbody></table>
<p>Private Harbor images (<code>harbor.10.0.0.200.nip.io/library/*</code>) are explicitly excluded — Renovate cannot reach the internal registry from GitHub Actions runners.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="harbor-trivy-scanning">Harbor Trivy scanning<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#harbor-trivy-scanning" class="hash-link" aria-label="Direct link to Harbor Trivy scanning" title="Direct link to Harbor Trivy scanning" translate="no">​</a></h3>
<p>Harbor runs Trivy on every pushed image. The scan runs at push time and results are visible in the Harbor UI under each image tag. Images with CRITICAL CVEs can be flagged (and optionally blocked from pull) via Harbor's project policy.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Check current scan status for an image</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">/usr/bin/curl --cacert ~/minicloud-ca.crt \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  "https://harbor.10.0.0.200.nip.io/api/v2.0/projects/library/repositories/platform-demo/artifacts" \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -u "admin:$(cat ~/.harbor-admin)" | python3 -m json.tool | grep -A3 '"scan"'</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-patching-loop">The patching loop<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-patching-loop" class="hash-link" aria-label="Direct link to The patching loop" title="Direct link to The patching loop" translate="no">​</a></h3>
<p>When Renovate detects <code>golang:1.25-alpine</code> has a new patch version:</p>
<ol>
<li class="">It opens a PR in <code>platform-demo</code> bumping the Containerfile</li>
<li class="">CI builds and pushes the new image to Harbor</li>
<li class="">Trivy scans it at push time</li>
<li class="">If clean, the PR is reviewed and merged</li>
<li class="">ArgoCD detects the new image tag in gitops and rolls out</li>
</ol>
<p>End-to-end: a base image CVE gets a PR opened within a week of the upstream release. Without Renovate, it waits until someone manually checks.</p>
<p><strong>What managed providers do instead:</strong> cloud providers patch base images at the hypervisor layer (new AMI = new OS, new containerd, new kernel). But your application's <code>FROM golang:1.25-alpine</code> in a Dockerfile is still your responsibility — ECR image scanning, GCR Artifact Registry scanning, and ACR scanning work exactly like Harbor Trivy. No managed provider auto-rebuilds your application containers when their base images update. Renovate fills the same gap on any Kubernetes platform.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-4--helm-chart-versions-renovate--argocd">Layer 4 — Helm Chart Versions: Renovate + ArgoCD<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#layer-4--helm-chart-versions-renovate--argocd" class="hash-link" aria-label="Direct link to Layer 4 — Helm Chart Versions: Renovate + ArgoCD" title="Direct link to Layer 4 — Helm Chart Versions: Renovate + ArgoCD" translate="no">​</a></h2>
<p>Helm charts carry their own CVE surface. <code>kube-prometheus-stack 65.x</code> might ship a Grafana version with a known authentication bypass. <code>cert-manager v1.14</code> might have a webhook vulnerability. These are application-level CVEs that live inside the chart, not in the OS or the runtime.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-renovate-scans-in-minicloud-gitops">What Renovate scans in minicloud-gitops<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#what-renovate-scans-in-minicloud-gitops" class="hash-link" aria-label="Direct link to What Renovate scans in minicloud-gitops" title="Direct link to What Renovate scans in minicloud-gitops" translate="no">​</a></h3>
<p>The <code>argocd</code> manager reads every <code>apps/*.yaml</code> file and extracts <code>targetRevision</code>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># apps/cert-manager.yaml</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">sources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">repoURL</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> https</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//charts.jetstack.io</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">chart</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> cert</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">manager</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">targetRevision</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"v1.20.2"</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># ← Renovate watches this</span><br></div></code></pre></div></div>
<p>When cert-manager releases <code>v1.20.3</code> with a CVE fix, Renovate opens a PR bumping <code>targetRevision</code>. The PR triggers ArgoCD sync after merge. The chart upgrade rolls out with the cert-manager controller restarting on the new version.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="special-cases-requiring-manual-review">Special cases requiring manual review<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#special-cases-requiring-manual-review" class="hash-link" aria-label="Direct link to Special cases requiring manual review" title="Direct link to Special cases requiring manual review" translate="no">​</a></h3>
<p>Some charts get explicit <code>dependencyDashboardApproval: true</code> regardless of update type:</p>
<ul>
<li class=""><strong>ArgoCD</strong> — ArgoCD upgrading itself has unusual risk: a failed upgrade can prevent further syncs</li>
<li class=""><strong>Vault</strong> — secret backend changes require testing ESO + application connectivity before rollout</li>
<li class=""><strong>Authentik</strong> — SSO upgrades affect all authentication paths; a bad rollout logs out all users</li>
</ul>
<p>Minor patches to these are still surfaced by Renovate, but they sit on the Dependency Dashboard issue until explicitly approved.</p>
<p><strong>What managed providers do instead:</strong> managed add-ons (EKS VPC CNI, GKE Cloud DNS, AKS Azure CNI) are patched by the provider with their own release schedule. Your application Helm charts — the ones you own — require the same Renovate + ArgoCD pattern on EKS/GKE/AKS as on bare-metal. This layer is not simplified by choosing a managed provider.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="layer-5--cis-hardening-kube-bench--ansible">Layer 5 — CIS Hardening: kube-bench + Ansible<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#layer-5--cis-hardening-kube-bench--ansible" class="hash-link" aria-label="Direct link to Layer 5 — CIS Hardening: kube-bench + Ansible" title="Direct link to Layer 5 — CIS Hardening: kube-bench + Ansible" translate="no">​</a></h2>
<p>The CIS Kubernetes Benchmark defines hardening requirements for kubelet configuration, RBAC, audit policies, and node-level settings. The minicloud cluster passes <strong>CIS k3s-1.7 at 16/16</strong> on all worker nodes, applied via Ansible playbooks.</p>
<p>The problem with point-in-time hardening: it drifts. A k3s upgrade changes kubelet flags. An Ansible run that modifies containerd config can reset hardening settings. After any infrastructure change, the CIS posture needs re-verification.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="re-running-kube-bench-after-upgrades">Re-running kube-bench after upgrades<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#re-running-kube-bench-after-upgrades" class="hash-link" aria-label="Direct link to Re-running kube-bench after upgrades" title="Direct link to Re-running kube-bench after upgrades" translate="no">​</a></h3>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Run kube-bench as a Job on each node</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job-node.yaml</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Wait and collect results</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl wait --for=condition=complete job/kube-bench --timeout=120s</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl logs -l app=kube-bench</span><br></div></code></pre></div></div>
<p>Expected output after a clean k3s upgrade: all 16 checks PASS. Any FAIL or WARN is an Ansible remediation run.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-cis-hardening-actually-covers">What CIS hardening actually covers<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#what-cis-hardening-actually-covers" class="hash-link" aria-label="Direct link to What CIS hardening actually covers" title="Direct link to What CIS hardening actually covers" translate="no">​</a></h3>
<ul>
<li class="">kubelet <code>--protect-kernel-defaults</code>, <code>--read-only-port 0</code>, <code>--anonymous-auth false</code></li>
<li class="">containerd runtime configuration (no <code>--allow-privileged</code> without explicit annotation)</li>
<li class="">RBAC: no <code>cluster-admin</code> bindings for service accounts</li>
<li class="">Audit policy: API server audit log enabled with minimum verbosity</li>
<li class="">NetworkPolicies: default-deny-all in production namespaces</li>
</ul>
<p><strong>What managed providers do instead:</strong> EKS, GKE, and AKS enforce CIS Level 1 defaults by default. Managed node groups launch from hardened AMIs/images with most kubelet flags pre-configured. You can request CIS Level 2 hardening on GKE via node pool config. The operational cost of CIS hardening — verifying it after every upgrade — disappears on managed clusters because the base image is always the provider's known-good state.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-secrets-and-tls-layer">The Secrets and TLS Layer<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-secrets-and-tls-layer" class="hash-link" aria-label="Direct link to The Secrets and TLS Layer" title="Direct link to The Secrets and TLS Layer" translate="no">​</a></h2>
<p>Not strictly a "patch" layer, but secret rotation and TLS cert renewal are security maintenance operations that follow the same discipline.</p>
<p><strong>cert-manager</strong> handles TLS certificate renewal automatically. Certificates from Let's Encrypt (via ACME) and from the internal minicloud CA are renewed before expiry with no human interaction. The minicloud root CA cert is 10 years validity — manual renewal is on the calendar for 2034.</p>
<p><strong>Vault + ESO</strong> handles application secrets. Secret rotation is currently manual: update the secret in Vault, ESO picks up the new value via <code>ExternalSecret</code> sync interval, pods pick up the new env var on next restart (or via Reloader if annotated). Automated rotation is a future work item.</p>
<p><strong>Authentik OIDC tokens</strong> are short-lived (access tokens: 5 minutes, refresh tokens: 30 days). No manual rotation needed — OIDC clients handle token refresh automatically.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-full-patching-automation-map">The Full Patching Automation Map<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-full-patching-automation-map" class="hash-link" aria-label="Direct link to The Full Patching Automation Map" title="Direct link to The Full Patching Automation Map" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Every night (02:30 UTC)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── kine-backup.sh (controller systemd timer)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── WAL-safe SQLite backup to MinIO (pre-patch safety net)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Every night (unattended-upgrades)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── apt security pocket → downloads patches to all nodes</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── if kernel/libc → writes /var/run/reboot-required</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">        └── kured detects → drain → reboot → uncordon (one node at a time)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Every Monday 06:00 UTC (Renovate workflow)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── Scans 7 repos for:</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── Dockerfile/Containerfile base image versions</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── go.mod module versions</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── package.json npm versions</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── ArgoCD app targetRevision (Helm chart versions)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── helm-values image tags</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    → Opens grouped PRs for minor/patch updates</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    → Flags major updates for manual review</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Every Monday 08:00 UTC (k3s upgrade workflow)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── Queries GitHub API for latest k3s release</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    → If newer than Plans: opens PR bumping version in both Plans</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    → After merge: ArgoCD syncs → system-upgrade-controller upgrades nodes</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">After every k3s upgrade (manual, ~5 minutes)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── kubectl apply kube-bench Job</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── Verify 16/16 CIS checks PASS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── Run Ansible remediation if any FAIL</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="side-by-side-bare-metal-vs-managed-providers">Side-by-Side: Bare-Metal vs Managed Providers<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#side-by-side-bare-metal-vs-managed-providers" class="hash-link" aria-label="Direct link to Side-by-Side: Bare-Metal vs Managed Providers" title="Direct link to Side-by-Side: Bare-Metal vs Managed Providers" translate="no">​</a></h2>
<table><thead><tr><th>Patching layer</th><th>minicloud (bare-metal k3s)</th><th>EKS</th><th>GKE</th><th>AKS</th></tr></thead><tbody><tr><td><strong>OS security patches</strong></td><td><code>unattended-upgrades</code> downloads; kured drains + reboots</td><td>New AMI per node group update; no in-place patching</td><td>New node image per pool update</td><td>Node image upgrade (separate command)</td></tr><tr><td><strong>Kernel reboot sequencing</strong></td><td>kured DaemonSet — drain → reboot → uncordon</td><td>Node replacement; no reboot</td><td>Node replacement; no reboot</td><td>Node replacement; no reboot</td></tr><tr><td><strong>k3s / runtime binary</strong></td><td>system-upgrade-controller + weekly PR automation</td><td>EKS control plane patched silently; node AMI includes containerd</td><td>GKE nodes updated via release channel</td><td>AKS node pool update</td></tr><tr><td><strong>Container base images</strong></td><td>Renovate (weekly) opens PR per repo</td><td>ECR scan + manual rebuild trigger</td><td>Artifact Registry scan + manual rebuild</td><td>ACR scan + manual rebuild</td></tr><tr><td><strong>Helm chart CVEs</strong></td><td>Renovate opens PR; ArgoCD syncs after merge</td><td>Same — you own your app charts</td><td>Same</td><td>Same</td></tr><tr><td><strong>CIS posture</strong></td><td>kube-bench after each upgrade; Ansible remediation</td><td>Provider enforces CIS L1 defaults; fresh AMI = known state</td><td>CIS L1 default; hardened node images available</td><td>CIS L1 default</td></tr><tr><td><strong>TLS cert renewal</strong></td><td>cert-manager (automatic, zero ops)</td><td>ACM + cert-manager or provider TLS termination</td><td>Managed certs or cert-manager</td><td>Azure-managed certs or cert-manager</td></tr><tr><td><strong>Secret rotation</strong></td><td>Vault + ESO (manual rotation trigger)</td><td>AWS Secrets Manager auto-rotation</td><td>Secret Manager rotation</td><td>Azure Key Vault rotation</td></tr><tr><td><strong>What you own</strong></td><td>All five layers + their toolchains</td><td>Container images, app charts, secrets</td><td>Container images, app charts, secrets</td><td>Container images, app charts, secrets</td></tr></tbody></table>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-managed-providers-cannot-remove-from-your-plate">What Managed Providers Cannot Remove From Your Plate<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#what-managed-providers-cannot-remove-from-your-plate" class="hash-link" aria-label="Direct link to What Managed Providers Cannot Remove From Your Plate" title="Direct link to What Managed Providers Cannot Remove From Your Plate" translate="no">​</a></h2>
<p>It's worth being precise about what "managed" actually means here.</p>
<p>Cloud providers remove OS patching, runtime binary patching, and CIS posture maintenance from your responsibility. These are real, significant reductions in operational burden — especially the OS and runtime layers, which require kured, system-upgrade-controller, Ansible, and kube-bench on bare-metal.</p>
<p>What they do not remove:</p>
<ul>
<li class="">Container base image CVEs. <code>FROM golang:1.25-alpine</code> in your Dockerfile is your responsibility on every Kubernetes platform. Renovate is not an EKS feature or a GKE feature — it's a universal tool.</li>
<li class="">Application Helm chart versions. The charts you own need version bumps when CVEs are patched. ArgoCD + Renovate works identically on EKS, GKE, and AKS.</li>
<li class="">Secret rotation. AWS Secrets Manager and GCP Secret Manager have auto-rotation APIs, but configuring rotation policies and updating applications is still your work.</li>
<li class="">CIS posture for your workloads. The provider hardens the node. Your pods can still run with <code>privileged: true</code>, excessive RBAC permissions, or host path mounts. Gatekeeper/OPA and Polaris enforce these — and they run the same on managed and self-managed clusters.</li>
</ul>
<p>The distinction matters because engineers who move from bare-metal to EKS sometimes assume the entire security patching problem is solved. Layers 3 and 4 — container images and Helm charts — remain exactly as manual as they were before. The two tools that address them, Renovate and Harbor/Trivy, are cluster-agnostic.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-honest-cost-of-each-layer">The Honest Cost of Each Layer<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-honest-cost-of-each-layer" class="hash-link" aria-label="Direct link to The Honest Cost of Each Layer" title="Direct link to The Honest Cost of Each Layer" translate="no">​</a></h2>
<table><thead><tr><th>Layer</th><th>Time to set up</th><th>Ongoing cost (per month)</th><th>Saved by managed provider</th></tr></thead><tbody><tr><td>OS patch download</td><td>Zero (<code>unattended-upgrades</code> default)</td><td>Zero</td><td>Yes</td></tr><tr><td>Kernel reboot (kured)</td><td>30 minutes</td><td>Zero (DaemonSet, 50m CPU request)</td><td>Yes</td></tr><tr><td>k3s upgrade automation</td><td>2 hours (SUC Plans + GH Actions)</td><td>Zero</td><td>Yes (absorbed into k8s version)</td></tr><tr><td>Container image CVEs (Renovate)</td><td>2 hours (global config + 6 per-repo configs)</td><td>Zero</td><td><strong>No</strong></td></tr><tr><td>Helm chart CVEs (Renovate)</td><td>Included above</td><td>Zero</td><td><strong>No</strong></td></tr><tr><td>CIS hardening (kube-bench + Ansible)</td><td>4 hours initial; 5 minutes post-upgrade</td><td>Zero</td><td>Yes</td></tr></tbody></table>
<p>The layers that require real setup time on bare-metal are the ones managed providers solve. The layers that remain your responsibility — container images and Helm charts — cost the same two hours of Renovate configuration on any platform.</p>
<p>Knowing this makes the managed provider value proposition precise rather than vague. You pay $73/month for an EKS control plane to eliminate the OS/runtime/CIS layers. The container image and chart patching story is identical on both sides of that purchase.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-conclusion-that-actually-matters">The Conclusion That Actually Matters<a href="https://docs.devandre.sbs/blog/security-patching-bare-metal-kubernetes#the-conclusion-that-actually-matters" class="hash-link" aria-label="Direct link to The Conclusion That Actually Matters" title="Direct link to The Conclusion That Actually Matters" translate="no">​</a></h2>
<p>Managed providers — EKS, GKE, AKS — eliminate <strong>layers 1, 2, and 5</strong>: OS patching, the Kubernetes runtime binary, and CIS posture maintenance. These are real savings. kured, system-upgrade-controller, and kube-bench exist on bare-metal precisely because there is no provider absorbing that work.</p>
<p>They do not touch <strong>layers 3 and 4</strong>: container base image CVEs and application Helm chart CVEs. A critical vulnerability in <code>golang:1.25-alpine</code> is your problem whether you run on a ThinkPad or on a $500/month EKS cluster. <code>FROM ubuntu:22.04</code> in your Dockerfile inherits CVEs on any platform. Renovate addresses both, and it runs identically on bare-metal and on EKS.</p>
<p>This is the part that gets missed in "just use a managed provider" advice. The layers that feel the most painful on bare-metal — the ones that involve rebooting nodes, swapping binaries, and re-running CIS benchmarks — are exactly the ones managed providers handle. The layer that is quietly the most dangerous — an application container built on a six-month-old base image with 40 unpatched CVEs — is equally your responsibility everywhere.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>security</category>
            <category>patching</category>
            <category>cve</category>
            <category>renovate</category>
            <category>kured</category>
            <category>cis</category>
            <category>bare-metal</category>
            <category>platform-engineering</category>
            <category>eks</category>
            <category>gke</category>
            <category>aks</category>
            <category>devops</category>
        </item>
        <item>
            <title><![CDATA[Self-Managed vs Managed Kubernetes: What Running Your Own Control Plane Actually Looks Like]]></title>
            <link>https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane</link>
            <guid>https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane</guid>
            <pubDate>Sun, 26 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A concrete comparison of running a k3s control plane on a ThinkPad versus EKS/GKE/AKS — grounded in a real bare-metal cluster, not theory. What you own, what breaks, and what you learn.
]]></description>
            <content:encoded><![CDATA[<p>Most Kubernetes comparisons are written by people who have only used managed services. This one is written by someone who has a ThinkPad named <code>set-hog</code> sitting on a desk running the API server right now.</p>
<p>Here is what self-managing a Kubernetes control plane actually looks like — compared line by line against EKS, GKE, and AKS.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-setup">The Setup<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-setup" class="hash-link" aria-label="Direct link to The Setup" title="Direct link to The Setup" translate="no">​</a></h2>
<p>The cluster is <strong>minicloud</strong>: five machines, all bare-metal, running k3s v1.36.2+k3s1 on Ubuntu 22.04.</p>
<table><thead><tr><th>Node</th><th>IP</th><th>Role</th></tr></thead><tbody><tr><td>set-hog</td><td>10.0.0.2</td><td><strong>k3s control plane</strong></td></tr><tr><td>fast-skunk</td><td>10.0.0.4</td><td>k3s worker</td></tr><tr><td>fast-heron</td><td>10.0.0.7</td><td>k3s worker</td></tr><tr><td>star-kitten</td><td>10.0.0.8</td><td>k3s worker</td></tr><tr><td>swift-mac</td><td>10.0.0.10</td><td>k3s worker (MacBook Pro 2012)</td></tr></tbody></table>
<p><code>set-hog</code> is where the API server, scheduler, and controller-manager run. It is a ThinkPad. It is on a desk. When it goes down, no new pods get scheduled — exactly what the managed cloud documentation warns you about when you read the architecture diagrams they publish but do not have to operate themselves.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-comparison">The Comparison<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-comparison" class="hash-link" aria-label="Direct link to The Comparison" title="Direct link to The Comparison" translate="no">​</a></h2>
<table><thead><tr><th>Aspect</th><th>minicloud (self-managed)</th><th>Managed (EKS / GKE / AKS)</th></tr></thead><tbody><tr><td><strong>Where it runs</strong></td><td>Physical ThinkPad on your desk (<code>set-hog</code>)</td><td>Cloud provider's infrastructure, hidden from you</td></tr><tr><td><strong>Who installs it</strong></td><td>You ran <code>k3s server</code> via Ansible</td><td>Provider handles it — you just <code>terraform apply</code></td></tr><tr><td><strong>HA / redundancy</strong></td><td>Single control-plane node — if <code>set-hog</code> dies, no new scheduling until it recovers</td><td>Multi-AZ etcd + API server replicas, provider SLA 99.9%+</td></tr><tr><td><strong>etcd</strong></td><td>Kine/SQLite (k3s lightweight replacement — no <code>--cluster-init</code>)</td><td>Real etcd cluster, managed and backed up by provider</td></tr><tr><td><strong>API server</strong></td><td>Exposed on <code>set-hog</code>, accessed via Tailscale</td><td>Exposed on provider endpoint (e.g. <code>*.eks.amazonaws.com</code>)</td></tr><tr><td><strong>kubectl access</strong></td><td><code>minicloud-oidc</code> context via Tailscale → <code>set-hog</code></td><td>IAM/OIDC integration, no VPN needed</td></tr><tr><td><strong>Break-glass access</strong></td><td><code>minicloud-break-glass</code> context (static cert, emergency only)</td><td>Provider console / IAM emergency roles</td></tr><tr><td><strong>Upgrades</strong></td><td>system-upgrade-controller Plans: server Plan runs first (cordon), then agent Plan, you set the target version</td><td>Provider one-click or auto-upgrade, they handle etcd migration</td></tr><tr><td><strong>Scheduler + ctrl-mgr metrics</strong></td><td>socat DaemonSet on <code>set-hog</code> proxying <code>:10259 → :10269</code> and <code>:10257 → :10267</code> because k3s binds them to <code>127.0.0.1</code> only</td><td>Provider exposes these natively, or not at all (opaque)</td></tr><tr><td><strong>CIS hardening</strong></td><td>kube-bench k3s-CIS-1.7 applied manually via Ansible — <strong>16/16 PASS</strong> on all workers</td><td>Provider handles most CIS controls by default</td></tr><tr><td><strong>Cost</strong></td><td>Electricity + hardware (already owned)</td><td>$70–$150/month per cluster for the control plane alone (EKS: $0.10/hr)</td></tr><tr><td><strong>Failure impact</strong></td><td><code>set-hog</code> crash → API server gone → no new pod scheduling (running pods keep running)</td><td>Provider restores automatically, usually invisible</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-part-no-one-writes-about-scheduler-metrics">The Part No One Writes About: Scheduler Metrics<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-part-no-one-writes-about-scheduler-metrics" class="hash-link" aria-label="Direct link to The Part No One Writes About: Scheduler Metrics" title="Direct link to The Part No One Writes About: Scheduler Metrics" translate="no">​</a></h2>
<p>On every managed Kubernetes cluster, you can scrape the scheduler and controller-manager metrics directly from the provider's monitoring integration. On k3s, both components bind to <code>127.0.0.1</code> only — loopback, not reachable from Prometheus.</p>
<p>The fix is a socat DaemonSet pinned to <code>set-hog</code> with <code>hostNetwork: true</code>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># scheduler proxy: 127.0.0.1:10259 → 0.0.0.0:10269</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">socat TCP</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">LISTEN</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">10269</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain">fork TCP</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">127.0.0.1</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">10259</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># controller-manager proxy: 127.0.0.1:10257 → 0.0.0.0:10267</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">socat TCP</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">LISTEN</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">10267</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain">fork TCP</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">127.0.0.1</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">10257</span><br></div></code></pre></div></div>
<p>Two Kubernetes Services point at the socat pods. Two ServiceMonitors with <code>scheme: https</code> and <code>insecureSkipVerify: true</code> tell Prometheus to scrape them. Result: 60 scheduler series and 93 controller-manager workqueue series, exactly what you see in the "Kubernetes / Scheduler" Grafana dashboard.</p>
<p>On EKS, you click "enable control plane logging" and CloudWatch does the rest. On k3s bare-metal, you learn what socat is for.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-you-actually-own-vs-what-the-provider-owns">What You Actually Own vs What the Provider Owns<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#what-you-actually-own-vs-what-the-provider-owns" class="hash-link" aria-label="Direct link to What You Actually Own vs What the Provider Owns" title="Direct link to What You Actually Own vs What the Provider Owns" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Self-managed (your responsibility)      Managed (provider's responsibility)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">────────────────────────────────────    ──────────────────────────────────────</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">k3s install + initial config            Provisioned automatically</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">CIS kubelet hardening (Ansible)         Enforced by default</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">system-upgrade-controller Plans         One-click upgrade in console</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">socat proxy for control-plane metrics   Metrics exposed natively</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Boot order: controller first (30s),     Always available, no order dependency</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  then nodes (2 min), then Tailscale</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">iptables NAT restore after power        Provider networking never breaks on reboot</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  failure (manual iptables-restore)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Break-glass static cert management      IAM emergency roles</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">minicloud root CA + cert-manager PKI    Provider CA, not yours</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-boot-order-problem">The Boot Order Problem<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-boot-order-problem" class="hash-link" aria-label="Direct link to The Boot Order Problem" title="Direct link to The Boot Order Problem" translate="no">​</a></h3>
<p>Managed Kubernetes does not have a boot order. Your cluster does.</p>
<p>After a full power failure, the correct restart sequence is:</p>
<ol>
<li class=""><strong>MAAS controller</strong> (ThinkPad X390, the NAT router for <code>10.0.0.0/24</code>) — wait 30 seconds</li>
<li class=""><strong>Cluster nodes</strong> — wait 2 minutes for k3s to come up</li>
<li class=""><strong>Tailscale on Mac</strong> — then <code>kubectl</code> works again</li>
</ol>
<p>Miss step 1 and the cluster nodes cannot reach the internet. Nodes come up, k3s starts, ArgoCD tries to sync from GitHub, and every repo-server gets <code>context deadline exceeded</code>. The reason: the controller runs NAT (<code>MASQUERADE</code> via iptables for <code>10.0.0.0/24</code>), and after a reboot, <code>netfilter-persistent</code> does not restore the rules because its systemd unit is a broken symlink.</p>
<p>The recovery procedure:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo sh -c 'iptables-restore &lt; /etc/iptables/rules.v4'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo iptables -I FORWARD -s 10.0.0.0/24 -j ACCEPT</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo iptables -I FORWARD -d 10.0.0.0/24 -j ACCEPT</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo iptables -I FORWARD -s 10.42.0.0/16 -j ACCEPT</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">sudo iptables -I FORWARD -d 10.42.0.0/16 -j ACCEPT</span><br></div></code></pre></div></div>
<p>EKS does not have this problem. But EKS engineers do not know what those commands do, either.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-etcd-difference">The etcd Difference<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-etcd-difference" class="hash-link" aria-label="Direct link to The etcd Difference" title="Direct link to The etcd Difference" translate="no">​</a></h2>
<p>Standard Kubernetes uses etcd as its backing store — a distributed key-value store running as a cluster of 3 or 5 nodes, with Raft consensus.</p>
<p>k3s replaces etcd with <strong>Kine</strong> — a translation layer that speaks the etcd API but writes to SQLite under the hood. SQLite is a single file on <code>set-hog</code>'s disk. No cluster, no Raft, no quorum. If the disk fails, the cluster state is gone.</p>
<p>The backup story: Velero backs up the Kubernetes objects (but not the etcd/SQLite file directly). For a real production cluster, this is the most significant gap versus managed Kubernetes.</p>
<p>For a homelab and portfolio project, SQLite is fine. But it is worth knowing what you gave up.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="upgrading-the-control-plane">Upgrading the Control Plane<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#upgrading-the-control-plane" class="hash-link" aria-label="Direct link to Upgrading the Control Plane" title="Direct link to Upgrading the Control Plane" translate="no">​</a></h2>
<p>On EKS, upgrading the control plane is a button click or a Terraform resource change. The provider handles the etcd migration, the API server restart, and the compatibility matrix.</p>
<p>On k3s bare-metal, upgrades run through <strong>system-upgrade-controller</strong> using Plans:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># server Plan (runs first, concurrency 1, cordons the node)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> upgrade.cattle.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Plan</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">server</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchLabels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">node-role.kubernetes.io/control-plane</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">concurrency</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">1</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">cordon</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">upgrade</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rancher/k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token punctuation" style="color:#393A34">---</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># agent Plan (waits for server Plan to finish)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">apiVersion</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> upgrade.cattle.io/v1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">kind</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> Plan</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">agent</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">spec</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">version</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">prepare</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">image</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> rancher/k3s</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">upgrade</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">args</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">[</span><span class="token string" style="color:#e3116c">"prepare"</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"k3s-server"</span><span class="token punctuation" style="color:#393A34">]</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">nodeSelector</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">matchLabels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">kubernetes.io/os</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> linux</span><br></div></code></pre></div></div>
<p>The cluster upgraded from v1.30 to v1.36.2 this way — all 5 nodes, zero downtime on the workloads, one commit to the gitops repo.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-cis-benchmark">The CIS Benchmark<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-cis-benchmark" class="hash-link" aria-label="Direct link to The CIS Benchmark" title="Direct link to The CIS Benchmark" translate="no">​</a></h2>
<p>Managed providers handle most of the CIS Kubernetes Benchmark by default. They configure the API server flags, lock down the kubelet, and enforce secure defaults.</p>
<p>On k3s bare-metal, you do it yourself. The kubelet configuration for each node is deployed via Ansible:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># /var/lib/kubelet/config.yaml (deployed by cis-kubelet-hardening.yml)</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">protectKernelDefaults</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">eventRecordQPS</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">0</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">rotateCertificates</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">serverTLSBootstrap</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token boolean important" style="color:#36acaa">true</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">tlsCipherSuites</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</span><br></div></code></pre></div></div>
<p>Running <code>kube-bench</code> against the k3s-CIS-1.7 profile after applying the playbook:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">== Summary node ==</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">16 checks PASS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">0 checks FAIL</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">0 checks WARN</span><br></div></code></pre></div></div>
<p>On a managed cluster, you never see this output. The provider ran it for you before you provisioned the first node.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-real-trade-off">The Real Trade-off<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#the-real-trade-off" class="hash-link" aria-label="Direct link to The Real Trade-off" title="Direct link to The Real Trade-off" translate="no">​</a></h2>
<p><strong>What you gain with self-managed:</strong></p>
<ul>
<li class="">Full operational ownership — you understand every component because you installed it</li>
<li class="">Zero control-plane cost (EKS charges $0.10/hr ≈ $73/month for the control plane alone)</li>
<li class="">Air-gap capability — the cluster functions with no internet if needed</li>
<li class="">Your own PKI — minicloud root CA trusted in the OS, the browser, and every service</li>
<li class="">The ability to explain the difference between the API server and the scheduler in a job interview, because you have debugged both</li>
</ul>
<p><strong>What you give up:</strong></p>
<ul>
<li class="">HA control plane — one <code>set-hog</code> disk failure ends the cluster</li>
<li class="">Managed etcd backups</li>
<li class="">The ~2 hours you spend after a power failure restoring iptables rules and waiting for <code>set-hog</code> to come back up before <code>kubectl</code> works again</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-it-matters-for-platform-engineering-roles">Why It Matters for Platform Engineering Roles<a href="https://docs.devandre.sbs/blog/self-managed-vs-managed-kubernetes-control-plane#why-it-matters-for-platform-engineering-roles" class="hash-link" aria-label="Direct link to Why It Matters for Platform Engineering Roles" title="Direct link to Why It Matters for Platform Engineering Roles" translate="no">​</a></h2>
<p>When you sit in front of a managed Kubernetes cluster at work — and you will, because EKS is the default everywhere — you will understand what the provider is doing for you instead of treating it as magic.</p>
<p>You will know:</p>
<ul>
<li class="">What Kine/SQLite is, and why real production uses etcd</li>
<li class="">Why the scheduler metrics endpoint is on <code>127.0.0.1</code> and how to expose it</li>
<li class="">What <code>iptables-restore</code> does and why NAT matters for pod networking</li>
<li class="">What CIS hardening actually configures, not just that it should be enabled</li>
<li class="">What break-glass access means and why you need it separate from OIDC</li>
</ul>
<p>Being able to say "I ran the control plane myself" is not about the homelab. It is about the depth of understanding that comes from having broken it, fixed it, and understood why.</p>
<hr>
<p><em>minicloud is an ongoing bare-metal Kubernetes platform project. The full architecture, runbooks, and phase-by-phase documentation are at <a href="https://kanmegnetabouguie.github.io/minicloud-platform-docs" target="_blank" rel="noopener noreferrer" class="">kanmegnetabouguie.github.io/minicloud-platform-docs</a>.</em></p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>bare-metal</category>
            <category>platform-engineering</category>
            <category>devops</category>
            <category>control-plane</category>
            <category>eks</category>
            <category>gke</category>
        </item>
        <item>
            <title><![CDATA[Un modèle sort de l'entraînement à 28 Go. Tu le télécharges à 4.7 Go. Qui a fait la compression ?]]></title>
            <link>https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization</link>
            <guid>https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization</guid>
            <pubDate>Fri, 17 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[La quantization ne sert pas qu'à réduire la RAM. Derrière cette technique, il y a trois objectifs concrets : démocratiser l'accès, accélérer l'inférence, et permettre le déploiement privé. Et entre le modèle sorti du labo et celui qui tourne sur ton cluster, il s'est passé beaucoup de choses.]]></description>
            <content:encoded><![CDATA[<p>Un modèle sort de l'entraînement à 28 Go. Tu le télécharges à 4.7 Go. Qui a fait la compression entre les deux — et pourquoi ?</p>
<p>Ce post répond à cette question, et explique comment les modèles open-source circulent depuis les labos de recherche jusqu'à ton cluster.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pourquoi-la-quantization-existe--trois-objectifs">Pourquoi la quantization existe : trois objectifs<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#pourquoi-la-quantization-existe--trois-objectifs" class="hash-link" aria-label="Direct link to Pourquoi la quantization existe : trois objectifs" title="Direct link to Pourquoi la quantization existe : trois objectifs" translate="no">​</a></h2>
<p>La quantization n'est pas une astuce technique pour "faire tenir un modèle". C'est une réponse à trois problèmes concrets.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="1-démocratiser-laccès">1. Démocratiser l'accès<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#1-d%C3%A9mocratiser-lacc%C3%A8s" class="hash-link" aria-label="Direct link to 1. Démocratiser l'accès" title="Direct link to 1. Démocratiser l'accès" translate="no">​</a></h3>
<p>Sans quantization, un modèle 7B en FP16 occupe 14 Go de VRAM. Il te faut une RTX 3080 (700€ minimum) ou une A100 (10 000€ en datacenter). Seuls les labos de recherche bien financés et les grandes entreprises peuvent faire de l'inférence locale.</p>
<p>Avec Q4_K_M, ce même modèle tient en 4.7 Go de RAM. Un ThinkPad d'occasion à 300€ peut le faire tourner. C'est ce changement qui a déclenché l'explosion de l'open-source LLM en 2023 : le jour où des modèles de qualité sont devenus accessibles sur du hardware grand public.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="2-accélérer-linférence">2. Accélérer l'inférence<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#2-acc%C3%A9l%C3%A9rer-linf%C3%A9rence" class="hash-link" aria-label="Direct link to 2. Accélérer l'inférence" title="Direct link to 2. Accélérer l'inférence" translate="no">​</a></h3>
<p>Moins de bits ne signifie pas seulement moins de mémoire — cela signifie aussi moins de données à lire depuis la RAM à chaque calcul.</p>
<p>Sur CPU, la vitesse de génération de tokens est souvent limitée par la <strong>bande passante mémoire</strong> : le processeur doit lire les poids du modèle à chaque étape de génération. Un modèle Q4 lit 8× moins de données qu'un modèle FP32. En pratique, un 7B Q4_K_M génère souvent 1.5 à 2× plus de tokens par seconde qu'un 7B Q8 — pas seulement parce qu'il est plus petit, mais parce que les lectures mémoire sont plus rapides.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="3-permettre-le-déploiement-privé">3. Permettre le déploiement privé<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#3-permettre-le-d%C3%A9ploiement-priv%C3%A9" class="hash-link" aria-label="Direct link to 3. Permettre le déploiement privé" title="Direct link to 3. Permettre le déploiement privé" translate="no">​</a></h3>
<p>C'est l'objectif le plus stratégique pour les entreprises.</p>
<p>Si tu utilises l'API OpenAI ou Groq, chaque message de tes utilisateurs traverse les serveurs d'une entreprise tierce. Pour un usage personnel ou grand public, c'est acceptable. Pour des données médicales, financières, ou industrielles, c'est souvent impossible légalement et inacceptable en termes de confidentialité.</p>
<p>Un LLM quantisé qui tourne en local résout ce problème par l'architecture : les données ne quittent jamais l'infrastructure. Sur minicloud, les interactions avec Open WebUI ne quittent pas le cluster. C'est une propriété garantie par le design, pas par une promesse contractuelle.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="le-cycle-de-vie-dun-modèle-open-source">Le cycle de vie d'un modèle open-source<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#le-cycle-de-vie-dun-mod%C3%A8le-open-source" class="hash-link" aria-label="Direct link to Le cycle de vie d'un modèle open-source" title="Direct link to Le cycle de vie d'un modèle open-source" translate="no">​</a></h2>
<p>Il y a une question que peu de gens se posent quand ils font <code>ollama pull</code> : d'où vient ce fichier, et qui l'a préparé ?</p>
<p>Voici ce qui se passe entre la sortie d'un modèle et son exécution sur ton cluster.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="étape-1--entraînement-par-le-labo">Étape 1 — Entraînement par le labo<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#%C3%A9tape-1--entra%C3%AEnement-par-le-labo" class="hash-link" aria-label="Direct link to Étape 1 — Entraînement par le labo" title="Direct link to Étape 1 — Entraînement par le labo" translate="no">​</a></h3>
<p>Un laboratoire (Meta, Alibaba, Mistral, Microsoft...) entraîne le modèle sur des milliers de GPUs pendant des semaines ou des mois. Le résultat : des poids en <strong>FP32 ou BF16</strong> — la représentation la plus précise possible des connaissances acquises.</p>
<p>Ces poids sont publiés sur <strong>HuggingFace</strong>. Le modèle original de Qwen 2.5 7B par Alibaba, par exemple, est disponible là-bas en BF16 (~14 Go).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="étape-2--quantization-par-la-communauté">Étape 2 — Quantization par la communauté<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#%C3%A9tape-2--quantization-par-la-communaut%C3%A9" class="hash-link" aria-label="Direct link to Étape 2 — Quantization par la communauté" title="Direct link to Étape 2 — Quantization par la communauté" translate="no">​</a></h3>
<p>Des membres de la communauté open-source prennent ces poids FP16/BF16 et créent des versions quantisées. Les noms les plus connus dans cet écosystème : <strong>bartowski</strong>, <strong>TheBloke</strong>, <strong>unsloth</strong>.</p>
<p>Leur travail :</p>
<ol>
<li class="">Télécharger les poids originaux depuis HuggingFace</li>
<li class="">Appliquer llama.cpp ou d'autres outils pour créer les fichiers GGUF</li>
<li class="">Générer toutes les variantes : Q2_K, Q3_K_M, Q4_K_M, Q5_K_M, Q8_0</li>
<li class="">Publier ces fichiers dérivés sur HuggingFace</li>
</ol>
<p>C'est un travail bénévole, non rémunéré, qui rend l'écosystème possible.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="étape-3--packaging-par-ollama">Étape 3 — Packaging par Ollama<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#%C3%A9tape-3--packaging-par-ollama" class="hash-link" aria-label="Direct link to Étape 3 — Packaging par Ollama" title="Direct link to Étape 3 — Packaging par Ollama" translate="no">​</a></h3>
<p>Ollama récupère les fichiers GGUF créés par la communauté et les rend disponibles via son registry (<code>registry.ollama.ai</code>). Il ajoute un <code>Modelfile</code> qui précise le template de prompt, le system message par défaut, et les paramètres d'inférence recommandés.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Ce que tu fais :</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ollama pull qwen2.5:7b-instruct-q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Ce qui se passe :</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → Ollama contacte registry.ollama.ai</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → Télécharge les blobs GGUF Q4_K_M (~4.7 Go)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → Les stocke dans /root/.ollama/models/</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># → Le modèle est prêt à l'inférence</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="étape-4--inférence-sur-ton-cluster">Étape 4 — Inférence sur ton cluster<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#%C3%A9tape-4--inf%C3%A9rence-sur-ton-cluster" class="hash-link" aria-label="Direct link to Étape 4 — Inférence sur ton cluster" title="Direct link to Étape 4 — Inférence sur ton cluster" translate="no">​</a></h3>
<p>Le modèle tourne dans un pod Ollama, pinné sur un nœud spécifique. LiteLLM route les requêtes vers l'instance la moins occupée. L'utilisateur voit une réponse en quelques secondes.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Utilisateur → Open WebUI → LiteLLM → Ollama (pod fast-heron)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                                           ↓</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                                   qwen2.5:7b-instruct-q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                                   (GGUF Q4_K_M, 4.7 Go en RAM)</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="modèles-non-quantisés-vs-quantisés--ce-sont-des-artefacts-différents">Modèles non-quantisés vs quantisés — ce sont des artefacts différents<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#mod%C3%A8les-non-quantis%C3%A9s-vs-quantis%C3%A9s--ce-sont-des-artefacts-diff%C3%A9rents" class="hash-link" aria-label="Direct link to Modèles non-quantisés vs quantisés — ce sont des artefacts différents" title="Direct link to Modèles non-quantisés vs quantisés — ce sont des artefacts différents" translate="no">​</a></h2>
<p>Une confusion fréquente : on parle de "le modèle" comme s'il n'en existait qu'une version. En réalité :</p>
<table><thead><tr><th>Type</th><th>Format</th><th>Poids</th><th>Usage typique</th></tr></thead><tbody><tr><td>Original (sorti du labo)</td><td>FP32 / BF16</td><td>14–28 Go (7B)</td><td>Fine-tuning, recherche</td></tr><tr><td>Quantisé par la communauté</td><td>GGUF Q4_K_M</td><td>4.7 Go (7B)</td><td>Inférence sur hardware grand public</td></tr><tr><td>Spécialisé par Modelfile</td><td>GGUF (poids inchangés)</td><td>identique au base</td><td>Pipeline avec persona + comportement custom</td></tr><tr><td>Fine-tuné + quantisé</td><td>GGUF custom</td><td>variable</td><td>Spécialisation profonde, nouvelle connaissance</td></tr></tbody></table>
<p>Le modèle original et ses versions quantisées <strong>coexistent</strong> sur HuggingFace. Elles ne se remplacent pas — elles servent des usages différents.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="les-3-vraies-façons-de-spécialiser-un-llm">Les 3 vraies façons de spécialiser un LLM<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#les-3-vraies-fa%C3%A7ons-de-sp%C3%A9cialiser-un-llm" class="hash-link" aria-label="Direct link to Les 3 vraies façons de spécialiser un LLM" title="Direct link to Les 3 vraies façons de spécialiser un LLM" translate="no">​</a></h2>
<p>Avant d'aller plus loin, une distinction essentielle que beaucoup de ressources mélangent.</p>
<table><thead><tr><th>Technique</th><th>Poids modifiés ?</th><th>GPU requis ?</th><th>Ce que ça change</th></tr></thead><tbody><tr><td><strong>System prompt / Modelfile</strong></td><td>Non</td><td>Non</td><td>Comportement et persona</td></tr><tr><td><strong>RAG</strong></td><td>Non</td><td>Non</td><td>Accès à des données fraîches et privées</td></tr><tr><td><strong>Fine-tuning</strong></td><td>Oui</td><td>Oui</td><td>La connaissance encodée dans les paramètres</td></tr></tbody></table>
<p>Ces trois techniques sont complémentaires, pas substituables. On peut les combiner — et c'est exactement ce que fait le pipeline <code>phi3-financial</code> sur minicloud.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="le-cas-de-phi3-financial--modelfile-pas-fine-tuning">Le cas de <code>phi3-financial</code> — Modelfile, pas fine-tuning<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#le-cas-de-phi3-financial--modelfile-pas-fine-tuning" class="hash-link" aria-label="Direct link to le-cas-de-phi3-financial--modelfile-pas-fine-tuning" title="Direct link to le-cas-de-phi3-financial--modelfile-pas-fine-tuning" translate="no">​</a></h2>
<p>Il est tentant d'appeler <code>phi3-financial</code> un modèle fine-tuné parce qu'il a un nom distinct dans <code>ollama list</code>. Mais la preuve par les chiffres contredit cette interprétation :</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama -- ollama list</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">phi4-mini:latest       78fad5d182a7    2.5 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">phi3-financial:latest  66e3380808ef    2.5 GB</span><br></div></code></pre></div></div>
<p><strong>Exactement la même taille.</strong> Un vrai fine-tuning modifie les valeurs des poids — la taille du fichier GGUF résultant varie légèrement. Ici les deux fichiers font 2.5 GB, ce qui indique que les poids sont identiques.</p>
<p><code>phi3-financial</code> est un <strong>Ollama Modelfile</strong> : une configuration qui enveloppe <code>phi4-mini</code> avec un system prompt et des paramètres d'inférence, sans toucher aux poids.</p>
<div class="language-dockerfile codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-dockerfile codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">FROM phi4-mini</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">SYSTEM """</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Tu es un expert en analyse financière spécialisé dans le secteur des assurances.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Tu analyses uniquement des données financières et réponds de façon précise et factuelle.</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">"""</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">PARAMETER temperature 0.3</span><br></div></code></pre></div></div>
<p>Quand tu fais <code>ollama create phi3-financial -f Modelfile</code>, Ollama crée une nouvelle entrée dans son registry avec ce nom et cette configuration. Les poids sont <strong>identiques</strong> à ceux de <code>phi4-mini</code> — aucun entraînement n'a eu lieu.</p>
<p>La spécialisation de <code>phi3-financial</code> vient en réalité de trois couches empilées :</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Requête utilisateur</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    │</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">LangfusePromptHandler (LiteLLM CustomLogger)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    │ Injecte le system prompt financier depuis Langfuse</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    │ (versioning des prompts, A/B testing possible)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">phi3-financial Modelfile</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    │ Applique temperature=0.3, contraintes de persona</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">phi4-mini GGUF Q4_K_M</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    │ Poids identiques au modèle original Microsoft</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ▼</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Réponse générée</span><br></div></code></pre></div></div>
<p>C'est une <strong>spécialisation par prompt engineering en profondeur</strong>, pas du fine-tuning. C'est parfaitement valide et largement utilisé en production — plus rapide à itérer, plus facile à maintenir, aucun GPU requis.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="quand-le-fine-tuning-devient-nécessaire">Quand le fine-tuning devient nécessaire<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#quand-le-fine-tuning-devient-n%C3%A9cessaire" class="hash-link" aria-label="Direct link to Quand le fine-tuning devient nécessaire" title="Direct link to Quand le fine-tuning devient nécessaire" translate="no">​</a></h2>
<p>Le fine-tuning n'est justifié que dans des cas précis :</p>
<p><strong>Nouvelles connaissances factuelles</strong> — si le modèle doit connaître des faits qui n'étaient pas dans ses données d'entraînement (documentation interne, terminologie propriétaire, données post-cutoff).</p>
<p><strong>Comportement très contraignant</strong> — si le system prompt seul ne suffit pas à maintenir le persona sous des prompts adversariaux.</p>
<p><strong>Efficacité à l'inférence</strong> — un modèle fine-tuné sur une tâche précise peut atteindre de meilleures performances avec un context plus court, ce qui réduit les coûts.</p>
<p>Pour <code>phi3-financial</code>, le RAG + LangfusePromptHandler couvre les deux premiers besoins sans les coûts d'un fine-tuning réel. Si le pipeline nécessitait un jour de connaître des règlements ACPR très spécifiques absents du pre-training, le fine-tuning deviendrait pertinent.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ce-que-ça-implique-concrètement-pour-linférence">Ce que ça implique concrètement pour l'inférence<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#ce-que-%C3%A7a-implique-concr%C3%A8tement-pour-linf%C3%A9rence" class="hash-link" aria-label="Direct link to Ce que ça implique concrètement pour l'inférence" title="Direct link to Ce que ça implique concrètement pour l'inférence" translate="no">​</a></h2>
<p>Ces types de modèles ne s'utilisent pas de la même façon dans un stack de production.</p>
<p><strong>Le modèle original (FP16)</strong> — uniquement pour le fine-tuning. Il faut au minimum un GPU avec 14 Go de VRAM et du temps de calcul. C'est l'entrée d'un pipeline ML, pas sa sortie.</p>
<p><strong>Le modèle quantisé (GGUF Q4_K_M)</strong> — ce que tu déploies en production pour l'inférence. Tourne sur CPU, sur des GPUs grand public, sur du hardware embarqué. C'est la sortie du pipeline, celle qui crée de la valeur.</p>
<p><strong>Le Modelfile</strong> — une couche de configuration au-dessus d'un modèle quantisé existant. Zéro coût de calcul supplémentaire, itération rapide sur le comportement. C'est l'état réel de <code>phi3-financial</code> sur minicloud.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="pourquoi-cest-important-pour-le-déploiement-en-entreprise">Pourquoi c'est important pour le déploiement en entreprise<a href="https://docs.devandre.sbs/blog/llm-model-lifecycle-quantization#pourquoi-cest-important-pour-le-d%C3%A9ploiement-en-entreprise" class="hash-link" aria-label="Direct link to Pourquoi c'est important pour le déploiement en entreprise" title="Direct link to Pourquoi c'est important pour le déploiement en entreprise" translate="no">​</a></h2>
<p>Dans un contexte professionnel, ces quatre niveaux correspondent à des rôles distincts :</p>
<table><thead><tr><th>Artefact</th><th>Équipe responsable</th></tr></thead><tbody><tr><td>Modèle FP16 original</td><td>Data scientists / ML researchers</td></tr><tr><td>Modèle GGUF quantisé</td><td>MLOps / Platform engineers</td></tr><tr><td>Modelfile + system prompt</td><td>AI engineers / Prompt engineers</td></tr><tr><td>RAG pipeline</td><td>AI engineers + Data engineers</td></tr><tr><td>Fine-tuning</td><td>ML engineers (besoin GPU, dataset, évaluation)</td></tr></tbody></table>
<p>Sur minicloud, ces rôles sont joués par une seule personne. En entreprise, ce sont des équipes distinctes avec des compétences différentes. Comprendre quelle technique appartient à quel niveau — et pourquoi — est ce qui distingue un ingénieur qui "utilise des LLMs" d'un ingénieur qui "conçoit des systèmes AI".</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>quantization</category>
            <category>ollama</category>
            <category>fine-tuning</category>
            <category>mlops</category>
            <category>open-source</category>
        </item>
        <item>
            <title><![CDATA[La quantization LLM démystifiée : comment faire tourner un 7B sur un ThinkPad]]></title>
            <link>https://docs.devandre.sbs/blog/llm-quantization-demystified</link>
            <guid>https://docs.devandre.sbs/blog/llm-quantization-demystified</guid>
            <pubDate>Fri, 17 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Un 7B en FP32 c'est 28 Go de RAM. Sur mon cluster ThinkPad, impossible. La quantization m'a permis de descendre à 4.7 Go sans perdre la qualité qui compte. Voici comment ça fonctionne.]]></description>
            <content:encoded><![CDATA[<p>Un modèle 7B en FP32, c'est 28 Go de RAM. Mes ThinkPads en ont 16 à 32. Impossible de charger le modèle — sans parler de faire de l'inférence.</p>
<p>La quantization a résolu ce problème. Pas en sacrifiant la qualité — en changeant la façon dont les poids sont stockés.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ce-quest-un-paramètre-concrètement">Ce qu'est un paramètre, concrètement<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#ce-quest-un-param%C3%A8tre-concr%C3%A8tement" class="hash-link" aria-label="Direct link to Ce qu'est un paramètre, concrètement" title="Direct link to Ce qu'est un paramètre, concrètement" translate="no">​</a></h2>
<p>Un LLM "7B" a 7 milliards de paramètres. Chaque paramètre est un nombre en virgule flottante — un poids appris pendant l'entraînement qui encode une fraction des patterns vus dans les données.</p>
<p>En <strong>FP32</strong> (float 32 bits), chaque paramètre occupe 4 octets.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">7 000 000 000 paramètres × 4 octets = 28 000 000 000 octets = 28 Go</span><br></div></code></pre></div></div>
<p>28 Go juste pour charger le modèle en RAM. Sans compter le KV cache pendant l'inférence, les activations, l'overhead du runtime.</p>
<p>Sur un ThinkPad avec 16 Go de RAM système et 8 à 12 Go disponibles pour les workloads : <strong>impossible</strong>.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="le-principe-de-la-quantization">Le principe de la quantization<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#le-principe-de-la-quantization" class="hash-link" aria-label="Direct link to Le principe de la quantization" title="Direct link to Le principe de la quantization" translate="no">​</a></h2>
<p>La quantization réduit la précision de chaque paramètre — moins de bits par nombre, moins de mémoire, au prix d'une légère perte de précision.</p>
<p>L'analogie : imagine que tu mesures une distance. En FP32, tu utilises une règle au millimètre. En Q4, tu utilises une règle au centimètre. Pour construire une maison, la différence est négligeable. Pour de l'horlogerie de précision, ça change tout.</p>
<p>Pour les LLMs, la grande majorité des tâches — conversation, résumé, code, Q&amp;A — tolèrent très bien la réduction de précision des poids. Le réseau neuronal est redondant par nature : des millions de paramètres collaborent pour chaque réponse, et une légère imprécision sur chacun ne change pas le résultat global de façon perceptible.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="la-hiérarchie-des-formats">La hiérarchie des formats<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#la-hi%C3%A9rarchie-des-formats" class="hash-link" aria-label="Direct link to La hiérarchie des formats" title="Direct link to La hiérarchie des formats" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">FP32    4 bytes/param   7B = 28.0 Go   référence</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">FP16    2 bytes/param   7B = 14.0 Go   </span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q8_0    1 byte/param    7B =  7.0 Go   </span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q4_K_M  ~0.5 byte       7B =  4.7 Go   ← le point d'équilibre</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q3_K_M  ~0.4 byte       7B =  3.9 Go   dégradation notable</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q2_K    ~0.25 byte      7B =  2.7 Go   à éviter</span><br></div></code></pre></div></div>
<p>Chaque niveau vers le bas divise approximativement la mémoire par deux, mais la perte de qualité n'est pas linéaire. De FP32 à Q4_K_M, la dégradation est quasi imperceptible en pratique. De Q4 à Q2, elle devient audible — hallucinations plus fréquentes, raisonnement moins stable.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ce-que-signifient-les-suffixes">Ce que signifient les suffixes<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#ce-que-signifient-les-suffixes" class="hash-link" aria-label="Direct link to Ce que signifient les suffixes" title="Direct link to Ce que signifient les suffixes" translate="no">​</a></h2>
<p>Si tu vas sur Ollama ou HuggingFace, tu verras des noms comme <code>Q4_K_M</code>, <code>Q5_K_S</code>, <code>IQ3_XS</code>. Voici comment les lire :</p>
<p><strong>Le chiffre</strong> — le nombre de bits par paramètre.</p>
<ul>
<li class=""><code>Q4</code> = 4 bits</li>
<li class=""><code>Q5</code> = 5 bits</li>
<li class=""><code>Q8</code> = 8 bits</li>
</ul>
<p><strong>La lettre après le chiffre</strong> — la méthode de quantization.</p>
<ul>
<li class=""><code>_K</code> = "K-quant" — une méthode qui quantize différemment selon l'importance relative de chaque couche du réseau. Plus intelligente que la quantization uniforme.</li>
<li class=""><code>_0</code> = quantization uniforme basique (plus ancienne).</li>
</ul>
<p><strong>La dernière lettre</strong> — la taille des "blocs" de calcul.</p>
<ul>
<li class=""><code>_S</code> (Small) = plus petit, légèrement plus rapide, légèrement moins précis.</li>
<li class=""><code>_M</code> (Medium) = équilibre qualité/vitesse.</li>
<li class=""><code>_L</code> (Large) = plus précis, un peu plus lent.</li>
</ul>
<p><strong>Résumé pratique :</strong></p>
<ul>
<li class=""><code>Q4_K_M</code> = 4 bits, K-quant, taille medium → <strong>le choix par défaut</strong>.</li>
<li class=""><code>Q5_K_M</code> = 5 bits, K-quant, medium → +20% de RAM, presque aucune perte vs Q4.</li>
<li class=""><code>Q8_0</code> = 8 bits, uniforme → pratiquement identique à FP16.</li>
<li class=""><code>IQ3_XS</code> = une variante "importance-aware" à 3 bits → pour situations très contraintes.</li>
</ul>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="les-quatre-familles-de-formats">Les quatre familles de formats<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#les-quatre-familles-de-formats" class="hash-link" aria-label="Direct link to Les quatre familles de formats" title="Direct link to Les quatre familles de formats" translate="no">​</a></h2>
<p>Selon ton hardware, tu croiseras quatre formats principaux :</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="gguf--le-format-cpu-first">GGUF — le format CPU-first<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#gguf--le-format-cpu-first" class="hash-link" aria-label="Direct link to GGUF — le format CPU-first" title="Direct link to GGUF — le format CPU-first" translate="no">​</a></h3>
<p>Développé par llama.cpp, utilisé par <strong>Ollama</strong>. Conçu pour tourner sur CPU avec possibilité d'offloader des couches vers un GPU si disponible.</p>
<p>C'est le format qu'on utilise sur minicloud. Tous les suffixes <code>Q4_K_M</code>, <code>Q5_K_M</code>, etc. font référence à GGUF.</p>
<p><strong>Avantage :</strong> fonctionne sans GPU, très bien optimisé pour les architectures x86 modernes.
<strong>Inconvénient :</strong> moins efficace qu'un format GPU-natif si tu as un GPU.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="gptq--quantization-post-training-orientée-gpu">GPTQ — quantization post-training orientée GPU<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#gptq--quantization-post-training-orient%C3%A9e-gpu" class="hash-link" aria-label="Direct link to GPTQ — quantization post-training orientée GPU" title="Direct link to GPTQ — quantization post-training orientée GPU" translate="no">​</a></h3>
<p>Quantize les poids après entraînement en minimisant l'erreur de reconstruction. Très bon si tu as assez de VRAM.</p>
<p><strong>Avantage :</strong> bonne qualité sur GPU.
<strong>Inconvénient :</strong> CPU-unfriendly, nécessite ExLlama ou AutoGPTQ pour l'inférence.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="awq--activation-aware-weight-quantization">AWQ — Activation-aware Weight Quantization<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#awq--activation-aware-weight-quantization" class="hash-link" aria-label="Direct link to AWQ — Activation-aware Weight Quantization" title="Direct link to AWQ — Activation-aware Weight Quantization" translate="no">​</a></h3>
<p>Plus récent que GPTQ. L'idée : certains paramètres sont plus importants que d'autres (ceux qui activent souvent). AWQ les protège en les quantizant moins agressivement.</p>
<p><strong>Avantage :</strong> meilleure qualité que GPTQ à même taille, de plus en plus standard.
<strong>Inconvénient :</strong> nécessite un runtime compatible (vLLM, AutoAWQ).</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="exl2--exllamav2">EXL2 — ExLlamaV2<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#exl2--exllamav2" class="hash-link" aria-label="Direct link to EXL2 — ExLlamaV2" title="Direct link to EXL2 — ExLlamaV2" translate="no">​</a></h3>
<p>Format propriétaire à ExLlamaV2, très efficace pour l'inférence GPU en batch. Permet des taux de bits mixtes par couche.</p>
<p><strong>Avantage :</strong> débit maximal sur GPU NVIDIA.
<strong>Inconvénient :</strong> écosystème plus fermé, pas pour CPU.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="la-règle-dor">La règle d'or<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#la-r%C3%A8gle-dor" class="hash-link" aria-label="Direct link to La règle d'or" title="Direct link to La règle d'or" translate="no">​</a></h2>
<blockquote>
<p>Descends d'un niveau de quantization avant de descendre à un modèle plus petit.</p>
</blockquote>
<p>Un 7B Q4 surpasse un 3B Q8 sur presque toutes les tâches — raisonnement, suivi d'instructions, cohérence longue. Les 7 milliards de paramètres, même légèrement imprécis, encodent plus de connaissance que 3 milliards de paramètres très précis.</p>
<p>Concrètement sur minicloud :</p>
<table><thead><tr><th>Option</th><th>RAM</th><th>Qualité relative</th></tr></thead><tbody><tr><td>qwen2.5 3B Q8</td><td>3.0 Go</td><td>Baseline</td></tr><tr><td>qwen2.5 7B Q4_K_M</td><td>4.7 Go</td><td>+20–30% qualité</td></tr><tr><td>qwen2.5 7B Q5_K_M</td><td>5.8 Go</td><td>+22–32% qualité</td></tr></tbody></table>
<p>Pour 1.7 Go de RAM supplémentaire, on gagne un saut de qualité massif.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="limpact-sur-la-qualité--les-chiffres-réels">L'impact sur la qualité — les chiffres réels<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#limpact-sur-la-qualit%C3%A9--les-chiffres-r%C3%A9els" class="hash-link" aria-label="Direct link to L'impact sur la qualité — les chiffres réels" title="Direct link to L'impact sur la qualité — les chiffres réels" translate="no">​</a></h2>
<p>Le standard de mesure de la dégradation par quantization est la <strong>perplexité</strong> — une mesure de la "surprise" du modèle face à un texte de référence. Plus la perplexité est basse, mieux le modèle prédit le langage.</p>
<p>Sur Llama 3 8B (valeurs représentatives de la famille 7-8B) :</p>
<table><thead><tr><th>Format</th><th>Perplexité (WikiText-2)</th><th>Différence vs FP16</th></tr></thead><tbody><tr><td>FP16</td><td>6.12</td><td>référence</td></tr><tr><td>Q8_0</td><td>6.13</td><td>+0.01 (+0.2%)</td></tr><tr><td>Q4_K_M</td><td>6.22</td><td>+0.10 (+1.6%)</td></tr><tr><td>Q3_K_M</td><td>6.47</td><td>+0.35 (+5.7%)</td></tr><tr><td>Q2_K</td><td>7.15</td><td>+1.03 (+16.8%)</td></tr></tbody></table>
<p>En pratique : entre FP16 et Q4_K_M, la différence de perplexité est de 1.6%. Dans une conversation réelle, c'est imperceptible. Entre Q4 et Q2, le saut de 16.8% correspond à des réponses notablement moins cohérentes sur les tâches complexes.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ce-que-ça-donne-sur-le-cluster-minicloud">Ce que ça donne sur le cluster minicloud<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#ce-que-%C3%A7a-donne-sur-le-cluster-minicloud" class="hash-link" aria-label="Direct link to Ce que ça donne sur le cluster minicloud" title="Direct link to Ce que ça donne sur le cluster minicloud" translate="no">​</a></h2>
<p>Le cluster tourne sur des ThinkPads CPU-only (pas de GPU). La contrainte est réelle.</p>
<p>Avant : <code>phi4-mini</code> (3.8B, format propriétaire Microsoft) — 2.5 Go en RAM, ~15 tokens/sec sur ThinkPad.</p>
<p>Après : <code>qwen2.5:7b-instruct-q4_k_m</code> (7B, GGUF Q4_K_M) — 4.7 Go en RAM, ~10 tokens/sec.</p>
<p>On perd 5 tokens/sec (vitesse), on gagne 15–20% de qualité sur les benchmarks. Pour du chat interactif où l'utilisateur lit à 4–5 mots/seconde, 10 tokens/sec est largement suffisant.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Vérifier les modèles chargés sur les 3 instances Ollama</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama -- ollama list</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama-secondary -- ollama list</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama-tertiary -- ollama list</span><br></div></code></pre></div></div>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">NAME                          ID              SIZE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">qwen2.5:7b-instruct-q4_k_m    845dbda0ea48    4.7 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">phi4-mini:latest               78fad5d182a7    2.5 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">deepseek-r1:7b                 755ced02ce7b    4.7 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">...</span><br></div></code></pre></div></div>
<p>Trois instances Ollama, chacune sur un nœud différent. LiteLLM route les requêtes vers l'instance la moins occupée. La quantization Q4_K_M est ce qui rend ce setup possible sur du hardware grand public.</p>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="comment-choisir">Comment choisir<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#comment-choisir" class="hash-link" aria-label="Direct link to Comment choisir" title="Direct link to Comment choisir" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Tu as un GPU avec assez de VRAM ?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├── Oui → AWQ ou GPTQ (meilleure qualité à même taille que GGUF)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── Non → GGUF, et le format :</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    RAM disponible pour le modèle ?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── &lt; 5 Go    → Q4_K_M  (défaut)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── 5–7 Go    → Q5_K_M  (si tu peux)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    ├── 7–15 Go   → Q8_0    (quasi-FP16)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── &gt; 15 Go   → FP16    (référence)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    Q2 ou Q3 ?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    └── Éviter sauf contrainte extrême (edge, IoT, &lt;3 Go impératif)</span><br></div></code></pre></div></div>
<hr>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="ce-quon-retient">Ce qu'on retient<a href="https://docs.devandre.sbs/blog/llm-quantization-demystified#ce-quon-retient" class="hash-link" aria-label="Direct link to Ce qu'on retient" title="Direct link to Ce qu'on retient" translate="no">​</a></h2>
<p>La quantization n'est pas un compromis entre "bon modèle" et "modèle qui tient en RAM". C'est une technique mature, mesurée, avec des pertes de qualité documentées et prévisibles.</p>
<p>Q4_K_M est devenu le standard de facto de l'écosystème open-source pour une raison : c'est le point où la perte de précision devient théorique plutôt que pratique pour la grande majorité des tâches.</p>
<p>Sur minicloud, c'est ce qui permet de faire tourner un LLM 7B de qualité production sur du matériel qu'on aurait jeté il y a trois ans.</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>quantization</category>
            <category>ollama</category>
            <category>inference</category>
            <category>mlops</category>
            <category>bare-metal</category>
        </item>
        <item>
            <title><![CDATA[Why k3s? Installing Kubernetes on 5 Laptops with a Single curl Command]]></title>
            <link>https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal</link>
            <guid>https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal</guid>
            <pubDate>Thu, 16 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How k3s was installed on a 5-node bare-metal cluster — one curl command per machine — and why k3s beat kubeadm, microk8s, RKE2, and k0s for this specific hardware.
]]></description>
            <content:encoded><![CDATA[<p>The hardware was provisioned. MAAS had PXE-booted four ThinkPads and cloud-init had written the SSH keys and hostnames. The next question was: <strong>how do you actually get Kubernetes running on five laptops?</strong></p>
<p>There are more ways to install Kubernetes than there are Kubernetes certification paths. I ended up with k3s. Here is why — and exactly what the installation looked like.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-constraint-that-made-the-decision">The Constraint That Made the Decision<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#the-constraint-that-made-the-decision" class="hash-link" aria-label="Direct link to The Constraint That Made the Decision" title="Direct link to The Constraint That Made the Decision" translate="no">​</a></h2>
<p>Choosing a Kubernetes distribution for this cluster was not a philosophical debate. The hardware made the decision for me.</p>
<p>The cluster includes a <strong>MacBook Pro 13" (late 2012)</strong> — an Intel Core i5-3210M (dual-core, 2012 vintage), 8 GB DDR3 RAM. That machine became <code>swift-mac</code>, running Ubuntu 22.04 as a Longhorn storage worker. The MacBook cannot be provisioned via PXE (Apple's EFI firmware does not support network boot), so Ubuntu was installed manually from a USB drive. After that, it joins the cluster exactly like any other node.</p>
<p>If the MacBook can run a k3s agent without being starved of RAM, any node in this cluster can. That is the selection criterion.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-options-and-why-they-fell-short">The Options and Why They Fell Short<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#the-options-and-why-they-fell-short" class="hash-link" aria-label="Direct link to The Options and Why They Fell Short" title="Direct link to The Options and Why They Fell Short" translate="no">​</a></h2>
<table><thead><tr><th>Distribution</th><th>Why not</th></tr></thead><tbody><tr><td><strong>kubeadm</strong></td><td>The "official" method — but it requires you to install containerd, a CNI plugin, and etcd separately before you can even initialise the control plane. The control plane alone consumes 2 GB+ at idle. Too heavy, too many moving parts, 40 pages of documentation before hello world.</td></tr><tr><td><strong>minikube / kind</strong></td><td>Single-node, designed for local development and CI runners. Cannot form a real multi-node bare-metal cluster.</td></tr><tr><td><strong>microk8s</strong></td><td>Snap-dependent. Hard-coupled to Ubuntu's package manager, non-trivial overhead from the snap runtime, less portable across distros.</td></tr><tr><td><strong>RKE2</strong></td><td>Rancher's hardened distribution — CIS-compliant by default, excellent for regulated enterprise production. More resource-intensive than k3s and over-engineered for a homelab. Worth revisiting if a second cluster is ever built to enterprise spec.</td></tr><tr><td><strong>k0s</strong></td><td>Comparable in weight to k3s, but the ecosystem was less mature when this project started — fewer community examples, less tooling, less documentation.</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-k3s">Why k3s<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#why-k3s" class="hash-link" aria-label="Direct link to Why k3s" title="Direct link to Why k3s" translate="no">​</a></h2>
<p>k3s wins on four criteria that actually matter for this hardware:</p>
<p><strong>1. Single binary, everything included.</strong><br>
<!-- -->containerd, CoreDNS, flannel (CNI), kube-proxy, and a local path provisioner are all bundled into one ~70 MB binary. There is nothing to install separately, nothing to version-pin across multiple packages, nothing to break in a gap between component versions.</p>
<p><strong>2. Minimal memory footprint.</strong><br>
<!-- -->The k3s control plane starts at around 300 MB of RAM on a quiet cluster. The MacBook Pro's 8 GB is not a ceiling — it is headroom. Under load, the same node runs Longhorn replicas, system daemonsets, and a k3s agent without being starved.</p>
<p><strong>3. CNCF-certified Kubernetes.</strong><br>
<!-- -->This is the argument that matters for a portfolio. k3s exposes exactly the same APIs as GKE, EKS, and AKS. Every concept learned here — Deployments, Services, PersistentVolumes, RBAC, Admission Webhooks — transfers directly to managed cloud Kubernetes. This is not a homelab toy; it is Kubernetes, stripped of the components that are irrelevant at this scale.</p>
<p><strong>4. Rolling upgrades with zero manual steps.</strong><br>
<!-- -->Once <a href="https://github.com/rancher/system-upgrade-controller" target="_blank" rel="noopener noreferrer" class="">system-upgrade-controller</a> is deployed, upgrading the entire cluster is a single YAML change: update the <code>version:</code> field in the Plan manifest and commit. The controller handles cordon → drain → upgrade → uncordon on each node, server before agents. The cluster was upgraded from v1.33 to v1.36.2+k3s1 this way with zero downtime across five nodes.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-installation">The Installation<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#the-installation" class="hash-link" aria-label="Direct link to The Installation" title="Direct link to The Installation" translate="no">​</a></h2>
<p>The four ThinkPad cluster nodes (set-hog, fast-skunk, fast-heron, star-kitten) were already running Ubuntu 22.04 LTS, provisioned by MAAS. <code>swift-mac</code> had Ubuntu installed manually. From there, the install is three steps.</p>
<p><strong>Step 1 — Control plane on <code>set-hog</code> (10.0.0.2):</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">ssh ubuntu@10.0.0.2</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">curl -sfL https://get.k3s.io | sh -</span><br></div></code></pre></div></div>
<p>The script detects the architecture, downloads the single binary, registers a systemd unit, and starts the k3s server. The full API server, scheduler, controller-manager, and embedded etcd are up within 30 seconds.</p>
<p><strong>Step 2 — Retrieve the join token:</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">sudo cat /var/lib/rancher/k3s/server/node-token</span><br></div></code></pre></div></div>
<p><strong>Step 3 — Join each worker (fast-skunk, fast-heron, star-kitten, swift-mac):</strong></p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">curl -sfL https://get.k3s.io | \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  K3S_URL=https://10.0.0.2:6443 \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  K3S_TOKEN=&lt;token&gt; \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  sh -</span><br></div></code></pre></div></div>
<p>Four SSH sessions. Four curl commands. The cluster appears in <code>kubectl get nodes</code> within seconds of each join.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">NAME          STATUS   ROLES                  AGE   VERSION</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">set-hog       Ready    control-plane,master   5m    v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">fast-skunk    Ready    &lt;none&gt;                 4m    v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">fast-heron    Ready    &lt;none&gt;                 3m    v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">star-kitten   Ready    &lt;none&gt;                 2m    v1.36.2+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">swift-mac     Ready    &lt;none&gt;                 1m    v1.36.2+k3s1</span><br></div></code></pre></div></div>
<p>The <code>swift-mac</code> node joined over the Tailscale mesh (the MAAS controller acts as NAT). Apple's SMC does not support Wake-on-AC, so <code>swift-mac</code> does not auto-start after a power failure — every other node does. That is the only infrastructure asymmetry introduced by the hardware.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-analogy">The Analogy<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#the-analogy" class="hash-link" aria-label="Direct link to The Analogy" title="Direct link to The Analogy" translate="no">​</a></h2>
<p>The relationship between kubeadm and k3s is the same as the relationship between manually installing a Linux server package by package versus using MAAS to provision it. The outcome is identical. The path is radically different. Kubeadm gives you maximum control over every component. k3s gives you a working cluster you can build on immediately.</p>
<p>For a project where the goal is to demonstrate platform engineering skills — not to demonstrate ability to configure etcd from scratch — k3s is the correct choice. The cluster is now in its 75th operational phase. The distribution has never been the bottleneck.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="automating-it-with-ansible">Automating It with Ansible<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#automating-it-with-ansible" class="hash-link" aria-label="Direct link to Automating It with Ansible" title="Direct link to Automating It with Ansible" translate="no">​</a></h2>
<p>Four SSH sessions is fine for a one-time bootstrap. But after the cluster was up and <code>minicloud-ansible</code> was established as the automation layer, the natural next step was to write a playbook that can reproduce the full install from scratch — so the next cluster rebuild takes one command, not four.</p>
<p>The playbook lives at <code>playbooks/install-k3s.yml</code> in <a href="https://github.com/KanmegneTabouguie/minicloud-ansible" target="_blank" rel="noopener noreferrer" class="">minicloud-ansible</a>. It has three plays:</p>
<p><strong>Play 1 — Control plane (<code>set-hog</code>):</strong><br>
<!-- -->Installs the k3s server, waits for port 6443 to be ready, waits for the node to reach <code>Ready</code> state, then reads the join token into an Ansible variable.</p>
<p><strong>Play 2 — Workers (<code>fast-skunk</code>, <code>fast-heron</code>, <code>star-kitten</code>, <code>swift-mac</code>):</strong><br>
<!-- -->Joins one worker at a time (<code>serial: 1</code>) using the token fetched from <code>hostvars</code>. Each worker must be <code>Ready</code> before the next one starts.</p>
<p><strong>Play 3 — Kubeconfig:</strong><br>
<!-- -->Fetches <code>/etc/rancher/k3s/k3s.yaml</code> from the control plane, patches the server address from <code>127.0.0.1</code> to the real IP, and renames the context to <code>minicloud</code>. Saves the result to <code>/tmp/minicloud.yaml</code> on the Ansible controller.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Dry run</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ansible-playbook playbooks/install-k3s.yml --check</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Full install (pins to current cluster version)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ansible-playbook playbooks/install-k3s.yml</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Pin a different version</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ansible-playbook playbooks/install-k3s.yml -e k3s_version=v1.37.0+k3s1</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Workers only (control plane already running)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">ansible-playbook playbooks/install-k3s.yml --tags workers</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># After the playbook — copy kubeconfig to the controller</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">scp /tmp/minicloud.yaml controller:~/.kube/minicloud.yaml</span><br></div></code></pre></div></div>
<p>The playbook is <strong>idempotent</strong> — it checks for <code>/usr/local/bin/k3s</code> before installing. Re-running on an existing cluster skips the install tasks and only re-validates the <code>Ready</code> state.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-the-install-wasnt-automated-from-day-one">Why the install wasn't automated from day one<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#why-the-install-wasnt-automated-from-day-one" class="hash-link" aria-label="Direct link to Why the install wasn't automated from day one" title="Direct link to Why the install wasn't automated from day one" translate="no">​</a></h3>
<p>Two reasons. First, the k3s install is a Day-0 operation — it runs once per cluster lifetime. The effort of writing and testing a playbook outweighed the cost of four SSH commands. Second, <code>swift-mac</code> cannot be PXE-booted, so Ubuntu was installed manually via USB regardless. As long as one step is manual, the whole bootstrap sequence is effectively manual for that node.</p>
<p>What was automated from day one was the part that actually repeats: <code>system-upgrade-controller</code> handles every future k3s version bump as a single YAML commit. The Ansible playbook covers the edge case — rebuild from scratch — which is worth automating even if it only happens once or twice in the cluster's lifetime.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-comes-next">What Comes Next<a href="https://docs.devandre.sbs/blog/k3s-why-lightweight-kubernetes-bare-metal#what-comes-next" class="hash-link" aria-label="Direct link to What Comes Next" title="Direct link to What Comes Next" translate="no">​</a></h2>
<p>With five nodes running k3s, the next layer is networking and load balancing: MetalLB for bare-metal <code>LoadBalancer</code> services, a wildcard ingress controller, and a private CA so every internal service gets real TLS. That is covered in the next post.</p>
<hr>
<p><em>The full runbooks for every phase, including the exact cloud-init templates used for MAAS provisioning, live in the <a class="" href="https://docs.devandre.sbs/platform/platform-roadmap/roadmap-overview">Documentation</a> section.</em></p>]]></content:encoded>
            <category>kubernetes</category>
            <category>k3s</category>
            <category>bare-metal</category>
            <category>platform-engineering</category>
            <category>devops</category>
            <category>homelab</category>
        </item>
        <item>
            <title><![CDATA[LLMs on Bare Metal: Quantization, SLMs, and Replacing phi4-mini with Qwen 2.5 7B]]></title>
            <link>https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving</link>
            <guid>https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving</guid>
            <pubDate>Thu, 16 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How we think about model size, quantization formats, and inference tuning for a 5-node CPU-only k3s cluster — and why we replaced phi4-mini with Qwen 2.5 7B Q4_K_M.]]></description>
            <content:encoded><![CDATA[<p>Running LLMs on bare-metal CPU hardware forces you to understand the numbers behind model files. This post documents how we reason about model size, quantization, and inference serving on minicloud — and the concrete change we made: replacing phi4-mini with Qwen 2.5 7B across all three Ollama instances.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-7b-actually-means">What "7B" Actually Means<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#what-7b-actually-means" class="hash-link" aria-label="Direct link to What &quot;7B&quot; Actually Means" title="Direct link to What &quot;7B&quot; Actually Means" translate="no">​</a></h2>
<p>The "7B" in a model name is the number of parameters — floating-point weights stored in the neural network. Each parameter holds learned knowledge from training. More parameters generally means better reasoning, broader knowledge, and fewer hallucinations on complex tasks.</p>
<p>The catch: more parameters means more RAM.</p>
<table><thead><tr><th>Size</th><th>RAM at FP32 (raw)</th><th>Typical use</th></tr></thead><tbody><tr><td>1–3B</td><td>4–12 GB</td><td>Edge, mobile, very constrained hardware</td></tr><tr><td>7B</td><td>28 GB</td><td>The quality/resource sweet spot</td></tr><tr><td>13B</td><td>52 GB</td><td>Good reasoning, feasible on 48 GB GPU</td></tr><tr><td>30–34B</td><td>~120 GB</td><td>Multi-GPU or quantized on 24 GB</td></tr><tr><td>70B</td><td>280 GB</td><td>High-end multi-GPU or cloud</td></tr></tbody></table>
<p>Our cluster has no dedicated GPU — swift-mac has 8 GB RAM, ThinkPad workers have 16–32 GB. At FP32, even a 7B model is out of reach. This is where quantization becomes essential.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="quantization--why-it-changes-everything">Quantization — Why It Changes Everything<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#quantization--why-it-changes-everything" class="hash-link" aria-label="Direct link to Quantization — Why It Changes Everything" title="Direct link to Quantization — Why It Changes Everything" translate="no">​</a></h2>
<p>One FP32 parameter = 4 bytes. Quantization represents the same weight with fewer bits, accepting a small precision loss in exchange for dramatically lower memory usage.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">FP32   → 4 bytes/param  → 7B model = 28 GB   (baseline)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">FP16   → 2 bytes/param  → 7B model = 14 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q8_0   → 1 byte/param   → 7B model =  7 GB</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q4_K_M → ~0.5 bytes/param → 7B model = 4.1 GB  ← most popular</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Q2_K   → ~0.25 bytes/param → 7B model = 2.7 GB  (notable quality loss)</span><br></div></code></pre></div></div>
<p>The quality loss from Q4_K_M vs FP16 is measurable on benchmarks but imperceptible in practical use for chat and RAG. Q2 and Q3 are a different story — avoid them for anything that requires accurate reasoning.</p>
<p><strong>Rule of thumb:</strong> step down one quantization level before stepping down to a smaller model. A 7B Q4 beats a 3B Q8 on almost every task.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-format-zoo">The Format Zoo<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#the-format-zoo" class="hash-link" aria-label="Direct link to The Format Zoo" title="Direct link to The Format Zoo" translate="no">​</a></h3>
<p>You'll encounter four main formats depending on your runtime:</p>
<ul>
<li class=""><strong>GGUF</strong> (llama.cpp / Ollama) — CPU-first format with optional GPU offloading. Suffixes like <code>Q4_K_M</code>, <code>Q5_K_M</code>, <code>Q8_0</code> tell you the quantization level. This is what Ollama uses.</li>
<li class=""><strong>GPTQ</strong> — GPU-oriented post-training quantization. Better than GGUF if you have sufficient VRAM.</li>
<li class=""><strong>AWQ</strong> — Activation-aware Weight Quantization. Better quality than GPTQ at the same size, increasingly standard.</li>
<li class=""><strong>EXL2</strong> — ExLlamaV2 format, very efficient for GPU batch inference.</li>
</ul>
<p>For a CPU-only or CPU-primary cluster: GGUF Q4_K_M is your format.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="slm-candidates--the-real-options-under-8b">SLM Candidates — The Real Options Under 8B<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#slm-candidates--the-real-options-under-8b" class="hash-link" aria-label="Direct link to SLM Candidates — The Real Options Under 8B" title="Direct link to SLM Candidates — The Real Options Under 8B" translate="no">​</a></h2>
<p>Small Language Models (≤7B) have caught up dramatically since 2024. These are the relevant ones for a constrained inference cluster:</p>
<table><thead><tr><th>Model</th><th>Size</th><th>Strengths</th><th>Best for</th></tr></thead><tbody><tr><td>phi4-mini (Microsoft)</td><td>3.8B</td><td>Strong reasoning for its size</td><td>RAG, factual Q&amp;A — we had it running</td></tr><tr><td>Llama 3.2 3B</td><td>3B</td><td>Good instruct, multilingual</td><td>Chat, summarization</td></tr><tr><td>Llama 3.1 8B</td><td>8B</td><td>Quality reference for 7-8B</td><td>General purpose</td></tr><tr><td>Gemma 3 4B</td><td>4B</td><td>Excellent code + instruction following</td><td>Code assistant</td></tr><tr><td>Mistral 7B v0.3</td><td>7B</td><td>Strong French natively, long context</td><td>French-speaking users</td></tr><tr><td>Qwen 2.5 7B</td><td>7B</td><td>Top-ranked 7B on recent benchmarks</td><td>General purpose — our choice</td></tr><tr><td>deepseek-r1 7B (distilled)</td><td>7B</td><td>Chain-of-thought reasoning</td><td>Analytical tasks</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-we-replaced-phi4-mini">Why We Replaced phi4-mini<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#why-we-replaced-phi4-mini" class="hash-link" aria-label="Direct link to Why We Replaced phi4-mini" title="Direct link to Why We Replaced phi4-mini" translate="no">​</a></h2>
<p>phi4-mini isn't a bad model — Microsoft did good work on reasoning at 3.8B. But it has two structural limits:</p>
<p><strong>3.8B is the quality ceiling.</strong> At 3.8B parameters, the model has less "memory" of training patterns. It hallucinates more on precise facts, multi-step reasoning degrades faster, and complex instruction following is less reliable than a 7B.</p>
<p><strong>The market moved.</strong> In 2024–2025, 7B models became what 13B models were in 2023. Qwen 2.5 7B in particular outperforms phi4-mini on nearly every benchmark while fitting in the same RAM constraint once quantized.</p>
<p>The comparison that made the decision clear:</p>
<table><thead><tr><th>Model</th><th>MMLU</th><th>HumanEval</th><th>French</th><th>RAM at Q4_K_M</th></tr></thead><tbody><tr><td>phi4-mini 3.8B</td><td>69%</td><td>62%</td><td>Passable</td><td>2.5 GB</td></tr><tr><td>Mistral 7B v0.3</td><td>64%</td><td>45%</td><td>Native</td><td>4.1 GB</td></tr><tr><td>Llama 3.1 8B</td><td>73%</td><td>72%</td><td>Good</td><td>4.7 GB</td></tr><tr><td><strong>Qwen 2.5 7B</strong></td><td><strong>75%</strong></td><td><strong>83%</strong></td><td><strong>Excellent</strong></td><td><strong>4.5 GB</strong></td></tr></tbody></table>
<p>Qwen 2.5 is natively trained on 29 languages including French. For French-speaking end users interacting with Open WebUI, that's a direct advantage over Llama.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-metrics-actually-matter-for-inference-serving">What Metrics Actually Matter for Inference Serving<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#what-metrics-actually-matter-for-inference-serving" class="hash-link" aria-label="Direct link to What Metrics Actually Matter for Inference Serving" title="Direct link to What Metrics Actually Matter for Inference Serving" translate="no">​</a></h2>
<p>Three metrics to optimize, depending on the use case:</p>
<p><strong>Time To First Token (TTFT)</strong> — latency before the user sees the first word. Critical for interactive chat. Smaller models win here. Groq's LPU hardware achieves TTFT &lt; 200ms even on 8B models.</p>
<p><strong>Tokens per second (throughput)</strong> — generation speed. GPU &gt;&gt; CPU. On CPU, phi4-mini Q4 generates ~15 tok/s on a ThinkPad, Llama 3.1 8B ~6 tok/s.</p>
<p><strong>Concurrency</strong> — how many simultaneous users. Ollama handles one request at a time per instance by default. For multi-user, you need multiple instances (we have three) or a batching server like vLLM.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="decision-matrix">Decision Matrix<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#decision-matrix" class="hash-link" aria-label="Direct link to Decision Matrix" title="Direct link to Decision Matrix" translate="no">​</a></h3>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">User expects response in &lt; 2s?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├── Yes → Groq (cloud LPU) or phi4-mini local Q4</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── No  → Llama 3.1 8B Q4 or Qwen 2.5 7B Q4</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Task requires reasoning (math, analysis)?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├── Yes → deepseek-r1 distill or phi4-mini (strong on reasoning)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── No  → Mistral 7B or Llama 3.2 3B (faster, cheaper)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">French-speaking users?</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">├── Yes → Mistral 7B (native FR) or Llama 3.1 8B (solid multilingual)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">└── No  → Qwen 2.5 7B or Gemma 3 4B</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="tuning-ollama-for-cpu-inference">Tuning Ollama for CPU Inference<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#tuning-ollama-for-cpu-inference" class="hash-link" aria-label="Direct link to Tuning Ollama for CPU Inference" title="Direct link to Tuning Ollama for CPU Inference" translate="no">​</a></h2>
<p>Beyond the model choice, there are several environment variables that have immediate impact.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="keep-the-model-loaded">Keep the Model Loaded<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#keep-the-model-loaded" class="hash-link" aria-label="Direct link to Keep the Model Loaded" title="Direct link to Keep the Model Loaded" translate="no">​</a></h3>
<p>The most impactful single change: set <code>OLLAMA_KEEP_ALIVE=-1</code> so the model is never unloaded from RAM. Without this, Ollama evicts the model after 5 minutes of inactivity — the next request pays a 3–5 second cold start penalty while the model reloads.</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">env</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_KEEP_ALIVE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"-1"</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="flash-attention">Flash Attention<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#flash-attention" class="hash-link" aria-label="Direct link to Flash Attention" title="Direct link to Flash Attention" translate="no">​</a></h3>
<p>Reduces KV cache memory usage and speeds up the attention computation:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_FLASH_ATTENTION</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"1"</span><br></div></code></pre></div></div>
<p>Gain: ~15–20% less RAM, ~10% faster on longer contexts.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="context-window--the-most-underrated-lever">Context Window — the Most Underrated Lever<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#context-window--the-most-underrated-lever" class="hash-link" aria-label="Direct link to Context Window — the Most Underrated Lever" title="Direct link to Context Window — the Most Underrated Lever" translate="no">​</a></h3>
<p>Ollama defaults to loading the model's maximum context window (128k for Qwen 2.5). The KV cache grows linearly with context length. For standard chat, you don't need 128k tokens.</p>
<p>Forcing <code>num_ctx=4096</code> in the LiteLLM params:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">litellm_params</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">model</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> ollama/qwen2.5</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">7b</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">instruct</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">api_base</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> http</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//ollama.ai.svc.cluster.local</span><span class="token punctuation" style="color:#393A34">:</span><span class="token number" style="color:#36acaa">11434</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">num_ctx</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token number" style="color:#36acaa">4096</span><br></div></code></pre></div></div>
<p>Impact: going from <code>num_ctx=32768</code> to <code>num_ctx=4096</code> can <strong>double throughput</strong> on CPU by reducing the amount of memory the model reads per token generation step.</p>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="cpu-threads--align-with-physical-cores">CPU Threads — Align With Physical Cores<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#cpu-threads--align-with-physical-cores" class="hash-link" aria-label="Direct link to CPU Threads — Align With Physical Cores" title="Direct link to CPU Threads — Align With Physical Cores" translate="no">​</a></h3>
<p>Ollama uses all available cores by default, but hyperthreading can hurt inference (two logical threads on the same physical core compete for the same ALU). Set threads to physical core count:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_NUM_THREADS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"6"</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># physical cores, not logical — avoids hyperthreading overhead</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="parallelism-and-loaded-models">Parallelism and Loaded Models<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#parallelism-and-loaded-models" class="hash-link" aria-label="Direct link to Parallelism and Loaded Models" title="Direct link to Parallelism and Loaded Models" translate="no">​</a></h3>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_NUM_PARALLEL</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"4"</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># max concurrent requests per instance</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_MAX_LOADED_MODELS</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2"</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># keep at most 2 models in RAM simultaneously</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> OLLAMA_KV_CACHE_TYPE</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">value</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"q8_0"</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># quantize the KV cache itself — saves RAM during long conversations</span><br></div></code></pre></div></div>
<h3 class="anchor anchorTargetStickyNavbar_Vzrq" id="summary-what-each-tuning-gains">Summary: What Each Tuning Gains<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#summary-what-each-tuning-gains" class="hash-link" aria-label="Direct link to Summary: What Each Tuning Gains" title="Direct link to Summary: What Each Tuning Gains" translate="no">​</a></h3>
<table><thead><tr><th>Optimization</th><th>Estimated gain on ThinkPad CPU</th></tr></thead><tbody><tr><td><code>OLLAMA_KEEP_ALIVE=-1</code></td><td>−3–5s cold start per request</td></tr><tr><td><code>num_ctx: 4096</code> instead of 32k</td><td>×1.8–2× tokens/s</td></tr><tr><td><code>OLLAMA_FLASH_ATTENTION=1</code></td><td>−15–20% RAM, +10% speed</td></tr><tr><td><code>OLLAMA_NUM_THREADS=6</code> (physical cores)</td><td>+5–10% stability under load</td></tr><tr><td>3 LiteLLM load-balanced instances</td><td>×3 simultaneous users</td></tr><tr><td>phi4-mini → Qwen 2.5 7B Q4</td><td>+15–20% quality on benchmarks</td></tr></tbody></table>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-we-actually-did-on-minicloud">What We Actually Did on minicloud<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#what-we-actually-did-on-minicloud" class="hash-link" aria-label="Direct link to What We Actually Did on minicloud" title="Direct link to What We Actually Did on minicloud" translate="no">​</a></h2>
<p>All three Ollama instances (<code>ollama</code>, <code>ollama-secondary</code>, <code>ollama-tertiary</code> in the <code>ai</code> namespace) already had all the environment variables set from a previous tuning session. The only missing piece was the model itself.</p>
<p>The model pull from inside a pod was blocked: the default-deny-egress NetworkPolicy and a routing difference between pod-level and node-level IPv4 traffic to Cloudflare R2 caused <code>connection refused</code> on <code>172.64.66.x:443</code>. The node itself could reach the registry fine, but the CNI (flannel) traffic path from pod IPs didn't work the same way.</p>
<p><strong>Workaround used:</strong> temporarily patched <code>hostNetwork: true</code> on all three deployments. This makes the pod use the node's network namespace directly, bypassing CNI. The node can reach registry.ollama.ai — so the pull works.</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain"># Add hostNetwork temporarily</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl patch deployment/ollama deployment/ollama-secondary deployment/ollama-tertiary \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -n ai --type=json \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -p '[{"op":"add","path":"/spec/template/spec/hostNetwork","value":true}]'</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Pull the model (4.7 GB per instance)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama -- ollama pull qwen2.5:7b-instruct-q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama-secondary -- ollama pull qwen2.5:7b-instruct-q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl exec -n ai deployment/ollama-tertiary -- ollama pull qwen2.5:7b-instruct-q4_k_m</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># Remove hostNetwork — pods restart with normal CNI networking</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">kubectl patch deployment/ollama deployment/ollama-secondary deployment/ollama-tertiary \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -n ai --type=json \</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  -p '[{"op":"remove","path":"/spec/template/spec/hostNetwork"}]'</span><br></div></code></pre></div></div>
<p>The model files are stored on a PVC, so they persist across pod restarts. After removing <code>hostNetwork</code>, all three instances came back up with <code>qwen2.5:7b-instruct-q4_k_m</code> cached locally — and LiteLLM started routing to it immediately.</p>
<p>The underlying networking issue (pod-to-Cloudflare IPv4 path via flannel) is a known limitation. <strong>Phase 76 will replace flannel with Cilium</strong>, which adds FQDN-based egress policies and Hubble observability — making this kind of debugging trivial next time.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whats-next">What's Next<a href="https://docs.devandre.sbs/blog/llm-slm-quantization-inference-serving#whats-next" class="hash-link" aria-label="Direct link to What's Next" title="Direct link to What's Next" translate="no">​</a></h2>
<p>With Qwen 2.5 7B running on all three instances and LiteLLM routing traffic via least-busy, the AI stack is:</p>
<ul>
<li class=""><strong>phi3-financial pipeline</strong>: Groq <code>llama-3.1-8b-instant</code> as primary (LPU-fast), Qwen 2.5 7B ×3 as local fallback</li>
<li class=""><strong>Open WebUI chat</strong>: Qwen 2.5 7B for general use, deepseek-r1 7B for reasoning tasks</li>
<li class=""><strong>RAG ingest</strong>: <code>nomic-embed-text</code> for embeddings (unchanged)</li>
</ul>
<p>The speculative decoding optimization (a small draft model pre-generates tokens that the main model verifies) is available in Ollama v0.5+ and could push throughput 2–3× further on predictable outputs. That's the next tuning frontier once this setup is stable.</p>]]></content:encoded>
            <category>ai</category>
            <category>llm</category>
            <category>ollama</category>
            <category>litellm</category>
            <category>kubernetes</category>
            <category>inference</category>
            <category>quantization</category>
            <category>mlops</category>
        </item>
        <item>
            <title><![CDATA[Automating ConfigMap Reloads: Why We Added Stakater Reloader]]></title>
            <link>https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader</link>
            <guid>https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader</guid>
            <pubDate>Thu, 16 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[Kubernetes does not automatically restart pods when a mounted ConfigMap changes — especially when using subPath mounts. We added Stakater Reloader to eliminate manual kubectl rollout restart calls across Homer, LiteLLM, SearXNG, and Backstage. Here's the problem, the fix, and a bonus ArgoCD OOMKill investigation we uncovered along the way.
]]></description>
            <content:encoded><![CDATA[<p>Every time I updated the Homer dashboard config, I had to run <code>kubectl rollout restart deployment/homer -n homer</code> after ArgoCD finished syncing. Same for LiteLLM when routing changed. Same for Backstage after any catalog or proxy update. The pattern was identical every time: push to git, wait for ArgoCD sync, then manually trigger a pod restart.</p>
<p>That is an operational smell. If git is the only write path, the restart should be automatic too.</p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-kubernetes-doesnt-auto-reload-configmaps">Why Kubernetes Doesn't Auto-Reload ConfigMaps<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#why-kubernetes-doesnt-auto-reload-configmaps" class="hash-link" aria-label="Direct link to Why Kubernetes Doesn't Auto-Reload ConfigMaps" title="Direct link to Why Kubernetes Doesn't Auto-Reload ConfigMaps" translate="no">​</a></h2>
<p>Kubernetes <em>does</em> update ConfigMap data in-place — but only for volume mounts that use the full directory. When you mount a ConfigMap with <code>subPath</code> (mounting a single file rather than the whole directory), Kubernetes <a href="https://kubernetes.io/docs/concepts/configuration/configmap/#mounted-configmaps-are-updated-automatically" target="_blank" rel="noopener noreferrer" class="">intentionally skips the automatic update</a>.</p>
<p>Homer mounts its config with <code>subPath</code>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">volumeMounts</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">mountPath</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> /www/assets/config.yml</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> config</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">subPath</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> config.yml   </span><span class="token comment" style="color:#999988;font-style:italic"># ← this disables automatic propagation</span><br></div></code></pre></div></div>
<p>This is by design. <code>subPath</code> gives you fine-grained control over where a file lands inside a container, but it breaks the inotify watch that Kubernetes would otherwise use to propagate ConfigMap updates. The file the pod sees is frozen at mount time.</p>
<p>The common workaround — which I had in place — is a manual annotation bump on the pod template:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">config-checksum</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"v17-star-kitten-polaris"</span><span class="token plain">  </span><span class="token comment" style="color:#999988;font-style:italic"># bump this manually after every config change</span><br></div></code></pre></div></div>
<p>Changing the annotation forces a new pod-template-hash, which triggers a rolling restart. But this is noise: it clutters the git history, it's easy to forget, and it has nothing to do with the actual change being made.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-broader-pattern">The Broader Pattern<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#the-broader-pattern" class="hash-link" aria-label="Direct link to The Broader Pattern" title="Direct link to The Broader Pattern" translate="no">​</a></h2>
<p>It wasn't just Homer. Every ConfigMap-backed deployment in the cluster had the same problem:</p>
<table><thead><tr><th>Deployment</th><th>ConfigMaps</th><th>Required action after change</th></tr></thead><tbody><tr><td><code>homer</code></td><td><code>homer-config</code></td><td>Manual <code>kubectl rollout restart</code></td></tr><tr><td><code>litellm</code></td><td><code>litellm-config</code>, <code>langfuse-prompt-handler</code>, <code>phi3-financial-prompt</code></td><td>Manual <code>kubectl rollout restart</code></td></tr><tr><td><code>searxng</code></td><td><code>searxng-config</code></td><td>Manual <code>kubectl rollout restart</code></td></tr><tr><td><code>backstage</code></td><td><code>backstage-app-config</code>, <code>backstage-session-config</code></td><td>Manual <code>kubectl rollout restart</code></td></tr></tbody></table>
<p>The CLAUDE.md even had a note reminding me to run the restart after every Backstage config push. That note existing is the problem — if a human has to remember to do something after a git push, it will eventually be forgotten.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-fix-stakater-reloader">The Fix: Stakater Reloader<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#the-fix-stakater-reloader" class="hash-link" aria-label="Direct link to The Fix: Stakater Reloader" title="Direct link to The Fix: Stakater Reloader" translate="no">​</a></h2>
<p><a href="https://github.com/stakater/reloader" target="_blank" rel="noopener noreferrer" class="">Stakater Reloader</a> is a Kubernetes controller that watches ConfigMaps and Secrets, and triggers rolling restarts on any Deployment (or StatefulSet, DaemonSet) that opts in via a single annotation.</p>
<p>The deployment is a single Helm chart in its own namespace:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># apps/reloader.yaml</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">sources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">repoURL</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> https</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">//stakater.github.io/stakater</span><span class="token punctuation" style="color:#393A34">-</span><span class="token plain">charts</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">chart</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> reloader</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">targetRevision</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"2.2.14"</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># app v1.4.19</span><br></div></code></pre></div></div>
<p>And opting in is one line on any Deployment metadata:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">reloader.stakater.com/auto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></div></code></pre></div></div>
<p>Reloader detects all ConfigMaps and Secrets referenced by the Deployment (via <code>volumes</code>, <code>envFrom</code>, and <code>env.valueFrom</code>) and watches them. When ArgoCD syncs a ConfigMap change, Reloader sees the update within seconds and triggers a rolling restart automatically.</p>
<p>The flow is now fully automated:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">git push → ArgoCD syncs ConfigMap → Reloader detects change → pod rolling restart</span><br></div></code></pre></div></div>
<p>No human step. No annotation bump. No runbook entry reminding you to remember.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="removing-the-manual-workaround">Removing the Manual Workaround<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#removing-the-manual-workaround" class="hash-link" aria-label="Direct link to Removing the Manual Workaround" title="Direct link to Removing the Manual Workaround" translate="no">​</a></h2>
<p>With Reloader installed, the <code>config-checksum</code> annotation in Homer's deployment was noise:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token comment" style="color:#999988;font-style:italic"># before — manual workaround</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">config-checksum</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"v17-star-kitten-polaris"</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain" style="display:inline-block"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token comment" style="color:#999988;font-style:italic"># after — clean</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"></span><span class="token key atrule" style="color:#00a4db">template</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">labels</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">app</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> homer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">      </span><span class="token key atrule" style="color:#00a4db">backstage.io/kubernetes-id</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> homer</span><br></div></code></pre></div></div>
<p>The deployment metadata gets the Reloader annotation instead:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">metadata</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">name</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> homer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">namespace</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> homer</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">annotations</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">reloader.stakater.com/auto</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token string" style="color:#e3116c">"true"</span><br></div></code></pre></div></div>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="a-bonus-investigation-argocd-oomkills">A Bonus Investigation: ArgoCD OOMKills<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#a-bonus-investigation-argocd-oomkills" class="hash-link" aria-label="Direct link to A Bonus Investigation: ArgoCD OOMKills" title="Direct link to A Bonus Investigation: ArgoCD OOMKills" translate="no">​</a></h2>
<p>While implementing Reloader, I noticed the ArgoCD application controller was in CrashLoopBackOff — 183 restarts over 44 hours:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">argo-cd-argocd-application-controller-0   0/1   CrashLoopBackOff   183 (4m ago)   44h</span><br></div></code></pre></div></div>
<p>This explained why syncs were taking forever and why Reloader itself couldn't complete its initial sync. The exit code was 137 — <code>SIGKILL</code> from the OOM killer:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Last State: Terminated</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  Reason:    OOMKilled</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  Exit Code: 137</span><br></div></code></pre></div></div>
<p>The controller had a 1Gi memory limit, set when the cluster managed about 10 applications. It now manages ~40, including multi-source Helm applications with large manifests (Harbor, Authentik, kube-prometheus-stack). The reconciliation loop for 40 apps simply exceeded 1Gi.</p>
<p>The fix is in <code>helm-values/argocd-values.yaml</code>:</p>
<div class="language-yaml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-yaml codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token key atrule" style="color:#00a4db">controller</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">  </span><span class="token key atrule" style="color:#00a4db">resources</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">requests</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">cpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 100m</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 512Mi </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain"></span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">    </span><span class="token key atrule" style="color:#00a4db">limits</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain">   </span><span class="token punctuation" style="color:#393A34">{</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">cpu</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 1000m</span><span class="token punctuation" style="color:#393A34">,</span><span class="token plain"> </span><span class="token key atrule" style="color:#00a4db">memory</span><span class="token punctuation" style="color:#393A34">:</span><span class="token plain"> 2Gi </span><span class="token punctuation" style="color:#393A34">}</span><span class="token plain">   </span><span class="token comment" style="color:#999988;font-style:italic"># was 1Gi</span><br></div></code></pre></div></div>
<p>Applied immediately via <code>kubectl patch statefulset</code> without waiting for ArgoCD to self-sync (it couldn't, since the controller was the one crashing). After the patch, the controller came up clean: <code>1/1 Running 0</code>.</p>
<p>The lesson: ArgoCD controller memory scales with the number of applications and the complexity of their manifests. If you're adding many Helm apps, keep an eye on it. A <code>CrashLoopBackOff</code> on the application controller means nothing syncs — it's the most critical pod in the cluster after the API server.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whats-deployed">What's Deployed<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#whats-deployed" class="hash-link" aria-label="Direct link to What's Deployed" title="Direct link to What's Deployed" translate="no">​</a></h2>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Namespace:  reloader</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">App:        reloader (ArgoCD)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Chart:      stakater/reloader 2.2.14 (app v1.4.19)</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Security:   runAsNonRoot, runAsUser 65534, seccompProfile RuntimeDefault,</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">            capabilities.drop ALL, no privilege escalation</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Resources:  10m/32Mi request — 100m/128Mi limit</span><br></div></code></pre></div></div>
<p>Deployments that now auto-reload on ConfigMap change:</p>
<ul>
<li class=""><code>homer</code> — dashboard layout</li>
<li class=""><code>litellm</code> — AI Gateway model routing, prompt handler, financial guardrails</li>
<li class=""><code>searxng</code> — search engine settings</li>
<li class=""><code>backstage</code> — catalog locations, proxy endpoints, auth config</li>
</ul>
<p>Any future deployment that mounts a ConfigMap gets the same behaviour with one annotation line. The pattern scales for free.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="one-gotcha-chart-versioning">One Gotcha: Chart Versioning<a href="https://docs.devandre.sbs/blog/kubernetes-configmap-auto-reload-stakater-reloader#one-gotcha-chart-versioning" class="hash-link" aria-label="Direct link to One Gotcha: Chart Versioning" title="Direct link to One Gotcha: Chart Versioning" translate="no">​</a></h2>
<p>The Stakater Reloader chart version does <strong>not</strong> match the application version. When I first pinned <code>targetRevision: "1.4.3"</code> (matching the app version format), ArgoCD failed:</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">error fetching chart: failed to fetch chart: helm pull --version 1.4.3 --repo https://stakater.github.io/stakater-charts</span><br></div></code></pre></div></div>
<p>The correct version to use is the chart version, found via:</p>
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">helm repo add stakater https://stakater.github.io/stakater-charts</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">helm search repo stakater/reloader</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># NAME                  CHART VERSION   APP VERSION</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain"># stakater/reloader     2.2.14          v1.4.19</span><br></div></code></pre></div></div>
<p>Chart <code>2.2.14</code> = app <code>v1.4.19</code>. Always search before pinning.</p>]]></content:encoded>
            <category>kubernetes</category>
            <category>gitops</category>
            <category>argocd</category>
            <category>platform-engineering</category>
            <category>reloader</category>
            <category>configmap</category>
            <category>devops</category>
        </item>
        <item>
            <title><![CDATA[Platform Engineering on a Budget: Running Production Kubernetes on 5 ThinkPads]]></title>
            <link>https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes</link>
            <guid>https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes</guid>
            <pubDate>Mon, 13 Jul 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[How I built a production-grade Kubernetes platform on five bare-metal ThinkPad laptops — with MAAS provisioning, GitOps, SSO, observability, and AI services — and what I learned about real platform engineering along the way.
]]></description>
            <content:encoded><![CDATA[<p>Most cloud platforms hide the infrastructure from you. MAAS provisioning, PXE boot sequences, NIC bonding, storage backends, certificate chains — all of it abstracted behind a few CLI flags or a dashboard. That abstraction is valuable in production, but it can also keep engineers at arm's length from the system they're supposed to understand deeply.</p>
<p>This project started from a simple question: <strong>what does it actually take to build a production-grade Kubernetes platform from scratch?</strong></p>
<!-- -->
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-setup">The Setup<a href="https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes#the-setup" class="hash-link" aria-label="Direct link to The Setup" title="Direct link to The Setup" translate="no">​</a></h2>
<p>The hardware is five laptops: four Lenovo ThinkPad X390s acting as cluster nodes and a MacBook Pro 2012 running as a storage worker. A fifth ThinkPad X390 runs as the MAAS controller — handling PXE boot, DHCP, DNS, and Tailscale NAT for the entire rack. Total cost: well under a cloud provider's monthly invoice for equivalent compute.</p>
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#393A34;--prism-background-color:#f6f8fa"><div class="codeBlockContent_QJqH"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#393A34;background-color:#f6f8fa"><code class="codeBlockLines_e6Vv"><div class="token-line" style="color:#393A34"><span class="token plain">Controller (MAAS):    ktayl-ThinkPad-X390  — Tailscale endpoint, NAT, kubectl</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Control plane:        set-hog              — k3s master, 10.0.0.2</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">Workers:              fast-skunk           — 10.0.0.4</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                      fast-heron           — 10.0.0.7</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                      star-kitten          — 10.0.0.8</span><br></div><div class="token-line" style="color:#393A34"><span class="token plain">                      swift-mac            — 10.0.0.10 (MacBook Pro 2012, Longhorn storage)</span><br></div></code></pre></div></div>
<p>Every node is provisioned by MAAS via PXE: the controller broadcasts a boot offer, nodes pick it up, and Ubuntu 22.04 is deployed with a pre-seeded cloud-init. That means any node can be wiped and re-provisioned in under 10 minutes — the same discipline you'd apply in a real cloud provider's bare-metal service.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="what-production-grade-actually-means-here">What "Production-Grade" Actually Means Here<a href="https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes#what-production-grade-actually-means-here" class="hash-link" aria-label="Direct link to What &quot;Production-Grade&quot; Actually Means Here" title="Direct link to What &quot;Production-Grade&quot; Actually Means Here" translate="no">​</a></h2>
<p>Running a home lab is easy. Running it like a platform team would run production is a different discipline entirely. The constraints I imposed on myself:</p>
<ul>
<li class=""><strong>No manual <code>kubectl apply</code></strong> — all workloads live in Git and sync via ArgoCD (app-of-apps pattern, Kustomize base+overlays, 3-branch CI promotion flow)</li>
<li class=""><strong>Zero-trust networking</strong> — OPA Gatekeeper admission policies in deny mode across all 23 namespaces, NetworkPolicy enforced everywhere, Vault auto-unseal via AWS KMS</li>
<li class=""><strong>Observability from day one</strong> — Prometheus + Grafana + Loki + Tempo deployed before any application workload; node_exporter on the controller itself so disk alerts fire before MinIO crashes</li>
<li class=""><strong>OIDC SSO on every service</strong> — Authentik as the identity provider, OIDC/PKCE protecting ArgoCD, Grafana, Harbor, Backstage, Open WebUI, and Vaultwarden</li>
<li class=""><strong>Automated regression testing</strong> — 62 checks across infra, GitOps, security, storage, AI, and observability that I run after every significant change</li>
</ul>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="the-things-that-surprised-me">The Things That Surprised Me<a href="https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes#the-things-that-surprised-me" class="hash-link" aria-label="Direct link to The Things That Surprised Me" title="Direct link to The Things That Surprised Me" translate="no">​</a></h2>
<p><strong>Storage is the hardest part of bare metal.</strong> Longhorn on the MacBook Pro 2012 (swift-mac) required hand-tuning mount propagation, replica counts, and scheduling tolerations. When the node goes down unexpectedly — and it does, because Apple's SMC doesn't support Wake-on-AC — Longhorn's replica recovery needs headroom that you only understand by watching it fail twice.</p>
<p><strong>Certificate chains break in non-obvious ways.</strong> I run a private CA (<code>minicloud-ca.crt</code>) for all internal HTTPS endpoints. The macOS System Keychain trusts it, but <code>/opt/anaconda3/bin/curl</code> uses OpenSSL and ignores it silently. Two hours of debugging a Harbor push failure taught me to always check which <code>curl</code> binary is in <code>$PATH</code>.</p>
<p><strong>GitOps and ArgoCD StatefulSet sync have edge cases.</strong> When a StatefulSet's <code>VolumeClaimTemplate</code> is defined without explicit <code>apiVersion</code>, <code>kind</code>, and <code>volumeMode</code>, ArgoCD v3.4.1 perpetually shows a diff — even after sync. The fix is to write the full spec in the manifest; <code>ignoreDifferences</code> doesn't work for these fields.</p>
<p><strong>Velero backup timeouts need tuning per workload.</strong> The default 4-hour <code>itemOperationTimeout</code> on Velero's kopia plugin wasn't enough for a 4.5 GB ClickHouse PV (Langfuse LLM trace data). Kopia transferred ~2.5 GB and then the backup was cancelled. Bumping to 8 hours fixed it — but the lesson is that backup SLOs depend on data size, not just infrastructure configuration.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="whats-running-today">What's Running Today<a href="https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes#whats-running-today" class="hash-link" aria-label="Direct link to What's Running Today" title="Direct link to What's Running Today" translate="no">​</a></h2>
<p>After 35+ phases of incremental build-out, the current platform runs:</p>
<table><thead><tr><th>Service</th><th>Purpose</th></tr></thead><tbody><tr><td>ArgoCD</td><td>GitOps delivery — 8 custom app repos, 23 namespaces</td></tr><tr><td>Harbor</td><td>Private container registry with cosign image signing</td></tr><tr><td>Backstage</td><td>Internal developer portal with catalog, TechDocs, scaffolder</td></tr><tr><td>Authentik</td><td>OIDC/SSO identity provider</td></tr><tr><td>Grafana + Prometheus</td><td>Metrics, dashboards, alerting</td></tr><tr><td>Loki + Tempo</td><td>Log aggregation and distributed tracing</td></tr><tr><td>Vault</td><td>Secrets management with Kubernetes auth</td></tr><tr><td>Longhorn</td><td>Distributed block storage across the cluster</td></tr><tr><td>Open WebUI + Ollama</td><td>Self-hosted LLM chat with local models</td></tr><tr><td>RAG pipeline</td><td>Document ingestion → chunking → embeddings → pgvector</td></tr><tr><td>Velero</td><td>Scheduled backups to MinIO (daily, 7-day TTL)</td></tr><tr><td>Vaultwarden</td><td>Self-hosted password manager with SSO</td></tr><tr><td>Cloudflare Tunnel</td><td>Public HTTPS access without port-forwarding</td></tr></tbody></table>
<p>All publicly reachable at <code>*.devandre.sbs</code> via Cloudflare Tunnel, protected by Authentik SSO.</p>
<h2 class="anchor anchorTargetStickyNavbar_Vzrq" id="why-this-matters-for-engineering">Why This Matters for Engineering<a href="https://docs.devandre.sbs/blog/platform-engineering-bare-metal-kubernetes#why-this-matters-for-engineering" class="hash-link" aria-label="Direct link to Why This Matters for Engineering" title="Direct link to Why This Matters for Engineering" translate="no">​</a></h2>
<p>The goal was never to run Kubernetes at home for its own sake. The goal was to develop the kind of platform instinct that only comes from operating infrastructure through failure: disk fills up and MinIO hangs in memory with no alert; a node's SMC doesn't respond to WoL and a cron job has to compensate; a Velero CRD upgrade job never sets <code>status.succeeded</code> because of a k3s Job controller bug.</p>
<p>Those incidents — and the fixes — are what platform engineering actually looks like beneath the abstractions. The next posts in this series will go deeper into specific components: the RAG pipeline architecture, the GitOps promotion workflow, and the OPA Gatekeeper policy set.</p>
<hr>
<p><em>The full runbooks for every phase live in the <a class="" href="https://docs.devandre.sbs/platform/platform-roadmap/roadmap-overview">Documentation</a> section of this site.</em></p>]]></content:encoded>
            <category>kubernetes</category>
            <category>platform-engineering</category>
            <category>devops</category>
            <category>k3s</category>
            <category>gitops</category>
            <category>bare-metal</category>
        </item>
    </channel>
</rss>