<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>homelab</title><link>https://docs.magelssen.io/development/</link><description>Recent content on homelab</description><generator>Hugo</generator><language>en</language><atom:link href="https://docs.magelssen.io/development/index.xml" rel="self" type="application/rss+xml"/><item><title/><link>https://docs.magelssen.io/development/claude-agent/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.magelssen.io/development/claude-agent/</guid><description>&lt;h1 id="claude-as-an-agent-in-the-homelab"&gt;Claude as an agent in the homelab&lt;a class="anchor" href="#claude-as-an-agent-in-the-homelab" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;Claude Code has &lt;strong&gt;read-only&lt;/strong&gt; access to the homelab. All changes go through Git and&#10;are rolled out by Flux (or by a human), never by Claude directly.&lt;/p&gt;&#10;&lt;h2 id="how-access-is-limited"&gt;How access is limited&lt;a class="anchor" href="#how-access-is-limited" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Claude can inspect the cluster and propose changes, but it cannot change anything by&#10;itself:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Read-only ServiceAccount: &lt;code&gt;claude-readonly&lt;/code&gt; is bound to the built-in &lt;code&gt;view&lt;/code&gt;&#10;ClusterRole plus a small extra ClusterRole for nodes, persistent volumes, CRDs,&#10;Flux, Prometheus Operator and Gateway API resources, and may run PromQL queries&#10;through the Prometheus Service. It has no access to secrets. The RBAC is managed by Flux like&#10;everything else, in &lt;a href="https://github.com/l4rma/homelab/blob/main/kubernetes/infrastructure/claude-readonly"&gt;&lt;code&gt;kubernetes/infrastructure/claude-readonly&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;Separate kubeconfig: a &lt;a href="https://github.com/l4rma/homelab/blob/main/scripts/create-claude-kubeconfig.sh"&gt;script&lt;/a&gt; builds a&#10;kubeconfig from the ServiceAccount token. Claude Code uses it through a gitignored&#10;local settings file. The admin kubeconfig is denied.&lt;/li&gt;&#10;&lt;li&gt;Client-side guardrails: &lt;a href="https://github.com/l4rma/homelab/blob/main/.claude/settings.json"&gt;&lt;code&gt;.claude/settings.json&lt;/code&gt;&lt;/a&gt; allows&#10;read commands and denies &lt;code&gt;kubectl apply/delete/edit/patch/exec&lt;/code&gt; and&#10;&lt;code&gt;flux reconcile/suspend&lt;/code&gt;.&lt;/li&gt;&#10;&lt;li&gt;Changes through Git: Claude works on a branch. A human reviews, commits and merges,&#10;and Flux rolls out the change.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Why it is set up this way: the RBAC is enforced by the API server, so even if a&#10;client-side rule is bypassed, the agent still cannot change the cluster or read&#10;secrets. Every change goes through review and is recorded in Git history, the same&#10;as for a human operator. The repo is public, so no credentials are ever part of the&#10;setup in Git.&lt;/p&gt;</description></item><item><title/><link>https://docs.magelssen.io/development/github/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://docs.magelssen.io/development/github/</guid><description>&lt;h1 id="github-repository"&gt;GitHub repository&lt;a class="anchor" href="#github-repository" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;&#10;&lt;p&gt;How the repository itself is set up. Settings that cannot live in Git are listed here, so&#10;they can be checked and set again by hand.&lt;/p&gt;&#10;&lt;h2 id="ruleset-on-main"&gt;Ruleset on &lt;code&gt;main&lt;/code&gt;&lt;a class="anchor" href="#ruleset-on-main" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;&#10;&lt;p&gt;Defined in &lt;a href="https://github.com/l4rma/homelab/blob/main/.github/rulesets/main.json"&gt;&lt;code&gt;.github/rulesets/main.json&lt;/code&gt;&lt;/a&gt;. GitHub does not&#10;read the file by itself. Apply a change with:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;gh api -X PUT repos/l4rma/homelab/rulesets/&amp;lt;id&amp;gt; --input .github/rulesets/main.json&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;(&lt;code&gt;gh api repos/l4rma/homelab/rulesets&lt;/code&gt; lists the id. The first time, use&#10;&lt;code&gt;gh api -X POST repos/l4rma/homelab/rulesets --input .github/rulesets/main.json&lt;/code&gt;, or import&#10;the file under Settings → Rules → Rulesets.)&lt;/p&gt;</description></item></channel></rss>