<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Diego Braga on Medium]]></title>
        <description><![CDATA[Stories by Diego Braga on Medium]]></description>
        <link>https://medium.com/@diego.braga86?source=rss-775fd005e54f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*23QUbkPtDssf2WMB.</url>
            <title>Stories by Diego Braga on Medium</title>
            <link>https://medium.com/@diego.braga86?source=rss-775fd005e54f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:00:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@diego.braga86/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Declaring Oxide Cloud VMs as Kubernetes YAML with Krateo]]></title>
            <link>https://medium.com/@diego.braga86/declaring-oxide-cloud-vms-as-kubernetes-yaml-with-krateo-a7a625d5b6e5?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7a625d5b6e5</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Fri, 03 Jul 2026 16:40:55 GMT</pubDate>
            <atom:updated>2026-07-03T17:25:28.518Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QoO0IPgUJ5E3Eyghl_JHA.png" /></figure><p><em>A hands-on story of turning the </em><a href="https://oxide.computer/"><em>Oxide</em></a><em> Cloud API into native Kubernetes custom resources with </em><a href="https://krateo.io"><em>Krateo</em></a><em>’s Operator Generator (KOG) — and the four bugs that stood between “it renders” and “the VM is actually running.”</em></p><p>I wanted to write this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/39f14953f8c2011d4ca037cfc355eba1/href">https://medium.com/media/39f14953f8c2011d4ca037cfc355eba1/href</a></iframe><p>…run kubectl apply, and watch a real virtual machine boot in my Oxide silo. No hand-written controller. Just Kubernetes as the API.</p><p>That’s exactly what Krateo’s <strong>KOG</strong> promises: point it at a curated subset of an OpenAPI spec, and it generates the CRDs and a generic controller that reconciles them against the real cloud. It worked beautifully for OxideProject and OxideVpc on the first try. The disk and the instance - the whole point - did not. Getting them to run turned into a four-layer debugging session across three separate Krateo components. Here&#39;s the trail.</p><p>Three moving parts:</p><ul><li><strong>oasgen-provider</strong> reads a RestDefinition (a reference to a curated OpenAPI subset) and generates a CRD pair per resource - a&lt;Kind&gt;Configuration (holding the API token) and the resource &lt;Kind&gt;.</li><li><strong>rest-dynamic-controller</strong> (RDC) is the generic reconciler: for each CR it does create / get / update / delete against the REST API, and compares the live resource to your spec to detect drift.</li><li>The <strong>KOG package</strong> (this repo) is just the curated OpenAPI subsets and the RestDefinitions - 19 of them, one per Oxide resource.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0dWlFuqiUNHblBfikjqDvg.png" /></figure><p>Byte-sized fields matter here. A disk size or an instance memory is measured in bytes, so a 20 GiB disk is 21474836480 and 4 GiB of RAM is 4294967296 - both comfortably beyond the ~2.1 billion ceiling of a signed 32-bit integer. Remember that number.</p><p>The very first kubectl apply of a disk failed at <em>admission</em>:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d2300f2d4cdfa17f2ae2f7fb6f450caa/href">https://medium.com/media/d2300f2d4cdfa17f2ae2f7fb6f450caa/href</a></iframe><p>The curated schema clearly says format: int64. But the generated CRD validated size as - so any value above ~2 GiB was rejected before it ever reached Oxide. A 20 GiB disk simply could not be expressed.</p><p>Tracing it: oasgen-provider builds the JSON schema from the OpenAPI, then hands it to a CRD generator. The bug was in the first step - the OpenAPI→JSON-schema converter <strong>dropped the </strong><strong>format keyword</strong>, appending it only to the field&#39;s <em>description</em> (&quot;(format: int64)&quot;). With no format on the schema, the CRD generator defaulted integers to int32. The description literally told you the truth the schema had thrown away.</p><p><strong>Fix:</strong> preserve numeric format ( int32/ int64/ float/ double) through the conversion, so the CRD keeps format: int64. Shipped as oasgen-provider 0.10.4. Now size and memory accept real values.</p><p>With the disk now applying, it got <em>created in Oxide</em> — but the Kubernetes CR sat forever at READY=False while Synced=True. The resource existed; the controller just refused to call it done. Project and VPC (string-only fields) were Ready=True. Only the resources with big integers weren&#39;t.</p><p>The RDC decides “up to date” by comparing your spec against the API’s GET response. Turning on debug logging gave it away:</p><pre>values differ, FirstValue=21474836480, SecondValue=2.147483648e+10</pre><p>Same number. The CR stores size as an int64 ( 21474836480); the JSON response decodes it as a float64, which Go&#39;s fmt prints in exponential form ( 2.147...e+10). The comparator normalized numbers by round-tripping through a string, but its number parser rejected the exponential form and fell back to float64 - so int64(21474836480) != float64(21474836480), forever. <strong>Every</strong> int64 field looked like perpetual drift, so the resource never reached Ready.</p><p><strong>Fix:</strong> coerce whole-number floats back to integers during comparison. Shipped as rest-dynamic-controller 0.9.1. Ironic twin of #1: one component <em>dropped</em> int64, the other <em>mishandled</em> it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pLxo7uX3JWKHj4bMoAjleA.png" /></figure><p>The instance create returned a flat 400. A direct API call with a hand-written body worked, which narrowed it to the request shape. The culprit was in the curated schema: boot_disk was modeled as a <strong>string</strong> (a disk name), but Oxide&#39;s InstanceCreate.boot_disk is an <strong>object</strong> -{ type: attach|create, name, ... }. A one-line-of-intent asset fix, but a real one: the KOG&#39;s schemas have to match the API&#39;s actual shapes.</p><p>Now everything reconciled. But applying the disk and the instance <strong>in the same manifest</strong> left the instance <em>stopped</em>, with its boot disk <em>detached</em> — and it never recovered.</p><p>The cause is a race with no self-healing: the instance controller creates the instance before the disk has finished provisioning, and Oxide’s create-time boot_disk attach <strong>silently no-ops</strong> on a not-ready disk (it records the intended boot disk but doesn&#39;t attach the volume). The generic RDC compares spec to the GET response; disk <em>attachment</em> isn&#39;t in that response, so it never notices anything is wrong.</p><p>The tempting fix is “wrap it in a Krateo Composition and let that sequence things.” I checked the source: the composition controller runs helm install with Wait: false, and Helm doesn&#39;t readiness-gate arbitrary custom resources anyway. A Composition is a state machine for the <em>release</em> lifecycle - not a sequencer of independent child-resource readiness. It would apply disk and instance together and hit the same race.</p><p>So I put the state machine where it belongs: <strong>in front of the resource.</strong> Krateo supports <em>plugins</em> — small wrapper web services the RDC calls instead of the raw API. I wrote one for OxideInstance whose <strong>GET is an idempotent reconcile</strong>:</p><ol><li>read the instance’s recorded boot_disk_id;</li><li>if that disk isn’t attached, attach it (stopping first if needed);</li><li>once attached and stopped, start the instance.</li></ol><p>Because the controller GETs on every resync, the instance <strong>converges to running regardless of apply ordering</strong> — a tiny finite-state machine that repairs the attach-and-start dance the generic CRUD model can’t express. It ships as a container image, published by CI, and the KOG chart wires it in with a single value: instancePlugin.enabled=true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-dmkAHU3Gf9wQrtEfoFpA.png" /></figure><p>Fresh kind cluster, the fixed providers, the plugin enabled, and one kubectl apply of project + VPC + disk + instance - together, no ordering:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/be621d2e1a65eca2d9b1e4d637ea9a1b/href">https://medium.com/media/be621d2e1a65eca2d9b1e4d637ea9a1b/href</a></iframe><p>All four CRs report READY=True, and in the Oxide console:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XPa0cOezr7yYLLQl.png" /></figure><p>A 2-vCPU / 4-GiB VM, booting an imported Alpine image, with a 20 GiB int64 boot disk attached and an external IP - declared entirely as Kubernetes YAML, self-healed to running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DUovLBlz4byzWvNz.png" /></figure><ul><li><strong>int64 is a recurring failure mode in generated infrastructure APIs.</strong> Byte-sized fields overflowint32, and int64/float64 JSON round-trips break naive comparisons. It bit me in <em>two</em> different components, in opposite directions.</li><li><strong>Generated CRUD gets you 80% for free — and the last 20% is stateful.</strong> Attach, start, “must be stopped to resize”: these aren’t create/get/update/delete, and no amount of schema curation expresses them. That’s what plugins are for.</li><li><strong>Put the state machine at the right altitude.</strong> A Composition orchestrates a release; it doesn’t reconcile a resource’s internal readiness. When “apply once and converge” is the requirement, the convergence has to live next to the resource.</li></ul><p><em>The fixes are open: </em><em>oasgen-provider 0.10.4, </em><em>rest-dynamic-controller 0.9.1, the</em><em>oxide-rest-dynamic-controller-plugin, and the KOG package with the </em><em>boot_disk fix and the</em><em>instancePlugin toggle. Full reproducible walkthrough in the </em><a href="https://github.com/braghettos/krateo-oxide-operator-kog/blob/main/docs/quickstart.md"><em>quickstart</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7a625d5b6e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-Up MFA for kubectl: Making Kubernetes Demand a Second Factor Before Critical Operations]]></title>
            <link>https://medium.com/@diego.braga86/step-up-mfa-for-kubectl-making-kubernetes-demand-a-second-factor-before-critical-operations-f0c33f07cf16?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0c33f07cf16</guid>
            <category><![CDATA[mfa]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 09:45:35 GMT</pubDate>
            <atom:updated>2026-07-02T09:45:35.766Z</atom:updated>
            <content:encoded><![CDATA[<p><em>MFA at login is table stakes. The hard requirement is step-up — forcing a fresh second factor at the moment of a sensitive action — and making it hold for people applying Custom Resources with kubectl. Here’s how I did it with Keycloak’s acr claim and a ValidatingAdmissionPolicy, on a real cluster.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*99FvKW-pzC3E3h685q7cMQ.png" /></figure><h3>The requirement that sounds simple</h3><p>A cloud-management-platform security requirement landed on my desk:</p><blockquote><em>The CMP must enforce MFA for administrative access, and must be able to require </em><strong><em>MFA step-up at the moment of critical operations</em></strong><em> (role management, federation management, usage export).</em></blockquote><p>The first half is easy. Every IdP worth the name can require a second factor at login. It’s the second half that’s interesting: <strong>step-up</strong> — not “were you MFA’d at some point today,” but “prove a second factor <em>right now</em>, because you’re about to do something dangerous.”</p><p>And in a Krateo/GitOps world, “something dangerous” often means kubectl apply of a Custom Resource — a federation trust, a role binding. So the sharp version of the requirement is:</p><blockquote><em>Applying a critical CR must require an MFA-stepped-up session. A password-only session is refused.</em></blockquote><h3>Why the obvious approach doesn’t exist</h3><p>Keycloak has proper step-up (Level of Authentication). A web app redirects the user back to Keycloak with acr_values=&lt;high&gt;, Keycloak prompts for <em>only the missing factor</em>, and returns a token stamped with a higher acr. Textbook — <strong>for interactive OIDC clients</strong>.</p><p>kubectl → kube-apiserver is not that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y-iWOlW6q2erCfMAfiA-dQ.png" /></figure><p>The apiserver <strong>statelessly validates a JWT</strong>. There’s no channel to pause an apply, bounce the human to Keycloak for a fingerprint, and resume. So &quot;interactive step-up at the moment of kubectl apply&quot; is architecturally impossible at that layer.</p><blockquote><em>The apiserver can’t </em>prompt<em>. But it can </em>refuse<em> — based on what the token already proves.</em></blockquote><p>That reframes step-up on kubectl from an interactive pop-up into a <strong>policy gate</strong>: the token must already carry proof that a second factor was used. If it doesn&#39;t, deny — and the human re-authenticates with step-up and retries. Out-of-band, but it enforces the exact security property: <em>no critical CR without a fresh MFA.</em></p><p>(The interactive pop-up still exists — it lives in the CMP portal/API, which <em>is</em> an OIDC client and can trigger acr_values. This article is about the defense-in-depth for people who go straight to kubectl.)</p><h3>The mechanism: three moving parts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*IdSqHLkkebu4k77eQHfJGQ.png" /></figure><h3>1. Keycloak stamps the assurance level into acr</h3><p>A Level-of-Authentication browser flow: level 1 is username + password (acr=1); level 2 adds a second factor (acr=2). When a client requests acr_values=2, Keycloak prompts for <em>only</em> the missing factor and stamps the token accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xvIHJRdPptoLLIhsl78vmQ.png" /></figure><p>I used <strong>TOTP</strong> (authenticator-app codes) — built-in, no SMS gateway. For real admin use I’d reach for <strong>WebAuthn/passkeys</strong> (phishing-resistant); it’s a Keycloak-flow swap and, importantly, <strong>changes nothing downstream</strong> — the cluster only cares about acr, not <em>how</em> you got it.</p><h3>2. The apiserver maps acr into the user identity</h3><p>Kubernetes <strong>Structured Authentication Configuration</strong> (GA 1.30+) validates the Keycloak JWT and projects claims — including acr and auth_time — into the user&#39;s extra, where admission can see them:</p><pre>claimMappings:<br>  username:<br>    claim: preferred_username<br>    prefix: &quot;oidc:&quot;<br>  groups:<br>    claim: groups<br>    prefix: &quot;oidc:&quot;<br>  extra:<br>    - key: &quot;cmp.krateo.io/acr&quot;<br>      valueExpression: &quot;has(claims.acr) ? claims.acr : &#39;none&#39;&quot;<br>    - key: &quot;cmp.krateo.io/auth_time&quot;<br>      valueExpression: &quot;has(claims.auth_time) ? string(int(claims.auth_time)) : &#39;0&#39;&quot;</pre><p>kubectl auth whoami then shows it plainly:</p><pre>Username   oidc:alice<br>Groups     [oidc:cmp-admins system:authenticated]<br>Extra: cmp.krateo.io/acr        [1]      # or [2] after step-up<br>Extra: cmp.krateo.io/auth_time  [1782975605]</pre><h3>3. A ValidatingAdmissionPolicy is the gate</h3><p>Native CEL (GA 1.30), no external webhook. Scoped to exactly the sensitive kinds; only real OIDC humans are subject to it:</p><pre>apiVersion: admissionregistration.k8s.io/v1<br>kind: ValidatingAdmissionPolicy<br>metadata:<br>  name: require-mfa-stepup<br>spec:<br>  matchConstraints:<br>    resourceRules:<br>      - apiGroups:<br>          - identity.openstack.krateo.io<br>        operations:<br>          - CREATE<br>          - UPDATE<br>          - DELETE<br>        apiVersions:<br>          - &quot;*&quot;<br>        resources:<br>          - identityfederationproviders<br>          - identitymappings<br>          - identityfederationprotocols<br>          - identityroles<br>          - identityroleassignments<br>  matchConditions:<br>    - name: only-oidc-users<br>      expression: &quot;has(request.userInfo.username) &amp;&amp; request.userInfo.username.startsWith(&#39;oidc:&#39;)&quot;<br>  variables:<br>    - name: acr<br>      expression: &quot;(&#39;cmp.krateo.io/acr&#39; in request.userInfo.extra) ? request.userInfo.extra[&#39;cmp.krateo.io/acr&#39;][0] : &#39;none&#39;&quot;<br>  validations:<br>    - expression: &quot;variables.acr == &#39;2&#39;&quot;<br>      messageExpression: &quot;&#39;CMP critical operation on &#39; + request.resource.resource + &#39; requires MFA step-up (acr=2). Your token has acr=&#39; + variables.acr + &#39;.&#39;&quot;</pre><h3>The proof</h3><p>Same user (alice, in cmp-admins, RBAC-allowed), same IdentityFederationProvider CR. Only the token&#39;s acr differs.</p><p>Password only:</p><pre>$ kubectl apply -f federation.yaml     # token acr=1<br>Error ... ValidatingAdmissionPolicy &#39;require-mfa-stepup&#39; denied request:<br>CMP critical operation on identityfederationproviders requires MFA step-up (acr=2).<br>Your token has acr=1.</pre><p>After TOTP step-up:</p><pre>$ kubectl apply -f federation.yaml     # token acr=2<br>identityfederationprovider.identity.openstack.krateo.io/keycloak created</pre><p>RBAC said <em>yes</em> both times. The <strong>second factor</strong> is the difference between deny and admit.</p><blockquote><em>The nice part: this is factor-agnostic and controller-free. Kubernetes never learns what MFA is — it only reads a number the IdP put in the token.</em></blockquote><h3>Four things worth knowing</h3><ol><li><strong>Managed clusters can’t do this as-is.</strong> It needs the apiserver’s --authentication-config and an <strong>HTTPS OIDC issuer</strong> — neither is yours on GKE/EKS/AKS. Self-managed control planes only. (I built and ran the whole thing on kind.)</li><li><strong>“At the moment of” = freshness.</strong> acr=2 says MFA happened; it doesn&#39;t say <em>recently</em>. Add now - auth_time &lt; N minutes to the policy — auth_time is already mapped. The browser step-up token carries auth_time; a direct-grant (ROPC) token doesn&#39;t, which is a good reason to prefer the real flow.</li><li><strong>acr on direct grant is only ever 1.</strong> Level-of-Authentication is a browser-flow concept. To get a genuine acr=2 you go through the authorization-code flow with acr_values=2 — which is what a human (or kubelogin) does anyway.</li><li><strong>Exempt the machines.</strong> The only-oidc-users match condition keeps controllers, ServiceAccounts, and the break-glass cert admin out of the gate. Tune it to your threat model.</li></ol><h3>Was it worth it?</h3><p>The requirement said “step-up MFA at the moment of critical operations.” On an interactive portal that’s a redirect. On raw kubectl it&#39;s a myth — until you stop trying to <em>prompt</em> and start trying to <em>refuse</em>. A Keycloak assurance level, three lines of claim mapping, and one CEL policy later, a federation change or a role grant simply <strong>cannot</strong> be applied from a password-only session.</p><p>No operator, no webhook server, no second factor baked into Kubernetes. Just an IdP that tells the truth in a claim, and a cluster that insists on reading it.</p><p><em>The full, runnable prototype — certs, apiserver auth config, the Keycloak LoA flow scripts, the CRDs + RBAC + policy, and a scripted step-up token minter — is in the </em><a href="https://github.com/braghettos/krateo-keycloak-operator-kog/tree/main/demo/mfa-stepup"><em>demo/mfa-stepup</em></a><em> folder. Built with </em><a href="https://www.keycloak.org/"><em>Keycloak</em></a><em>, Kubernetes </em><a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/"><em>Structured Authentication</em></a><em> + </em><a href="https://kubernetes.io/docs/reference/access-authn-authz/validating-admission-policy/"><em>ValidatingAdmissionPolicy</em></a><em>, and </em><a href="https://krateo.io"><em>Krateo PlatformOps</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0c33f07cf16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GitOps-Native Keycloak: Realms, Clients, and Federation as Kubernetes CRs — with Zero Operator Code]]></title>
            <link>https://medium.com/@diego.braga86/gitops-native-keycloak-realms-clients-and-federation-as-kubernetes-crs-with-zero-operator-code-19cfc47d6af3?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/19cfc47d6af3</guid>
            <category><![CDATA[keycloak]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[gitops]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 06:00:46 GMT</pubDate>
            <atom:updated>2026-07-02T06:00:46.819Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I turned Keycloak’s Admin API — and Keystone’s federation API — into Kubernetes custom resources using the Krateo Operator Generator (KOG), and ran a live GitHub → Keycloak → Keystone → Horizon single sign-on chain entirely from Git.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tzsOF_QWA__7w08Du-Y6PQ.png" /></figure><h3>The half of Keycloak that GitOps forgot</h3><p>If you run Keycloak on Kubernetes, the <strong>lifecycle</strong> is a solved problem. The official Keycloak Operator gives you a Keycloak CR — declare your instance count, hostname, database, and it reconciles the server for you. Clean, declarative, GitOps-friendly.</p><p>Then you need to actually <em>configure</em> it — a realm, a couple of OIDC clients, a protocol mapper, an identity-provider federation — and you fall off the declarative cliff. Your options have traditionally been:</p><ul><li><strong>Click-ops</strong> in the Admin Console. Fast, unversioned, undocumented, and gone the moment someone fat-fingers a setting.</li><li><strong>kcadm.sh / Admin REST scripts.</strong> Imperative, order-sensitive, not idempotent without a lot of care.</li><li><strong>Realm JSON import</strong> (KeycloakRealmImport). Declarative-ish, but import-oriented: weak on day-2 drift and partial updates.</li></ul><p>None of these is <em>GitOps-native</em> in the way we expect everything else on the cluster to be: a custom resource in Git, continuously reconciled, drift-corrected, reviewed in a pull request.</p><p>I wanted kubectl get keycloakclients to be a real thing. Here&#39;s how I got there — and a working federation example at the end.</p><h3>The idea: generate the operator, don’t write it</h3><p>Keycloak’s Admin API is a large, well-specified REST API. As of recent releases it even ships an <strong>official OpenAPI 3.0.3 document</strong>. And there’s a Krateo project whose entire job is to turn an OpenAPI spec into a Kubernetes controller:</p><ul><li><a href="https://github.com/krateoplatformops/oasgen-provider"><strong>oasgen-provider</strong></a> — reads an OpenAPI spec (referenced from a RestDefinition CR) and <em>generates</em> the CRD.</li><li><a href="https://github.com/krateoplatformops/rest-dynamic-controller"><strong>rest-dynamic-controller</strong></a> — reconciles instances of that CRD by making the corresponding REST calls.</li></ul><p>Together they’re the <strong>Krateo Operator Generator (KOG)</strong>. Feed it an OpenAPI spec, get back a controller that manages that API’s resources as CRs. No Go. No client-go. No informers to wire. This is the same pattern I used previously to turn OpenStack Nova compute into CRs — <em>with zero operator code</em>.</p><p>So the architecture splits cleanly in two:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D6uJJ-1lyLlz7n7Y9eCQ9A.png" /></figure><p>The official Operator owns the server. The KOG owns the configuration. They meet at exactly one point: a bearer token.</p><h3>What “GitOps-native config” actually buys you</h3><p>Before the how, the why. Once a Keycloak client is a KeycloakClient CR:</p><ul><li><strong>It lives in Git.</strong> Reviewed in PRs, diffed, rolled back.</li><li><strong>It’s continuously reconciled.</strong> Someone changes a redirect URI by hand in the console? The controller puts it back. The CR is the source of truth.</li><li><strong>It composes.</strong> It’s just another resource next to your app’s Deployment, Ingress, and ExternalSecret. Same tooling, same RBAC, same Argo/Flux sync.</li><li><strong>It’s discoverable.</strong> kubectl get keycloakclients -A.</li></ul><p>That’s the prize. Now the build.</p><h3>Turning the Keycloak Admin API into CRDs</h3><p>A RestDefinition points oasgen-provider at an OpenAPI spec and describes how the resource&#39;s verbs map to endpoints. Here&#39;s the (abridged) one for clients:</p><pre>apiVersion: ogen.krateo.io/v1alpha1<br>kind: RestDefinition<br>metadata:<br>  name: keycloak-client<br>spec:<br>  oasPath: configmap://krateo-system/keycloak-client/client.yaml<br>  resourceGroup: keycloak.ogen.krateo.io<br>  resource:<br>    kind: KeycloakClient<br>    # clientId is the natural key; id is the server-generated UUID<br>    identifiers:<br>      - clientId<br>    additionalStatusFields:      # server-generated UUID -&gt; status<br>      - id<br>    excludedSpecFields:          # ...and NOT a spec field<br>      - id<br>    verbsDescription:<br>      - action: findby<br>        method: GET<br>        path: /admin/realms/{realm}/clients<br>      - action: create<br>        method: POST<br>        path: /admin/realms/{realm}/clients<br>      - action: get<br>        method: GET<br>        path: /admin/realms/{realm}/clients/{id}<br>        requestFieldMapping:<br>          - inPath: id<br>            inCustomResource: status.id<br>      - action: update<br>        method: PUT<br>        path: /admin/realms/{realm}/clients/{id}<br>        requestFieldMapping:<br>          - inPath: id<br>            inCustomResource: status.id<br>      - action: delete<br>        method: DELETE<br>        path: /admin/realms/{realm}/clients/{id}<br>        requestFieldMapping:<br>          - inPath: id<br>            inCustomResource: status.id</pre><p>The interesting mechanic is findby. Keycloak addresses clients by a <strong>server-generated UUID</strong>, but humans (and Git) want to name them by clientId. So the controller lists the collection, matches on clientId, resolves the UUID into status.id, and reuses it for get/update/delete. You declare a natural key; the plumbing handles the surrogate one.</p><p>I curated one such RestDefinition (plus a trimmed OpenAPI subset) for each of six Keycloak resources:</p><p>CR Kind (keycloak.ogen.krateo.io/v1alpha1) Keycloak resource KeycloakRealm realm KeycloakClient client (with inline protocol mappers) KeycloakClientScope client scope KeycloakGroup group KeycloakProtocolMapper standalone protocol mapper KeycloakIdentityProvider identity-provider (broker) federation</p><h3>The example: Keycloak as the IdP for OpenStack</h3><p>Here’s a real, end-to-end federation scenario — the one that made this worth building. The goal: <strong>users log into the Krateo platform portal via Keycloak, then open OpenStack Horizon and are already logged in.</strong> No second login.</p><p>The trick is a single <strong>shared Keycloak session</strong>. Two applications both federate to the same realm:</p><ul><li>The <strong>Krateo portal</strong> logs in via an OIDC client (krateo-authn).</li><li><strong>OpenStack Horizon</strong> uses WebSSO → <strong>Keystone</strong>, which is an OIDC <strong>federated</strong> relying party of Keycloak (client keystone), via mod_auth_openidc.</li></ul><p>Once you’ve authenticated to Keycloak for the portal, the Horizon → Keystone → Keycloak redirect completes <strong>silently</strong> — the session already exists.</p><p>Everything Keycloak needs for that is now declarative. Here’s the realm and the federation client, <strong>as Git-managed CRs</strong>:</p><pre># The realm — the SSO session boundary both apps ride<br>apiVersion: keycloak.ogen.krateo.io/v1alpha1<br>kind: KeycloakRealm<br>metadata:<br>  name: krateo<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keycloak-admin<br>    namespace: krateo-system<br>  realm: krateo<br>  enabled: true<br>  ssoSessionIdleTimeout: 1800<br>  ssoSessionMaxLifespan: 36000<br>---<br># The Keystone (Horizon WebSSO) federation client — with the groups mapper INLINE<br>apiVersion: keycloak.ogen.krateo.io/v1alpha1<br>kind: KeycloakClient<br>metadata:<br>  name: keystone<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keycloak-admin<br>    namespace: krateo-system<br>  realm: krateo<br>  clientId: keystone<br>  name: &quot;OpenStack Keystone (Horizon WebSSO)&quot;<br>  enabled: true<br>  protocol: openid-connect<br>  standardFlowEnabled: true<br>  clientAuthenticatorType: client-secret<br>  redirectUris:<br>    - &quot;https://keystone.example.com/v3/auth/OS-FEDERATION/identity_providers/keycloak/protocols/openid/websso&quot;<br>  protocolMappers:<br>    - name: groups<br>      protocol: openid-connect<br>      protocolMapper: oidc-group-membership-mapper<br>      config:<br>        &quot;claim.name&quot;: &quot;groups&quot;<br>        &quot;full.path&quot;: &quot;false&quot;<br>        &quot;access.token.claim&quot;: &quot;true&quot;<br>        &quot;id.token.claim&quot;: &quot;true&quot;</pre><p>That groups mapper is the linchpin of federated <strong>authorization</strong>: it emits a groups claim that Keystone&#39;s mapping turns into project/role grants. A user&#39;s Keycloak group membership becomes their OpenStack tenancy — expressed as a KeycloakGroup CR:</p><pre>apiVersion: keycloak.ogen.krateo.io/v1alpha1<br>kind: KeycloakGroup<br>metadata:<br>  name: os-project-demo<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keycloak-admin<br>    namespace: krateo-system<br>  realm: krateo<br>  name: os-project-demo<br>  attributes:<br>    openstack-project:<br>      - demo<br>    openstack-role:<br>      - member</pre><p>On the Keystone side (OpenStack-Helm), federation is mod_auth_openidc pointed at the realm&#39;s discovery URL plus a mapping that reads OIDC-groups into Keystone groups; on the Horizon side, WebSSO is a one-liner (auth.sso.enabled: true + an idp_mapping). Both are plain Helm values — I keep them in Git next to the CRs.</p><h3>The payoff, in one widget</h3><p>Because the portal and Horizon share the Keycloak session, the “open OpenStack” experience is literally a link. In the Krateo composable frontend it’s a Markdown widget:</p><pre>apiVersion: widgets.templates.krateo.io/v1beta1<br>kind: Markdown<br>metadata:<br>  name: openstack-sso-link<br>  namespace: krateo-system<br>spec:<br>  widgetData:<br>    markdown: |<br>      ## OpenStack<br>      [🚀 Open Horizon (SSO)](https://keystone.example.com/v3/auth/OS-FEDERATION/websso/openid?origin=https://horizon.example.com/auth/websso/)</pre><p>Click it → a redirect flash → the Horizon dashboard, already authenticated, scoped to the project your Keycloak group grants. Every piece of that — realm, client, mapper, group, and the widget — is a resource in Git.</p><h3>A second flavor of federation</h3><p>The example above is Keycloak-as-IdP. The KOG also covers Keycloak-as-<strong>broker</strong> via KeycloakIdentityProvider — declaratively registering an upstream IdP (another Keycloak, Entra ID, a corporate OIDC provider) that Keycloak brokers logins to. Same declarative story, addressed by its natural key (alias):</p><pre>apiVersion: keycloak.ogen.krateo.io/v1alpha1<br>kind: KeycloakIdentityProvider<br>metadata:<br>  name: corp-idp<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keycloak-admin<br>    namespace: krateo-system<br>  realm: krateo<br>  alias: corp<br>  providerId: oidc<br>  enabled: true<br>  config:<br>    issuer: &quot;https://login.corp.example.com/&quot;<br>    clientId: &quot;krateo&quot;<br>    defaultScope: &quot;openid email profile&quot;</pre><h3>Taking it live: GitHub → Keycloak → Keystone → Horizon on GKE</h3><p>The example so far is Keycloak-as-IdP with the OpenStack side kept as Helm values. To prove the whole thing end-to-end I stood it up on a real GKE cluster and added a twist: the <em>upstream</em> identity is <strong>GitHub</strong>. The full chain becomes four hops:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ljTh-3a9rqgI9rjSMd_0A.png" /></figure><p>A user clicks <strong>Login with Keycloak</strong> in Horizon, then <strong>GitHub</strong> in Keycloak, authorizes the OAuth App once, and lands on the Horizon dashboard as their GitHub identity — auto-provisioned into an OpenStack project. And critically: <strong>the Keystone federation trust is now KOG-native too.</strong></p><blockquote><em>The only imperative step left in the whole chain is registering the GitHub OAuth App — because GitHub has no API to create one. Everything else is YAML in Git.</em></blockquote><p>The whole thing, in three frames captured live on the GKE cluster:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJE-UQZA9TA_IZtLPC1gPQ.png" /></figure><p><em>Horizon’s login page — one SSO choice, wired by the WebSSO Helm values.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4emvHV6pjJWdPQ3c2FxYcg.png" /></figure><p><em>Keycloak brokers to GitHub — the </em><em>KeycloakIdentityProvider CR in action.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UgiAXRyMvHMWKBzmndvFXw.png" /></figure><p><em>Landed in Horizon as the federated user </em><em>braghettos, scoped to the </em><em>demo project — the row assignment provisioned on the fly by the Keystone </em><em>IdentityMapping.</em></p><h3>The half of Keystone that GitOps forgot</h3><p>That last point is the interesting one. Keystone’s OS-FEDERATION API — identity providers, mappings, protocol bindings — is exactly the kind of config that normally gets hand-run with openstack federation ... and never makes it into Git. It&#39;s the same declarative cliff, one layer down. So it got the same treatment: a companion <strong>Keystone KOG</strong> (<a href="https://github.com/braghettos/openstack-keystone-operator-kog">openstack-keystone-operator-kog</a>) that turns the federation trust into three CRs:</p><pre># The trusted IdP — Keycloak&#39;s realm issuer, pinned to a managed domain<br>apiVersion: identity.openstack.krateo.io/v1alpha1<br>kind: IdentityFederationProvider<br>metadata:<br>  name: keycloak<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keystone-config<br>    namespace: krateo-system<br>  id: keycloak<br>  identity_provider:<br>    enabled: true<br>    domain_id: &quot;&lt;keycloak domain id&gt;&quot;<br>    remote_ids:<br>      - &quot;http://keycloak.example.com/realms/krateo&quot;<br>---<br># OIDC claims → Keystone user + project/role (auto-provisioning)<br>apiVersion: identity.openstack.krateo.io/v1alpha1<br>kind: IdentityMapping<br>metadata:<br>  name: keycloak-mapping<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keystone-config<br>    namespace: krateo-system<br>  id: keycloak_mapping<br>  mapping:<br>    rules:<br>      - local:<br>          - user:<br>              name: &quot;{0}&quot;<br>              domain:<br>                name: keycloak<br>          - projects:<br>              - name: demo<br>                roles:<br>                  - name: member<br>        remote:<br>          - type: OIDC-preferred_username<br>---<br># Bind the openid protocol on the IdP to the mapping<br>apiVersion: identity.openstack.krateo.io/v1alpha1<br>kind: IdentityFederationProtocol<br>metadata:<br>  name: keycloak-openid<br>  namespace: krateo-system<br>spec:<br>  configurationRef:<br>    name: keystone-config<br>    namespace: krateo-system<br>  idp_id: keycloak<br>  id: openid<br>  protocol:<br>    mapping_id: keycloak_mapping</pre><p>Same generate-don’t-write pattern, same natural-key addressing — now the <em>entire</em> identity story, both sides of the federation handshake, is YAML in Git. The GitHub broker on the Keycloak side is likewise just a KeycloakIdentityProvider + KeycloakIdentityProviderMapper. The only imperative step left in the whole chain is registering the GitHub OAuth App — because GitHub has no API to create one.</p><h3>Four things Keystone’s federation API taught me</h3><p>Wiring the Keystone KOG live surfaced its own batch of spec-vs-reality gotchas — the Keystone twin of the five Keycloak lessons below:</p><ol><li><strong>PUT is create-only.</strong> Keystone treats PUT /OS-FEDERATION/.../{id} as create; it returns <strong>409</strong> if the object exists. Updates must use <strong>PATCH</strong> — so the RD&#39;s update verb maps to PATCH, with a matching patch operation in the OpenAPI asset.</li><li><strong>Don’t put a </strong><strong>domain in the mapping&#39;s </strong><strong>projects rule.</strong> Keystone rejects it (&#39;domain&#39; was unexpected); the project&#39;s domain is inferred from the user rule.</li><li><strong>Pin the IdP’s </strong><strong>domain_id.</strong> Skip it and Keystone auto-creates a per-IdP domain; auto-provisioned projects land <em>there</em>, orphaned from your managed domain. Pinning it makes auto-provisioning <strong>reuse</strong> the KOG-managed project instead of duplicating it.</li><li><strong>Horizon’s WebSSO lands domain-scoped.</strong> The first federated token is domain-scoped, so project panels 403 until you pick the project in the switcher — then it rescopes to a project token and the dashboard is yours.</li></ol><p>The full, reproducible walkthrough — every command and manifest — is in the <a href="https://github.com/braghettos/krateo-keycloak-operator-kog">live GKE quickstart</a>.</p><h3>The auth story: a bearer token that rotates itself</h3><p>The controller calls the Admin API with a bearer token. Keycloak’s admin tokens are short-lived, so a static secret is a non-starter. Instead I let <strong>External Secrets Operator</strong> mint one on a sub-TTL interval from a service-account client, via a Webhook generator that hits the token endpoint and drops the fresh access_token into the Secret every RestDefinition&#39;s Configuration references. No CronJob, no rotation code — the token refreshes itself.</p><h3>Five things the spec didn’t tell me</h3><p>Generating an operator from an OpenAPI document is wonderful right up until the spec and the generator disagree. Validating this on a live cluster (Keycloak 26.6.3, oasgen-provider 0.10) surfaced a handful of real lessons:</p><ol><li><strong>The published Keycloak OAS omits a </strong><strong>securitySchemes block.</strong> KOG needs http/bearer declared, so I patch it into each curated subset. (The API <em>is</em> bearer — no proxy needed, unlike APIs that use custom auth headers.)</li><li><strong>Path parameters must be declared at the <em>operation</em> level.</strong> oasgen-provider ignores path-item-level parameters; put them under each get/post/… or {realm} silently never reaches the CRD.</li><li><strong>Server-generated IDs must be excluded from </strong><strong>spec.</strong> The {id} path param lands in the CRD as <em>required</em>. Since it&#39;s server-assigned, exclude it from spec and source it from status.id (populated by findby).</li><li><strong>Nested arrays need a </strong><strong>$ref.</strong> Inline array-of-object items get dropped; the client&#39;s protocolMappers must reference a named schema. That fixed made <strong>inline mappers</strong> work — which is why the keystone client above carries its groups mapper directly, no UUID gymnastics.</li><li><strong>Trim the schemas.</strong> RealmRepresentation has 152 fields. Curate the subset you actually manage, or your CRD balloons.</li></ol><p>None of these are showstoppers — they’re the honest tax of the generate-don’t-write approach, and each was a one-line fix once understood.</p><h3>Was it worth skipping the Go?</h3><p>Six Keycloak resources, three Keystone federation resources, full CRUD, natural-key addressing, inline mappers, self-rotating auth — and not a line of controller code. Just curated OpenAPI subsets and RestDefinitions. The realm, its clients, the GitHub broker, the federation mapping, and the projects that federated users land in are now exactly what everything else on my cluster is: <strong>YAML in Git, reconciled by a controller.</strong></p><p>I ran the whole chain live on GKE: a GitHub login flows through Keycloak, is federated into Keystone, and drops the user onto Horizon — scoped into an OpenStack project that a mapping rule provisioned on the fly. Every trust relationship in that sentence is a custom resource.</p><p>Keycloak config finally joined the GitOps party — and it brought Keystone’s federation with it.</p><p><em>Everything here is public: the blueprint (Keycloak Operator + CloudNativePG) at </em><a href="https://github.com/braghettos/krateo-keycloak-blueprint"><em>krateo-keycloak-blueprint</em></a><em>, the Keycloak config KOG at </em><a href="https://github.com/braghettos/krateo-keycloak-operator-kog"><em>krateo-keycloak-operator-kog</em></a><em> (with end-to-end and GitHub-SSO demos), and the Keystone identity/federation KOG at </em><a href="https://github.com/braghettos/openstack-keystone-operator-kog"><em>openstack-keystone-operator-kog</em></a><em>. Built with </em><a href="https://krateo.io"><em>Krateo PlatformOps</em></a><em>, </em><a href="https://github.com/krateoplatformops/oasgen-provider"><em>oasgen-provider</em></a><em>, and </em><a href="https://github.com/krateoplatformops/rest-dynamic-controller"><em>rest-dynamic-controller</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19cfc47d6af3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Nutanix VMs the GitOps Way]]></title>
            <link>https://medium.com/@diego.braga86/creating-nutanix-vms-the-gitops-way-a5842a425b2a?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5842a425b2a</guid>
            <category><![CDATA[nutanix]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 11:32:01 GMT</pubDate>
            <atom:updated>2026-06-10T11:41:50.907Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How we turned the Nutanix Prism Central v4 OpenAPI spec into a Kubernetes operator without a line of controller code — and the 200-line proxy that fixed the one thing a generic client couldn’t do, for every Nutanix resource at once.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*voj42uKYKpGFc_vZ3BMtkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vt7T2kpC2jnzVRIUM6udHA.png" /><figcaption>The whole path: a Vm CR, one generic controller, and the Nutanix v4 proxy — no operator code.</figcaption></figure><p>What if a Nutanix virtual machine were just another Kubernetes object — declare it in YAML, kubectl apply, and let a controller reconcile it into Prism Central? And what if you got that operator <strong>without writing a single line of Go</strong> - just by handing Kubernetes an OpenAPI description of the Nutanix API?</p><p>That’s the promise of <a href="https://krateo.io">Krateo</a>’s <strong>Operator Generator (KOG)</strong>. You give its oasgen-provider an OpenAPI slice and a small RestDefinition, and it generates a CRD and spins up a generic rest-dynamic-controller that reconciles your resource by calling the underlying REST API. No SDK, no reconciler, no operator code.</p><p>It’s also the bridge a <em>managed datacenter</em> needs to feel like a cloud. Modern Nutanix is fully API-driven — every VM, subnet, volume group, and policy is a Prism Central v4 POST - and Krateo is the self-service layer on top (an Internal Developer Portal for golden paths, a Cloud Management Platform for GitOps, RBAC, and guardrails). But none of that works until each Nutanix resource is a <em>Kubernetes-native</em> object Krateo can compose and reconcile. The virtual machine is the first crossing.</p><p>This is the story of making it — including the part where the generic operator couldn’t quite speak Nutanix’s dialect, and the 200-line proxy that fixed it for <em>every</em> Nutanix resource at once.</p><p>KOG works from a single custom resource, the <strong>RestDefinition</strong>. You hand it an OpenAPI slice for one resource and a few hints - the verbs, the identifier - and it generates:</p><ul><li>a <strong>CRD</strong> for the resource (here, Vm in the vmm.nutanix.krateo.io group),</li><li>a <strong>VmConfiguration</strong> CRD that holds the endpoint + auth,</li><li>and a running <strong>controller</strong> (rest-dynamic-controller) that maps the CRD&#39;s verbs onto the REST API.</li></ul><p>The RestDefinition for a Nutanix VM is almost boring:</p><pre>apiVersion: ogen.krateo.io/v1alpha1<br>kind: RestDefinition<br>metadata:<br>  name: nutanix-vmm-vm<br>  namespace: nutanix-system<br>spec:<br>  oasPath: configmap://nutanix-system/nutanix-vmm-vm-oas/vm.yaml<br>  resourceGroup: vmm.nutanix.krateo.io<br>  resource:<br>    kind: Vm<br>    identifiers:<br>      - name<br>    additionalStatusFields:<br>      - extId<br>    verbsDescription:<br>      - action: findby<br>        method: GET<br>        path: /vmm/v4.0/ahv/config/vms<br>      - action: create<br>        method: POST<br>        path: /vmm/v4.0/ahv/config/vms<br>      - action: get<br>        method: GET<br>        path: /vmm/v4.0/ahv/config/vms/{extId}<br>        requestFieldMapping:<br>          - inPath: extId<br>            inCustomResource: status.extId<br>      - action: update<br>        method: PUT<br>        path: /vmm/v4.0/ahv/config/vms/{extId}<br>      - action: delete<br>        method: DELETE<br>        path: /vmm/v4.0/ahv/config/vms/{extId}</pre><p>Apply it, and a Vm CRD and its controller appear. The end state we <em>want</em> is just this:</p><pre>apiVersion: vmm.nutanix.krateo.io/v1alpha1<br>kind: Vm<br>metadata:<br>  name: quickstart-vm<br>  namespace: nutanix-system<br>spec:<br>  configurationRef:<br>    name: nutanix-pc<br>    namespace: nutanix-system<br>  name: quickstart-vm<br>  numSockets: 1<br>  numCoresPerSocket: 1<br>  memorySizeBytes: 2147483648  # 2 GiB<br>  cluster:<br>    extId: &quot;&lt;your-prism-element-cluster&gt;&quot;</pre><p>kubectl apply -f vm.yaml, and a VM should show up in Prism Central. That was the goal.</p><p>helm lint was happy. kubeconform was happy. The CRD rendered, the controller started. And the first kubectl apply created exactly nothing - the controller just logged the same line on a loop:</p><pre>ERROR Cannot observe external resource err=&quot;invalid response code: 4XX&quot;</pre><p><strong>“It renders” ≠ “it works.”</strong> Two walls stood between green CI and a running VM — one a red herring in the codegen, one a genuine impedance mismatch with Nutanix’s API. Neither showed up until we ran it against a real Prism Central.</p><p>The 4XX was a lie. Prism&#39;s access log showed the findby GET returning a clean 200. The problem was static, not runtime: the generated OpenAPI slice declared its responses as <strong>ranges</strong> ( 4XX, 5XX) instead of explicit codes - and rest-dynamic-controller can&#39;t match a real 200 against a range, so it rejected even a successful response as &quot;invalid.&quot;</p><p>That misdirection cost us the most, precisely because it <em>looked</em> like a protocol failure when it was a codegen one.</p><p><strong>Fix:</strong> expand the ranges to explicit 200/400/404/500 in the slice - and, while there, stop marking NTNX-Request-Id/ If-Match as <em>required</em> headers and expose name as a findby filter. These are pure codegen edits; they belong upstream in the oasgen-provider templates.</p><p>With the response codes fixed, the controller could <em>read</em> Prism Central — but still couldn’t <em>create</em> a VM. Nutanix v4 is an excellent API, but it’s opinionated in five ways that no OpenAPI document captures:</p><ol><li><strong>A </strong><strong>$objectType discriminator</strong> in every create/update body (e.g. vmm.v4.ahv.config.Vm). Miss it → 500.</li><li><strong>An </strong><strong>NTNX-Request-Id header</strong> - a fresh UUID per mutating call - for idempotency.</li><li><strong>Creates are asynchronous.</strong> POST returns 202 and a <em>task reference</em>; the resource exists only once you poll /prism/v4.0/config/tasks/{id} to SUCCEEDED.</li><li><strong>ETag / </strong><strong>If-Match</strong> optimistic concurrency on update and delete.</li><li><strong>OData </strong><strong>$filter</strong> for lookups - with the value <em>quoted</em> (name eq &#39;x&#39;, not name eq x).</li></ol><p>These aren’t schema — they’re <em>behavior</em>, so you can’t edit them into the slice. Rather than fork the controller, we slid a small, stdlib-only <strong>reverse proxy</strong> between it and Prism Central. The controller still thinks it’s talking to a plain REST API; the proxy quietly does the Nutanix-specific work:</p><p>Five translations, one adapter:</p><p>In order: (1) quote OData $filter values; (2) inject the $objectType discriminator into bodies; (3) add a fresh NTNX-Request-Id per mutating call; (4) poll 202 → task → SUCCEEDED and return the real resource as 200; (5) GET for the ETag and add If-Match on writes. Each is one thing the controller no longer has to do itself.</p><p>The clever bit is translation #2. Hardcoding a $objectType per resource would defeat the purpose - Nutanix has hundreds of them. Instead the proxy <strong>derives it from the request path</strong>:</p><pre>/vmm/v4.0/ahv/config/vms → vmm.v4.ahv.config.Vm<br>/prism/v4.0/config/categories → prism.v4.config.Category<br>/clustermgmt/v4.0/.../{id}/storage-containers → clustermgmt.v4.config.StorageContainer<br>/storage/v4.0.a3/config/volume-groups → storage.v4.r0.a3.config.VolumeGroup</pre><p>Singularize and PascalCase the collection, normalize the version (GA v4.0→ v4, alpha v4.0.a3→ v4.r0.a3), strip parent collection/{id} pairs - and you have the discriminator for <em>any</em> Nutanix v4 resource. One proxy, every RestDefinition. Irregular cases get an OBJECTTYPE_OVERRIDES escape hatch.</p><p>With the proxy deployed and the slice patched, the full flow is four kubectl steps.</p><p><strong>1 — Deploy the proxy</strong> (no registry needed; it’s a single stdlib script):</p><pre>kubectl -n nutanix-system create configmap nutanix-proxy-src \<br>--from-file=nutanix_v4_proxy.py=quickstart/middleware/nutanix_v4_proxy.py<br># set PC_BASE to https://&lt;your-pc&gt;:9440/api in deploy.yaml<br>kubectl apply -f quickstart/middleware/deploy.yaml</pre><p><strong>2 — Apply the RestDefinition</strong> (with the patched slice pointed at the proxy):</p><pre>kubectl apply -f generated/vmm/restdefinitions/vm.restdefinition.yaml<br>kubectl -n nutanix-system wait restdefinition/nutanix-vmm-vm --for=condition=Ready</pre><p><strong>3 — Provide credentials</strong> via a VmConfiguration + Secret.</p><p><strong>4 — Create the VM</strong> — apply the Vm CR from above:</p><pre>kubectl apply -f vm.yaml<br>kubectl -n nutanix-system get vms.vmm.nutanix.krateo.io quickstart-vm<br># NAME READY ... SYNCED=True</pre><p>The controller does findby (?name=...) → not found → POST → 202 → (proxy polls the task) → 200. And in Prism Central:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KI-6QT-dTLfqYX5hvKer9A.png" /><figcaption>quickstart-vm in the Prism Central VM list — reconciled from a Vm CR, no console clicks.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WsHqeLnFEZz2FmWsKFhqVA.png" /><figcaption>The VM’s summary in Prism Central — its description still records that it was created from a Krateo Vm CR.</figcaption></figure><p>No console clicks, no API scripts — a Kubernetes object reconciled into a real Nutanix VM.</p><ul><li><strong>“It renders” ≠ “it works.”</strong> Both walls passed helm lint and schema validation; neither surfaced until a live Prism Central. If you&#39;re packaging an operator, your CI needs a real (or kind-hosted) reconcile, not just helm template.</li><li><strong>Separate schema bugs from behavior bugs.</strong> The 4XX was a slice edit; the five conventions were runtime behavior. Conflating them sends you debugging the wrong layer - the misleading 4XX was the biggest time sink precisely because it looked like a protocol problem.</li><li><strong>Derive, don’t enumerate.</strong> The proxy stays generic because $objectType is <em>computed from the path</em>, not hardcoded per resource. One rule beats hundreds of special cases - and it&#39;s why the same 200 lines serve every Nutanix resource.</li><li><strong>A thin translation layer beats a bespoke controller.</strong> Any API with a discriminator, idempotency keys, async jobs, or ETags can be brought under a generic OpenAPI operator with a small declarative adapter — no per-resource Go.</li></ul><p>It’s tempting to read this as “we made one resource work.” It’s broader than that.</p><p>Because $objectType is derived and the other four translations are resource-agnostic, the <em>same</em> proxy already serves Category, Subnet, VolumeGroup, and the other 180-plus Nutanix v4 resources in the repo - each just needs its RestDefinition and the three slice fixes. The hard part is solved once.</p><p>And the fixes have a home upstream: the codegen corrections belong in the oasgen-provider templates, and the five translations could become a Nutanix “provider plugin” inside rest-dynamic-controller, retiring the sidecar entirely. The proxy is the proof-of-concept and the stopgap.</p><p>The pattern generalizes past Nutanix, too. Any API with a discriminator, idempotency keys, async jobs, or ETags can be brought under a generic OpenAPI operator with a thin, declarative translation layer instead of a bespoke controller. And once a resource is a CRD, everything you already run — Argo CD, policy, RBAC, drift detection — applies for free. That’s the GitOps story for Nutanix.</p><p>The proxy, manifests, patched slice, and full walkthrough are in the repo:</p><ul><li><strong>Quickstart:</strong> quickstart/README.md</li><li><strong>Proxy:</strong> quickstart/middleware/nutanix_v4_proxy.py (stdlib-only) + Dockerfile + deploy.yaml</li></ul><p>Point it at your Prism Central, apply a Vm, and watch it appear. Then apply a Category - and notice you didn&#39;t write a single line of controller code for either.</p><p><em>The repo ships </em><strong><em>189 RestDefinitions across 19 Nutanix v4 namespaces</em></strong><em> (</em><em>vmm, </em><em>networking, </em><em>clustermgmt, </em><em>storage, </em><em>iam, </em><em>prism, ...) - </em><em>Vm is just the worked example; each becomes a CRD + controller through the same flow.</em><strong>Write the YAML, not the controller.</strong><em>Built with </em><a href="https://krateo.io"><em>Krateo</em></a><em> (oasgen-provider / rest-dynamic-controller) against Nutanix Prism Central GA v4.0.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5842a425b2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VPC-as-a-Service: a whole AWS network from one YAML]]></title>
            <link>https://medium.com/@diego.braga86/vpc-as-a-service-a-whole-aws-network-from-one-yaml-d78b8ef28802?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d78b8ef28802</guid>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Fri, 05 Jun 2026 11:10:05 GMT</pubDate>
            <atom:updated>2026-06-05T11:10:05.973Z</atom:updated>
            <content:encoded><![CDATA[<p>Why putting Krateo on top of AWS — with Kubernetes as the backbone — beats handing every team a Terraform module</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*tBcLviW8MVaB5F0CU6S-fA.png" /></figure><p>Every platform team eventually hits the same wall. A product squad needs “a VPC with public and private subnets and a NAT gateway, in eu-central-1.” Simple enough — except the squad doesn’t know Terraform, the platform team owns the state file, and now there’s a ticket, a review, a terraform apply, and a Slack thread that lives for three days.</p><p>What if that squad could instead write twelve lines of YAML, kubectl apply, and get a correct, opinionated network a minute later — while the platform team keeps full control of what “correct” means?</p><p>That’s what we built with a<em>ws-vpc-stack:</em> a Krateo blueprint that turns one Composition into a complete AWS VPC, using <strong>Kubernetes as the backbon</strong>e and <strong>AWS Controllers for Kubernetes (ACK) </strong>as the hands. Here’s the design — and why this stack of choices is more than the sum of its parts.</p><h3>One Composition, not a ticket</h3><p>Here is the entire request a developer makes:</p><pre>apiVersion: composition.krateo.io/v0-3-0<br>kind: AwsVpcStack<br>metadata:<br>  name: my-vpc<br>  namespace: aws-vpc-system<br>spec:<br>  region: eu-central-1<br>  cidr: &quot;10.0.0.0/16&quot;<br>  azs: [&quot;eu-central-1a&quot;, &quot;eu-central-1b&quot;]<br>  public_subnets:  [&quot;10.0.0.0/24&quot;, &quot;10.0.1.0/24&quot;]<br>  private_subnets: [&quot;10.0.10.0/24&quot;, &quot;10.0.11.0/24&quot;]<br>  enable_nat_gateway: true<br>  single_nat_gateway: true</pre><h3>A faithful replica of the Terraform module</h3><p>If those field names look familiar, that’s deliberate: they’re<strong> the same inputs as the popular terraform-aws-modules/vpc/aws modul</strong>e. We didn’t invent a new vocabulary; we met people where they already are.</p><p>In fact the blueprint is a <strong>faithful replica of that module’s interface —</strong> the same cidr, azs, public_subnets, private_subnets, and enable_nat_gateway knobs yield the same network. What changes is everything wrap<em>ped around </em>it. Because the request is a Kubernetes object, <strong>who</strong> may create a VPC is governed by ordinary Kubernetes <strong>RBAC</strong> and namespaces — least-privilege access, not a bespoke pipeline secret. <strong>Every</strong> create, change, and delete flows through the Kubernetes API server, so<strong> the audit trail is the</strong> same one you already keep for your workloads (and, with GitOps, a pull-request history on top of it). And where terraform apply runs once and walks away, the ACK controllers <strong>continuously</strong> <strong>reconcile</strong>: delete a route in the console and it comes back; the live network is forced to match the declared one, forever. A Terraform module hands you the network. The blueprint hands you the <em>same</em> network plus least-privilege access control, a built-in audit log, and drift that heals itself.</p><p>Applying that one object produces ~10 real AWS resources, correctly wired: a VPC, public and private subnets across two AZs, an internet gateway, a NAT gateway with its Elastic IP, and route tables sending public traffic to the IGW and private traffic through the NAT. Delete the Composition and they’re torn down in reverse. No state bucket, no apply, no ticket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*GIeD6OZfBuVkWsYmU0QIgQ.png" /></figure><p>So how does twelve lines become a network? Three layers, each doing one job well.</p><h3>The backbone: Kubernetes as a control plane</h3><p>Strip away the containers and Kubernetes is really a d<strong>eclarative, self-healing control loop with an API, an authorization model, and an event system</strong>. You declare desired state; controllers continuously reconcile reality toward it. That machinery is exactly what cloud provisioning has always wanted and rarely had.</p><p>Using Kubernetes as the backbone means infrastructure inherits, for free, the things teams already built around it:</p><ul><li><strong>Reconciliation, not one-shot apply.</strong> A controller doesn’t run once and forget. It keeps comparing desired vs. actual. If someone hand-edits a route table in the console, it gets corrected. Drift is a bug the system fixes, not a surprise you discover next quarter.</li><li><strong>One API surface and one RBAC model.</strong> The same kubectl, the same namespaces, the same role bindings that govern your workloads now govern your VPCs. Multi-tenancy and “who can create what” stop being a separate IAM puzzle.</li><li><strong>GitOps by default.</strong> A VPC is a YAML object, so Argo CD or Flux can own it like anything else. Your network has a pull request history.</li><li><strong>An event-driven graph.</strong> Resources can reference each other and wait. That turns out to be the whole trick for composing a network, as we’ll see.</li></ul><h3>The hands: ACK turns AWS into Kubernetes resources</h3><p>AWS Controllers for Kubernetes are official AWS controllers that expose AWS services as native Custom Resources. A Bucket, a DBInstance, a Subnet — each is a Kubernetes object that an AWS-maintained controller reconciles against the real AWS API.</p><p>Crucially, ACK resources can reference each other by name. A Subnet points at a VPC via vpcRef; a RouteTable route points at an InternetGateway via gatewayRef; a NATGateway points at its Subnet and ElasticIPAddress. The controller resolves those references and only creates a resource once everything it depends on is ready.</p><p>That gives us a dependency state machine for free. Each resource moves through<em> New → Resolving refs → Creating → Synced</em>, and the references gate the order:</p><p>VPC → Internet Gateway → public route table → public subnets → NAT gateway (+ EIP) → private route table → private subnets</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sq0CzDozyN72pNl9FptTOg.png" /></figure><p>We didn’t write an orchestrator. We wrote a Helm chart that emits ten cross-referencing resources and let ACK’s reconciliation figure out the order. (When we first tested it live, the logs literally showed each resource politely waiting — “the referenced resource is not synced yet” — until its turn.)</p><h3>The product: Krateo turns resources into self-service</h3><p>ACK gives you the building blocks. It does <strong>not</strong> give you a product. A developer still has to know which ten resources to create, how to wire vpcRef to routeTableRefs, and which fields matter. That’s where Krateo comes in.</p><p>A Krateo <strong>CompositionDefinition</strong> points at a Helm chart (our <em>aws-vpc-stack</em>). When applied, Krateo:</p><p>1. Builds a brand-new CRD — AwsVpcStack — from the chart’s JSON Schema. The schema <em>is</em> the API contract: it’s how we expose a curated, Terraform-module-shaped set of inputs and hide the 200+ knobs nobody needs.<br>2. Spins up a controller that, on each AwsVpcStack you create, renders the chart and applies the resulting ACK resources.<br>3. Renders a <strong>portal form </strong>from that same schema, so the network can be requested from a UI, not just YAML.</p><p>The result is a <em>golden path:</em> the platform team curates one opinionated blueprint — single-NAT or per-AZ NAT, sane defaults, validated CIDRs — publishes it once as an OCI artifact, and every team consumes it without copy-pasting a Terraform module and slowly drifting apart.</p><h3>Why this combination wins</h3><p>Any one layer alone is incomplete. Raw Terraform gives you modules but a state file someone has to babysit and a CLI someone has to run. Raw ACK gives you Kubernetes-native AWS resources but no abstraction or self-service. Kubernetes alone doesn’t speak AWS. Put them together and the advantages compound:</p><p>- <strong>Self-service with guardrails</strong>. Developers get a small, friendly API; platform teams keep the implementation, defaults, and policy.<br>- <strong>Continuous correctness.</strong> Reconciliation means the network matches Git, always — drift is auto-corrected instead of audited.<br>- <strong>No extra control plane to run.</strong> No Terraform state backend, no separate CI to run apply. The cluster you already operate is the engine.<br>- <strong>Unified governance.</strong> One RBAC model, one audit log, one GitOps pipeline for apps and infrastructure.<br>- <strong>Composability.</strong> A VPC stack is just an object; an app blueprint can depend on it, and an internal developer portal can list both as cards.</p><p>To be honest about the trade-offs: you need ACK controllers and IAM permissions in place (a one-time platform setup), some resources legitimately take minutes (a NAT gateway is a NAT gateway), and ACK doesn’t cover every last AWS corner. But for the 80% that platform teams provision over and over, this is a dramatically shorter path.</p><h3>Try it</h3><p><em>aws-vpc-stac</em>k is one of a set of composite “stack” blueprints (RDS, EKS, ALB, IAM, security groups, autoscaling, ECS) that replicate the most-used Terraform modules on top of ACK. Each is a published OCI chart with a quickstart and an architecture diagram. We validated the VPC stack end-to-end on a real AWS account: one Composition in, a real multi-AZ network out, and a clean teardown when the Composition is deleted.</p><p>Kubernetes as the backbone, ACK as the hands, Krateo as the product. Twelve lines of YAML, a whole network, and a platform team that finally gets out of the ticket queue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d78b8ef28802" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An OpenStack Compute Kubernetes Operator with Krateo — and zero operator code]]></title>
            <link>https://medium.com/@diego.braga86/an-openstack-compute-kubernetes-operator-with-krateo-and-zero-operator-code-bf49547df6c1?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf49547df6c1</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[krateo]]></category>
            <category><![CDATA[operators]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 17:09:52 GMT</pubDate>
            <atom:updated>2026-06-04T17:09:52.737Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPDot-zhyxRLkgMhy8xWSw.png" /></figure><p><em>Turning the OpenStack Nova API into a native Kubernetes CRD with Krateo’s Operator Generator (KOG), then driving real VMs on a self-hosted, blueprint-deployed OpenStack: </em><em>kubectl apply an </em><em>Instance → an ACTIVE VM; </em><em>kubectl delete it → the VM is gone.</em></p><p>This is Part 2 of a two-part series. <a href="https://medium.com/@diego.braga86/openstack-as-a-service-with-krateo-one-composition-one-cloud-1ff0bbb68809">Part 1 </a>— “OpenStack-as-a-Service with Krateo: one Composition, one cloud” — builds the cloud itself from Krateo blueprints; here, a Kubernetes operator runs on top of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WC0shy2IkENX_3BA.png" /></figure><h3>The pitch</h3><p>What if you managed an OpenStack VM the way you manage a Deployment - write YAML, kubectl apply, and let a controller reconcile reality to match? And what if you could do that <strong>without writing a single line of controller code</strong>, just by handing Kubernetes an OpenAPI description of the API you want to wrap?</p><p>That’s <a href="https://krateo.io">Krateo</a>’s <strong>Operator Generator (KOG)</strong>. You give its oasgen-provider an OpenAPI spec and a small RestDefinition, and it generates a CRD and runs a generic <strong>rest-dynamic-controller</strong> that reconciles your custom resource by calling the underlying REST API.</p><p>This article points that machinery at <strong>OpenStack Nova</strong> and tests it against an OpenStack we built ourselves from <a href="https://github.com/braghettos/krateo-openstack-blueprint">Krateo blueprints</a> (see the companion article, <em>“OpenStack-as-a-Service with Krateo”</em>). The result is a self-contained loop: <strong>a Kubernetes operator that creates VMs on a Kubernetes-deployed cloud — neither side hand-written.</strong></p><h3>The architecture (and the one awkward bit)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1LPP1xOa73HM6ry8.png" /></figure><p>Three pieces ship in the chart:</p><ol><li>A hand-curated <strong>OpenAPI subset</strong> of Nova’s /servers endpoints, bundled into a ConfigMap.</li><li>A <strong>RestDefinition</strong> that points oasgen-provider at that spec. From it, KOG generates the Instance and InstanceConfiguration CRDs and the rest-dynamic-controller.</li><li>A tiny stateless <strong>auth-bridge</strong> (nginx).</li></ol><p>Why the auth-bridge? The generated controller speaks the standard OpenAPI http/bearer scheme - it sends Authorization: Bearer &lt;token&gt;. OpenStack expects X-Auth-Token: &lt;token&gt;. The auth-bridge is ~20 lines of nginx that rewrites one header into the other. No token <em>exchange</em> happens there - you supply a Keystone token out of band; the bridge just renames the header.</p><blockquote><strong><em>A naming gotcha worth stealing:</em></strong><em> the CRD Kind is </em><em>Instance, not </em><em>Server. Nova wraps its request body in </em><em>{ &quot;server&quot;: {...} }, so the generated spec has a property literally named </em><em>server. KOG&#39;s </em><em>crdgen collides a Kind named </em><em>Server with that property and emits an invalid schema. Name the Kind something else and you&#39;re fine.</em></blockquote><h3>Pointing it at a self-hosted Nova</h3><p>The operator was originally validated against OVH Public Cloud. Targeting our <strong>blueprint-deployed</strong> OpenStack changed exactly two things — the Nova endpoint and the token source — and surfaced one nice lesson.</p><p><strong>Use the Nova ClusterIP, not its DNS name.</strong> The auth-bridge’s proxy_pass includes a variable ($request_uri), which forces nginx to resolve the upstream host through its configured resolver - a <em>public</em> DNS server that can&#39;t resolve nova-api.openstack.svc.cluster.local. An IP literal needs no resolver:</p><pre>NOVA_IP=$(kubectl get svc nova-api -n openstack -o jsonpath=&#39;{.spec.clusterIP}&#39;)<br>PROJECT_ID=$(openstack project show admin -f value -c id)<br>helm upgrade --install nova-kog ./chart -n krateo-system \<br> --set authBridge.upstreamUrl=&quot;http://$NOVA_IP:8774/v2.1/$PROJECT_ID&quot;</pre><p>oasgen-provider then reconciles the RestDefinition into CRDs:</p><pre>kubectl wait restdefinition/nova-kog-server -n krateo-system \<br> --for=condition=Ready --timeout=300s<br>kubectl get crd | grep nova.openstack.krateo.io<br># instanceconfigurations.nova.openstack.krateo.io<br># instances.nova.openstack.krateo.io</pre><p>A Keystone token goes into the nova-token Secret the InstanceConfiguration references (refresh it when it expires, ~1h):</p><pre>TOKEN=$(openstack token issue -f value -c id)<br>kubectl create secret generic nova-token -n krateo-system \<br> --from-literal=token=&quot;$TOKEN&quot; --dry-run=client -o yaml | kubectl apply -f -</pre><h3>kubectl apply → a real VM</h3><pre>apiVersion: nova.openstack.krateo.io/v1alpha1<br>kind: Instance<br>metadata:<br> name: kog-demo-1<br> namespace: krateo-system<br>spec:<br> configurationRef: { name: nova-config, namespace: krateo-system }<br> server:<br> name: kog-demo-1<br> flavorRef: &quot;&lt;m1.tiny id&gt;&quot;<br> imageRef: &quot;&lt;cirros id&gt;&quot;<br> networks:<br> - uuid: &quot;&lt;demo-net id&gt;&quot;<br> metadata: { managed-by: krateo-kog }</pre><p>Apply it, and the controller calls Nova through the auth-bridge. Within seconds the Instance CR is Ready=True and the VM is ACTIVE:</p><pre>NAME READY<br>kog-demo-1 True</pre><p>The Instance CR records the server it created ( status.server.id), and the VM carries the exact metadata we declared:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Amx-JHBJeBmZhzZX.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*avNw1a74Bfw7Rf8g.png" /></figure><p>The smoking gun that it really flowed through the operator (not a CLI) is the auth-bridge access log — the POST /servers → 202 timestamp matches the VM&#39;s creation time, and the client is the rest-dynamic-controller ( Go-http-client):</p><pre>&quot;POST /servers HTTP/1.1&quot; 202 ...<br>&quot;GET /servers/&lt;id&gt; HTTP/1.1&quot; 200 ... ← the controller polling what it created</pre><p>And the VM genuinely boots an OS. The serial console shows CirrOS coming up, pulling a <strong>Neutron DHCP lease</strong>, and reaching its login prompt:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*l66RrRjEnNmncRTg.png" /></figure><h3>kubectl delete → the VM is gone</h3><p>The reverse path is the real test of an operator. Delete the CR:</p><pre>kubectl delete instances.nova.openstack.krateo.io kog-demo-1 -n krateo-system</pre><p>…and the controller issues the delete to Nova (auth-bridge log):</p><pre>&quot;DELETE /servers/0175e368-...-0456a25 HTTP/1.1&quot; 204 ...</pre><pre>openstack server list --name kog-demo-1 -f value -c Name # empty - gone</pre><p>So the lifecycle is closed on both sides:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4yTS2bd2VbnD6v_K.png" /></figure><h3>Why this is more than a demo</h3><p>Two things make this loop interesting:</p><ul><li><strong>No operator code.</strong> The Nova “operator” is an OpenAPI subset, a RestDefinition, and 20 lines of nginx. The same pattern wraps <em>any</em> REST API - Glance images, Neutron networks, Keystone projects - into first-class CRDs. The OpenStack control plane becomes addressable from GitOps, policy engines, and dependency graphs like anything else in Kubernetes. And it already reaches beyond /servers — Flavor, Keypair, ServerGroup, Aggregate — while the identical recipe produced sibling operators for Glance, Neutron and Keystone.</li><li><strong>Both halves are declarative.</strong> The cloud itself came up from Krateo blueprints; the VMs on it are Krateo CRs. It’s Kubernetes all the way down — the cluster runs the cloud, and the cloud’s resources are cluster objects.</li></ul><p>The honest caveats: the bearer token is supplied out of band and expires (a token-refresh controller or a Keystone application credential is the production answer), and the OpenAPI surface here is a deliberate /servers subset, not all of Nova. But the shape is right, and it works end to end against a cloud we built the same way.</p><p><em>Operator repo: </em><a href="https://github.com/braghettos/openstack-nova-operator-kog"><em>github.com/braghettos/openstack-nova-operator-kog</em></a><em> — see </em><a href="https://raw.githack.com/braghettos/openstack-nova-operator-kog/4ad84f79be4263a1536ec50cd39135f96d0c7d86/docs/e2e-krateo-openstack.md"><em>docs/e2e-krateo-openstack.md</em></a><em> for the full reproducible walkthrough. Blueprint repo: </em><a href="https://github.com/braghettos/krateo-openstack-blueprint"><em>github.com/braghettos/krateo-openstack-blueprint</em></a><em>. New here? The repo’s </em><a href="https://github.com/braghettos/openstack-nova-operator-kog/blob/main/docs/quickstart.md"><em>quickstart</em></a><em> walks you from helm install to an Instance you can watch boot in Horizon.</em></p><p><em>Originally published at </em><a href="https://raw.githack.com/braghettos/openstack-nova-operator-kog/4ad84f79be4263a1536ec50cd39135f96d0c7d86/docs/article.html"><em>https://raw.githack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf49547df6c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenStack-as-a-Service with Krateo — one Composition, one cloud]]></title>
            <link>https://medium.com/@diego.braga86/openstack-as-a-service-with-krateo-one-composition-one-cloud-1ff0bbb68809?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ff0bbb68809</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 21:34:06 GMT</pubDate>
            <atom:updated>2026-06-03T21:34:06.724Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_DMBBX1nObkH9BLi.png" /></figure><p><em>How we packaged the whole OpenStack-Helm stack as a set of Krateo PlatformOps blueprints, so that a single </em><em>kubectl apply rolls out a working OpenStack - identity, dashboard, and compute - in dependency order. Plus the handful of very real bugs that stood between &quot;it renders&quot; and &quot;there&#39;s a VM running.&quot;</em></p><h3>The pitch</h3><p>OpenStack is the canonical “hard to operate” platform: a dozen services, a message bus, a database, a hypervisor layer, all of which have to come up in the right order and find each other. <a href="https://opendev.org/openstack/openstack-helm">OpenStack-Helm</a> already turns each service into a Helm chart. What it <em>doesn’t</em> give you is a self-service, declarative front door: <em>“give me an OpenStack”</em> as one Kubernetes object.</p><p>That’s exactly what <a href="https://krateo.io">Krateo</a> PlatformOps is for. A <strong>CompositionDefinition</strong> turns a Helm chart into a Kubernetes CRD; a <strong>Composition</strong> is an instance of it that Krateo&#39;s composition-dynamic-controller (CDC) reconciles by installing the chart. So the goal of this project was simple to state:</p><blockquote><strong><em>One Composition = one OpenStack installation.</em></strong><em> Apply it, and a fully functional cloud comes up. Tear it down by deleting it.</em></blockquote><p>This is the story of getting there — the design decisions, and the bugs that only showed up when we ran it for real on a GKE cluster.</p><h3>Design: one blueprint per chart (not one giant umbrella)</h3><p>The tempting move is a single mega-chart with every OpenStack service as a subchart. We deliberately didn’t. The rule we followed:</p><blockquote>Put components in separate blueprints when they’re separate Helm charts. Only merge them into an umbrella when one blueprint’s <strong>input</strong> depends on another blueprint’s <strong>output</strong>.</blockquote><p>We checked OpenStack-Helm against that rule and found:</p><ul><li><strong>No input→output dependencies.</strong> Every cross-component reference is <em>static configuration</em> — a fixed Service DNS name (keystone, mariadb, rabbitmq) plus shared static passwords. No chart reads another’s runtime output. The helm-toolkit *_lookup helpers are compile-time template functions over a static endpoints map, not Kubernetes runtime lookups.</li><li><strong>Ordering is automatic across compositions.</strong> OpenStack-Helm gates every pod and job on its dependencies with kubernetes-entrypoint init-containers that wait on Services/Jobs <em>by name</em>. Those names are fixed, so the checks resolve across <em>separate</em> Compositions in one namespace - Glance waits for the keystone-api Service no matter which blueprint created it.</li></ul><p>So eleven small, independent blueprints — mariadb, memcached, keystone, glance, horizon (identity) and rabbitmq, placement, openvswitch, libvirt, nova, neutron (compute) — each vendoring its OpenStack-Helm chart with a curated values.schema.json. Clean, composable, individually testable.</p><h3>…with one orchestrator on top</h3><p>There <em>is</em> one real dependency: <strong>ordering</strong>. Keystone must be Ready before Glance/Nova/Neutron can register their endpoints, and firing all the Compositions at once races (a slow Keystone trips Krateo’s create-pending guard).</p><p>So above the per-component blueprints sits an <strong>orchestrator umbrella</strong> ( blueprints/openstack, Kind Openstack). Its chart:</p><ol><li>registers all the component CompositionDefinitions, then</li><li>emits each component Composition <strong>only once its CRD exists and all its dependency Compositions report </strong><strong>Ready=True</strong> - using Helm lookup, re-evaluated on every reconcile.</li></ol><pre>profile: identity → mariadb + memcached → keystone → glance + horizon<br>profile: full → ... then rabbitmq + placement + ovs + libvirt → nova + neutron</pre><p>On the first reconcile only the zero-dependency components render; each subsequent pass unlocks the next tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7mS-xG5dmqK6ukPt.png" /></figure><p>One Openstack Composition, spec.profile: full, and the whole cloud rolls out in order:</p><pre>apiVersion: composition.krateo.io/v0-1-1<br>kind: Openstack<br>metadata:<br>  name: openstack<br>  namespace: openstack<br>spec:<br>  profile: full</pre><h3>The reconcile loop is a state machine</h3><p>It’s worth being precise about <em>why</em> this works, because it’s the crux of the design. Krateo’s composition-dynamic-controller (CDC) is a <strong>level- triggered</strong> controller: it reconciles the Openstack Composition on a loop, and <strong>each reconcile re-renders the umbrella chart from scratch</strong>.</p><p>The trick is that the umbrella’s lookup calls run <em>at render time, against live cluster state</em> - they ask &quot;does the Keystone CRD exist?&quot;, &quot;is the keystone Composition Ready=True?&quot; - every single pass. So the set of component Compositions the chart emits is a <strong>pure function of what the controller observes right now</strong>. No stored progress, no edge-triggered events, no ordering logic in code: just <em>current state → rendered output</em>.</p><p>That turns the rollout into a deterministic <strong>state machine</strong> that the controller walks to a fixed point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xkfVlwzL9zUhm30_.png" /></figure><ul><li><strong>S0 → S1:</strong> on the first pass only the zero-dependency tier (mariadb, memcached) satisfies its gate, so only those render.</li><li><strong>S1 → S2 → S3 → …:</strong> each later reconcile notices the previous tier is now Ready and unlocks the next, exactly the way a state machine advances on a guard becoming true.</li><li><strong>S5 (converged):</strong> once everything is up, every lookup still resolves the same way, the rendered manifest stops changing, and reconciles become <strong>no-ops</strong>.</li></ul><p>Because it’s level-triggered rather than firing once on an event, it’s also <strong>self-correcting</strong>: delete a component and the next reconcile simply re-emits it. The “ordering logic” you’d normally hand-write in an operator is, here, an emergent property of pure-function rendering over observed state. ( profile: identity stops the machine at S3; profile: full runs it to S5.)</p><h3>The bugs that only show up for real</h3><p>None of these failed CI. All of them failed the first time we booted a VM.</p><h3>1. Helm hooks vs. a least-privilege controller</h3><p>OpenStack-Helm runs its db-init / db-sync / ks-register jobs as Helm hooks with hook-delete-policy: before-hook-creation. Krateo&#39;s CDC runs under a least-privilege ServiceAccount that can&#39;t get/ delete Jobs - so the install deadlocked. Fix: <strong>strip the hook annotations</strong> and let the jobs run as plain resources (OpenStack-Helm self-orders via kubernetes-entrypoint, so they still run in the right order). A subtle trap: the annotations appear in <em>two</em> forms - helm.sh/hook: and the quoted &quot;helm.sh/hook&quot;: - and missing the quoted one left Keystone&#39;s fernet-setup as a hook, deadlocking db-sync.</p><h3>2. The chart-inspector caches by version</h3><p>Krateo’s chart-inspector analyses a chart’s resources (to derive RBAC) and <strong>caches that by chart version</strong>. Re-publishing a changed chart under the same 0.1.0 served the stale analysis. During development the fix is to restart core-provider + core-provider-chart-inspector and, on a live cluster, to <strong>bump the version</strong> - which cleanly busts the cache. (Bumping a version regenerates the CRD apiVersion too - 0.1.0 → v0-1-0, 0.1.1 → v0-1-1 - so existing Composition CRs must be recreated at the new apiVersion. Worth knowing before you do it on a running cloud.)</p><h3>3. The phantom rabbitmq-rabbitmq-1 that broke all messaging</h3><p>Nova came up but every VM went ERROR. The compute health-probe told the story:</p><pre>ERROR oslo.messaging._drivers.impl_rabbit: Connection failed:<br>[Errno -2] Name or service not known</pre><p>The consumers’ transport_url targeted <strong>two</strong> RabbitMQ hosts - rabbitmq-rabbitmq-0 <em>and</em> rabbitmq-rabbitmq-1 - because they advertised two messaging replicas. There was only one broker; -1 was NXDOMAIN, and oslo.messaging choked. The fix lives in the blueprint values, not in a hand-patched secret:</p><pre>endpoints:<br> oslo_messaging:<br> statefulset:<br> replicas: 1<br> name: rabbitmq-rabbitmq</pre><h3>4. The non-deterministic render that rolled every pod, forever</h3><p>Even with messaging fixed, Nova never <em>stabilised</em>. The CDC was rolling every pod on <strong>every reconcile</strong>. Diffing two consecutive Helm release manifests found a single changing line:</p><pre>- memcache_secret_key = tB8VZcNeZ2g7...<br>+ memcache_secret_key = BmJZD09GtSey...</pre><p>OpenStack-Helm’s configmap-etc generates that key with randAlphaNum 64 when endpoints.oslo_cache.auth.memcache_secret_key is null. Under a reconcile loop, a fresh random key each render → a new *-etc Secret → a changed pod-template checksum → a rolling restart of every pod. Nova&#39;s readiness probes (80 s delay + 90 s period) never got a stable window, so compute never registered. Pin the key and helm template becomes byte-identical across runs:</p><pre>endpoints:<br> oslo_cache:<br> auth:<br> memcache_secret_key: &lt;a fixed string&gt;</pre><p><strong>The lesson that ties #3 and #4 together:</strong> a controller that reconciles on an interval is <em>merciless</em> about non-determinism. A chart that’s “fine” under helm install can be pathological under a CDC if any rendered byte changes per run. Determinism isn&#39;t a nicety here - it&#39;s a correctness requirement.</p><h3>The payoff</h3><p>With the blueprints fixed and published ( 0.1.1):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q3bX_LJYsOb4CTt6.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6uLzjRpq_hhf10Vp.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VQCFIMNFD6uDZ9iG.png" /></figure><p>All of it from Compositions. No kubectl edit, no manual helm install - every fix went back into the blueprint values and shipped as a chart.</p><pre>kubectl create namespace openstack-system<br>kubectl apply -f blueprints/openstack/compositiondefinition.yaml<br>kubectl create namespace openstack<br>kubectl apply -f examples/openstack.yaml # one Openstack, profile: full</pre><p>…and a cloud comes up.</p><h3>Where this goes next</h3><p>An OpenStack you can kubectl apply is the substrate. The natural next layer is managing the cloud&#39;s <em>contents</em> the same way - projects, networks, images, and <strong>VMs</strong> - as Kubernetes custom resources. That&#39;s a Krateo Operator Generator (KOG) story, and it&#39;s the subject of the companion article, <em>&quot;OpenStack Compute Kubernetes Operator with Krateo&quot;</em>: a Nova operator with <strong>zero operator code</strong>, tested against this very blueprint.</p><p><em>Repo: </em><a href="https://github.com/braghettos/krateo-openstack-blueprint"><em>github.com/braghettos/krateo-openstack-blueprint</em></a><em>. Quickstarts for kind and GKE included.</em></p><p><em>Originally published at </em><a href="https://raw.githack.com/braghettos/krateo-openstack-blueprint/81e7d45560b98a56b41a055a1d8b46d5749dcb47/docs/article.html"><em>https://raw.githack.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ff0bbb68809" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The schema is the contract: making Rancher self-service on Kubernetes]]></title>
            <link>https://medium.com/@diego.braga86/the-schema-is-the-contract-making-rancher-self-service-on-kubernetes-0229f6bcb913?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/0229f6bcb913</guid>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[rancher]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[helm]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Tue, 02 Jun 2026 19:28:15 GMT</pubDate>
            <atom:updated>2026-06-02T19:28:15.719Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Mj7fnXizL3U1IQd9.png" /></figure><p>I wanted something simple: install Rancher from our platform as a single self-service action. Pick a hostname, click once, get a working Rancher. No Helm to learn, no values.yaml to copy, no RBAC to wire by hand.</p><p>I assumed it was plumbing. Point Krateo at Rancher’s official Helm chart, generate a form, done. It turned into a small lesson about what makes a Helm chart self-service-ready — and most of them aren’t.</p><p>When I designed Krateo, I made one call that still gets pushback: the source of truth for a composition is the chart’s values.schema.json. Not values.yaml. The schema.</p><p>The reason is structural. In a declarative platform the contract a user fills in — the form, the generated CRD, the validation — has to come from a formal, machine-readable description. That description is the only thing an OPA policy, a CI check, or an AI agent can reason about. values.yaml is a bag of defaults; it tells you what <em>is</em> set, not what <em>may</em> be set or with what constraints.</p><p>So Krateo’s core-provider reads exactly one file from the chart to build the composition&#39;s CRD: values.schema.json. It never looks at values.yaml.</p><p>That decision is the whole story of this post.</p><p>I registered the upstream Rancher chart directly as a CompositionDefinition and watched it reconcile. It went green - CRD generated, controller up, Ready=True. Promising.</p><p>Then I tried to create a composition and set the hostname:</p><pre>strict decoding error: unknown field &quot;spec.hostname&quot;, unknown field &quot;spec.bootstrapPassword&quot;, unknown field &quot;spec.replicas&quot;</pre><p>The generated CRD had exactly six fields: agentTLSMode, auditLog, service, networkExposure, ingress, gateway. No hostname. And you cannot install Rancher without a hostname.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kpNvCwNwgjVfQARz.png" /></figure><p>This isn’t a bug in Krateo, and it isn’t really a bug in Rancher either. Rancher’s values.schema.json is a <em>partial</em> schema - it validates a handful of enums and one conditional. It was written to catch a few mistakes, not to describe the chart. The full surface of Rancher&#39;s configuration lives in values.yaml, which the platform deliberately doesn&#39;t read.</p><p>It’s worth understanding why a schema-driven platform can’t just “fall back” to values.yaml.</p><p>Krateo’s CRD generator ( crdgen) is a transpiler: JSON Schema → Go structs → controller-gen → CRD. It honors the constructs that map cleanly to a Kubernetes <em>structural</em> schema - properties, type, items, enum, minimum/ maximum, pattern, default, required, additionalProperties. It quietly drops everything that has no structural equivalent and is, in fact, illegal in a CRD: if/ then, allOf/ anyOf/ oneOf, const, format, and type unions like type: [&quot;string&quot;, &quot;null&quot;] (which it collapses to a single type plus nullable: true).</p><p>Rancher’s schema happens to use exactly those constructs — an if/ then for disableHTTP, [&quot;string&quot;,&quot;null&quot;] unions on service.type and agentTLSMode. crdgen did the right thing with all of it. The fields simply weren&#39;t there to expose, because the schema never declared them.</p><p>A chart is only as self-service as its schema is honest.</p><p>A wrapper/umbrella chart doesn’t help here — core-provider reads the <em>root</em> schema, so the wrapper would have to restate Rancher&#39;s surface anyway, and you still can&#39;t change Rancher&#39;s own templates. So I forked the Rancher chart into the blueprint and gave it a complete, crdgen-compatible values.schema.json: hostname, bootstrapPassword, replicas, ingress.tls.source, service.type, letsEncrypt, privateCA, and the rest - single types, string/integer enums, no if/ then.</p><p>Now the composition spec is exactly what an operator wants to set:</p><p><strong>The chart name is the API.</strong> A Krateo composition’s Kind is derived from the chart name. I named the fork rancher-installer, not rancher, on purpose. Rancher&#39;s resources are named from rancher.fullname, which collapses to the bare Helm release name when the release name contains the chart name. While enumerating the chart, Krateo&#39;s chart-inspector creates its own release-named scaffolding RBAC - and Rancher&#39;s cluster-admin ClusterRoleBinding collided with it:</p><pre>ClusterRoleBinding &quot;rancher-&lt;hash&gt;&quot; ... exists and cannot be imported into the current release: missing key &quot;app.kubernetes.io/managed-by&quot;</pre><p>Naming the chart rancher-installer makes Rancher&#39;s resources &lt;release&gt;-rancher-installer-*, and the collision disappears. A name was the fix.</p><p><strong>cert-manager is a prerequisite, not a subchart.</strong> Rancher renders an Issuer ( cert-manager.io/v1). That CRD has to exist at render time, so cert-manager cannot live in the same Helm release - Helm fails with <em>&quot;ensure CRDs are installed first.&quot;</em> This is exactly why Rancher&#39;s own docs install it as a separate step. The blueprint treats it the same way.</p><p><strong>Forcing the NodePort.</strong> Rancher’s service.yaml hardcodes its ports with no nodePort field, so Kubernetes auto-assigns one - useless if you want it to line up with a kind extraPortMappings. Since I&#39;d already forked the chart, I patched the service template to honor service.httpNodePort / service.httpsNodePort. Now the port is deterministic and set from the composition spec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sURhR0ldinR3bqtp.png" /></figure><p>On a throwaway kind cluster — core-provider, cert-manager installed separately, and the blueprint pulled from a public OCI artifact - the loop is exactly what I wanted:</p><pre>kubectl apply -f compositiondefinition.yaml # pulls oci://ghcr.io/.../rancher-installer kubectl apply -f rancher-composition.yaml # the spec above</pre><p>The composition reconciles to Ready, Rancher comes up 1/1 Running, its Service is NodePort with the forced 443:30443, and with kind mapping 30443 to the host the UI answers directly at https://localhost:30443 - no port-forward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z3lHKERaX2LwhUoI.png" /></figure><p>And the same approach generalizes: any tool, once it carries an honest schema, becomes a service anyone can request with a click — and that an agent can request programmatically against the same contract.</p><p>Most Helm charts treat values.schema.json as an optional linting nicety. That&#39;s fine as long as the only reader is a human with the README open. The moment the schema becomes the product surface - the thing a platform, a policy engine, or an agent reads to know what&#39;s allowed - &quot;optional&quot; is the wrong word for it.</p><p>How many of the charts you run every day could describe themselves to something other than a person reading the README?</p><p><em>The blueprint is open source: </em><a href="https://github.com/braghettos/krateo-rancher-blueprint"><em>github.com/braghettos/krateo-rancher-blueprint</em></a><em> — including a </em><a href="https://github.com/braghettos/krateo-rancher-blueprint/blob/main/quickstart.md"><em>quickstart</em></a><em> you can run on kind.</em></p><p><em>Originally published at </em><a href="https://github.com/braghettos/krateo-rancher-blueprint/blob/main/docs/medium-rancher-as-a-service.md"><em>https://github.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0229f6bcb913" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From kubectl apply to a running OpenStack VM]]></title>
            <link>https://medium.com/@diego.braga86/from-kubectl-apply-to-a-running-openstack-vm-70011b8e81f9?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/70011b8e81f9</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes-operator]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[openstack]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Thu, 28 May 2026 22:45:29 GMT</pubDate>
            <atom:updated>2026-05-28T23:09:59.896Z</atom:updated>
            <content:encoded><![CDATA[<h3><em>How Krateo’s Operator Generator (KOG) turns the OpenStack Nova API into a native Kubernetes CRD — and the five very real bugs we hit booting an OpenStack VM, validated against OVH Public Cloud as the managed-OpenStack target.</em></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LSbMdasK5VBL-ZZI.png" /></figure><h3>The pitch</h3><p>What if you could manage an OpenStack virtual machine the same way you manage a Deployment - write a YAML manifest, kubectl apply, and let a controller reconcile reality to match? And what if you could do that <strong>without writing a single line of Go</strong>, just by handing Kubernetes an OpenAPI description of the API you want to wrap?</p><p>That’s the promise of <a href="https://krateo.io">Krateo</a>’s <strong>Operator Generator (KOG)</strong>. You give its oasgen-provider an OpenAPI spec and a small RestDefinition, and it generates a CRD and spins up a generic rest-dynamic-controller that reconciles your custom resource by calling the underlying REST API.</p><p>This article is the story of pointing that machinery at <strong>OpenStack Nova</strong> — and the five concrete problems that stood between “it renders” and “there’s a VM running.” None of them showed up in CI. All of them showed up the moment we ran it for real.</p><p>Nothing here is OVH-specific: the target is the standard OpenStack Compute (Nova) API, so the same chart works against any Keystone + Nova endpoint (a private cloud, Devstack, another public provider). <strong>OVH Public Cloud</strong> is simply the managed OpenStack we validated against — the only OVH-flavoured details are the example endpoint/region and a couple of Keystone token-fetch quirks (Bug #4).</p><h3>The architecture (and the one awkward bit)</h3><p>The moving parts:</p><ul><li><strong>oasgen-provider</strong> - reads a RestDefinition + an OpenAPI spec, generates a CRD, and deploys a dedicatedrest-dynamic-controller for it.</li><li><strong>rest-dynamic-controller</strong> - the generic reconciler. For each CR it calls the API verbs you declared (create/get/delete).</li><li><strong>Our chart</strong> — an OpenAPI subset of Nova’s <em>Servers</em> API, theRestDefinition, and one extra component explained below.</li></ul><p>The awkward bit: <strong>authentication</strong>. KOG only understands OpenAPI http/basic and http/bearer security schemes. It emits Authorization: Bearer &lt;token&gt;. But OpenStack Nova authenticates with a Keystone token in the<strong>X-Auth-Token</strong> header. Those don&#39;t match.</p><p>Rather than fork KOG, we ship a tiny, stateless <strong>nginx “auth-bridge”</strong> inside the chart that rewrites the header on the way through:</p><pre>map $http_authorization $os_token {<br>  default              &quot;&quot;;<br>  &quot;~*^Bearer\s+(.+)$&quot;  $1;<br>}<br>location / {<br>  proxy_pass        $UPSTREAM_NOVA$request_uri;<br>  proxy_set_header  X-Auth-Token  $os_token;<br>}</pre><p>No Keystone exchange, no state — just a header rewrite. You fetch a token out-of-band, drop it in a Secret, and refresh it when it expires (~1h on OVH). The controller thinks it’s talking bearer; Nova receives X-Auth-Token.</p><h3>Bug #1 — The controller called a Service that didn’t exist</h3><p>The OpenAPI spec’s servers[].url is the base address the generated controller hits. Ours was hardcoded:</p><pre>servers:<br>  - url: http://nova-auth-bridge.krateo-system.svc.cluster.local</pre><p>But the chart deploys the bridge Service under its Helm fullname — nova-openstack-nova-operator-kog-auth-bridge. So the controller would have dialed a hostname that never resolves. helm lint and kubeconform were perfectly happy, because nothing validates in-cluster DNS.</p><p><strong>Fix:</strong> template the URL from a helper that derives the real Service name and namespace. Lesson: render-only CI can’t catch a name that’s only wrong at runtime.</p><h3>Bug #2 — Naming a CRD Server produces an invalid CRD</h3><p>We named the Kind Server - obvious, it&#39;s the Nova <em>Servers</em> API. The RestDefinition reconciled to:</p><pre>CustomResourceDefinition<br>&quot;servers.nova.openstack.krateo.io&quot; is invalid:<br>  …properties[server].properties[spec].type:<br>    Required value: must not be empty</pre><p>Nova wraps its create body in an envelope — { &quot;server&quot;: { ... } } - so the generated CR spec has a property literally named server. KOG&#39;s schema generator ( crdgen) then <strong>collides</strong> the server <em>property</em> with the managed Server <em>type</em> and scaffolds it as a full Kubernetes object, emitting an empty- type spec: {} node that the API server rejects.</p><p>We proved it with a control run: rename the Kind to anything else and the CRD generates cleanly.</p><p><strong>Fix:</strong> the property name server is mandated by Nova, so the Kind has to change. We named it (and made it configurable), giving instances.nova.openstack.krateo.io.</p><h3>Bug #3 — The auth model in our samples didn’t exist</h3><p>Our sample manifests authenticated with a BearerAuth CR referenced via spec.authenticationRefs.bearerAuthRef. We&#39;d written them against an <em>assumed</em> KOG model. The deployed oasgen-provider actually generates a <strong>different</strong> shape - two CRDs:</p><pre># InstanceConfiguration — holds the auth<br>spec:<br>  authentication:<br>    bearer:<br>      tokenRef:<br>        name: nova-token<br>        namespace: krateo-system<br>        key: token<br>---<br># Instance — spec.server + configurationRef<br>spec:<br>  configurationRef:<br>    name: nova-config<br>  server:<br>    name: demo<br>    flavorRef: &lt;uuid&gt;<br>    imageRef:  &lt;uuid&gt;<br>    networks: [{ uuid: &lt;uuid&gt; }]</pre><p><strong>Fix:</strong> rewrite samples and docs to the real InstanceConfiguration + configurationRef model. Lesson: read the <em>generated</em> CRDs, don&#39;t trust your mental model of the framework.</p><h3>Bug #4 — The OVH openrc file silently broke token fetching</h3><p>To get a Keystone token we wrote a small get-token.sh. It worked from hand-set env vars, but the moment we sourced OVH&#39;s downloaded openrc.sh, every request 401&#39;d. Two surprises hid here:</p><ol><li>OVH’s openrc sets OS_AUTH_URL=https://auth.cloud.ovh.net/ - <strong>without the </strong><strong>/v3</strong>. The openstack CLI appends the version itself; our rawcurl didn&#39;t, so it POSTed to /auth/tokens (404, then a confusing 401 elsewhere).</li><li>The openrc sets OS_USER_DOMAIN_NAME=ovhcloud-emea (the SSO/account domain) for an account-style nic-handle user. A plain Keystone password grant against that domain is rejected. The same user authenticates fine in the domain - and the supported path is a dedicated project OpenStack user (user-XXXX).</li></ol><p><strong>Fix:</strong> normalize the auth URL to always hit /v3/auth/tokens, gitignore*openrc*.sh so credentials can&#39;t be committed, and (operationally) use OS_USER_DOMAIN_NAME=Default.</p><h3>It boots!</h3><p>With those fixed, we applied an Instance. The controller POSTed through the bridge and Nova answered:</p><pre>POST /servers  →  HTTP/1.1 202 Accepted<br>{&quot;server&quot;: {&quot;id&quot;: &quot;90bff0b3-…&quot;, &quot;adminPass&quot;: &quot;…&quot;}}</pre><p>A kubectl apply had created a <strong>real, ACTIVE OpenStack VM</strong> (running on OVH), complete with a public IP. The entire chain - CR → KOG controller → header-rewrite bridge → Nova - worked against live infrastructure.</p><h3>Bug #5 — The VM existed, but Kubernetes couldn’t see or delete it</h3><p>Victory was short-lived. The CR’s status stayed empty, and the next reconcile did this:</p><pre>GET /servers/%7Bid%7D -&gt; 404 &quot;Instance {id} could not be found.&quot;</pre><p>%7Bid%7D is the URL-encoded literal {id} - the path placeholder was never substituted. Worse, on delete the controller hit the same dead URL, got a 404, treated it as an error, and <strong>left the finalizer in place</strong> - the CR was stuck terminating while the VM kept billing.</p><p>Reading rest-dynamic-controller at the deployed version pinned it down: the controller extracts the configured identifiers ( id, name) from the response body <strong>at the root</strong> - but Nova nests them inside the same server envelope (.server.id). So the created server&#39;s id was never captured, and{id} had nothing to fill it.</p><p><strong>Fix</strong> — pure RestDefinition config, no controller patch:</p><pre>identifiers:<br>  - server.id      # dotted JSONPath<br>  - server.name<br>additionalStatusFields:<br>  - server.status<br>  - server.addresses<br>verbsDescription:<br>  - action: get<br>    path: /servers/{id}<br>    requestFieldMapping:<br>      - inPath: id<br>        inCustomResource: status.server.id<br>  - action: delete<br>    path: /servers/{id}<br>    requestFieldMapping:<br>      - inPath: id<br>        inCustomResource: status.server.id</pre><p>After redeploying, the full lifecycle worked:</p><ul><li><strong>Create</strong> → VM boots, status.server.id populated, status showsACTIVE + public IP, CR Ready=True.</li><li><strong>Delete</strong> → kubectl delete makes the operator issue DELETE with the real id, OVH removes the VM, the finalizer clears cleanly.</li></ul><pre>apiVersion: nova.openstack.krateo.io/v1alpha1<br>kind: Instance<br>metadata:<br>  name: kog-demo-1<br>spec:  # what you declare<br>  configurationRef:<br>    name: nova-config<br>  server:<br>    name: kog-demo-1<br>    flavorRef: 906e8259-…  # b2-7<br>    imageRef: e65d6156-…  # Ubuntu 24.04<br>    networks:<br>      - uuid: b2c02fdc-…  # Ext-Net<br>status:  # populated by the controller<br>  server:<br>    id: 39f18f87-0502-4e4b-9c0b-…<br>    status: ACTIVE<br>    addresses:<br>      Ext-Net:<br>        - addr: 217.182.163.210<br>          version: 4<br>  conditions:<br>    - type: Ready<br>      status: &quot;True&quot;</pre><h3><strong>Takeaways</strong></h3><ul><li><strong>“It renders” ≠ “it works.”</strong> Helm lint and schema validation passed for every one of these bugs. Four of five only surfaced against a live API. If you’re packaging an operator, your CI needs a real (or kind-hosted) reconcile, not justhelm template.</li><li><strong>Envelopes are the recurring villain.</strong> Nova’s { &quot;server&quot;: {...} } wrapper caused<em>both</em> the CRD-generation collision (Kind vs. property)<em>and</em> the identifier-extraction failure. When you wrap a request body, expect the response to be wrapped too, and configure for it.</li><li><strong>Read the generated artifacts.</strong> The biggest time sinks came from trusting an assumed framework model instead of inspecting the CRDs the generator actually produced.</li><li><strong>Generic operators are a real shortcut.</strong> Once the spec andRestDefinition are right, you get create/observe/delete reconciliation for an external API with<em>no</em> bespoke controller code. The leverage is enormous - the work is in describing the API precisely, including its quirks.</li></ul><h3>Try it</h3><p>A kind cluster, the Krateo oasgen-provider, this chart, and any OpenStack project (we used OVH Public Cloud) are all you need. The repo includes a full walkthrough ( docs/e2e.md) - bootstrap, token fetch, provision, and cleanup - and a short quickstart in the README.</p><pre>helm install oasgen-provider \<br>  krateo/oasgen-provider \<br>  -n krateo-system --create-namespace<br><br>helm install nova ./chart -n krateo-system \<br>  --set authBridge.upstreamUrl=&quot;$NOVA_URL&quot;<br><br>./scripts/get-token.sh --secret \<br>  | kubectl apply -f -<br><br>kubectl apply -f chart/samples/nova-auth.yaml<br><br>kubectl apply -f chart/samples/test-server.yaml<br><br>kubectl -n krateo-system \<br>  get instances.nova.openstack.krateo.io -w</pre><p>Then watch a row go Ready, and an actual VM appear in your OpenStack (OVH) console.</p><p><em>Don’t forget to </em><em>kubectl delete it - it bills by the hour.</em></p><p><em>Originally published at </em><a href="https://github.com/braghettos/openstack-nova-operator-kog/blob/fix/instance-kind-and-auth-model/docs/medium-article.md?v=2"><em>https://github.com</em></a><em>.</em></p><p>Full source, chart, and walkthrough on GitHub: <a href="https://github.com/braghettos/openstack-nova-operator-kog">https://github.com/braghettos/openstack-nova-operator-kog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70011b8e81f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we wrote an Internal Developer Portal based on a Cloud Management Platform approach]]></title>
            <link>https://medium.com/krateo-platformops/why-we-wrote-an-internal-developer-portal-based-on-a-cloud-management-platform-approach-8408cae66e71?source=rss-775fd005e54f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8408cae66e71</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[internaldeveloperplatform]]></category>
            <category><![CDATA[cloud-management-platform]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <dc:creator><![CDATA[Diego Braga]]></dc:creator>
            <pubDate>Sun, 05 Nov 2023 14:41:19 GMT</pubDate>
            <atom:updated>2023-11-05T14:41:19.131Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jr2pLm--Chx7l7v-" /><figcaption>Photo by <a href="https://unsplash.com/@nathangwaters?utm_source=medium&amp;utm_medium=referral">Nathan Waters</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A lot of buzzwords in a single — but not too long — title. That’s the problem we are living with nowadays: a huge hype with very few concrete solutions.</p><p>Let’s get practical: during the MVP validation we conducted more than 21 interviews with enterprise customers from different vertical markets (financial services, insurance, manufacturing, public administration, etc.) and we found the same issue every time: every company would like to offer a Cloud Service Provider experience to internal users (most of the time, developers) or external customers (B2B or B2C) leveraging the internal knowledge about infrastructure and cloud services enforced with compliance and security policies through a self-service portal, a.k.a. Internal Developer Portal.</p><p>It doesn’t matter if the company relies 100% on public cloud services or its datacenter is fully on-prem, the requirement is still there: a frictionless onboarding of developers that must push into production code as a core business in the most qualitative, safe, and quick way possible.</p><blockquote>Cloud management platforms (CMPs) enable organizations to manage private, public and multicloud services and resources. Their functionality combines provisioning and orchestration; service request management; inventory and classification; monitoring and analytics; cost management and resource optimization; cloud migration; backup and disaster recovery; and identity, security and compliance. Functionality can be provided by a single product or a set of offerings with some degree of integration. — Gartner</blockquote><p>Should you buy a CMP product or make your own?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3SRJFk3X1nUla7x2" /><figcaption>Photo by <a href="https://unsplash.com/@ivalex?utm_source=medium&amp;utm_medium=referral">Ivan Aleksic</a> on <a href="https://unsplash.com?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Every enterprise company has a different use case: different tools, different processes, different code collaboration models, different organizations, and different skills.</p><p>We decided to write <a href="https://krateo.io">Krateo PlatformOps</a> as a product that can be tailored to the specific customer use case. How?</p><p>First, we ensured that the customer had no lock-in on our platform. We had to find the most adopted industrial standard that enterprise companies are targeting. A standard that is vendor-neutral, open-source, and with a well-defined governance for contributors and maintainers. Does the word ‘<em>Kubernetes</em>’ ring you a bell?</p><blockquote><a href="https://kubernetes.io/docs/concepts/overview/">Kubernetes</a>, also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications. — kubernetes.io</blockquote><p>Let’s say that the previous sentence is partially true: Kubernetes does not only orchestrate containerized applications, but it can orchestrate whatever API can be called through a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/">Kubernetes Operator</a>:</p><blockquote>Operators are software extensions to Kubernetes that make use of <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/">custom resources</a> to manage applications and their components. Operators follow Kubernetes principles, notably the <a href="https://kubernetes.io/docs/concepts/architecture/controller">control loop</a>. — <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/operator/">https://kubernetes.io/docs/concepts/extend-kubernetes/operator/</a></blockquote><p>Kubernetes can act as an abstraction layer for orchestrating whatever service you want to be reached in your datacenter (on-prem, full public cloud, a hybrid model, a multi-cloud approach).</p><p>The Operator is pretty much similar to a microservice: it is atomic, reusable, with well-defined interfaces, with its lifecycle. There are different ways to implement an Operator — we even wrote our <a href="https://github.com/krateoplatformops/provider-runtime">runtime</a> that adds a few enterprise-ready functionalities on top of the official <a href="https://github.com/kubernetes-sigs/controller-runtime">controller-runtime</a>. I will write a specific article on that.</p><p>Writing Operators means that the Infrastructure &amp; Operations (I&amp;O) department must transition to a software-engineering approach instead of manually managing datacenter services. Every customer we interviewed admitted that they had a strong internal knowledge of how and which technologies compose their datacenter but they had different ways of managing them.</p><p>We found historical stratification of different orchestrating tools, due to a loosely imposed guidance to converge to a single approach and framework. Maintaining each of these layers is an increasing cost that will grow until a common model is adopted.</p><p>Let’s go back to Operators: each team, with a vertical competence domain on a certain technology, should write its operator or look at the market if the technology vendor is already offering one.</p><h4>Are you realizing that the initiative to create an internal developer community (maybe due to inner sourcing campaigns) could embrace not only application developers but also I&amp;O developers?</h4><p>Operators now are the atomic building blocks of your Internal Cloud Management Platform. How can you put them together to offer seamless end-to-end automation for the different services that will be published in the Internal Developer Platform? With services I mean everything, from infrastructure provisioning to developers onboarding to ordering your lunch food on Deliveroo — remember, an Operator can talk to any API you want to integrate.</p><p><a href="https://www.crossplane.io/">Crossplane</a> paved the way to compose together different Operators as a single one. The project took an opinionated approach on how Compositions should be written which is different from what the community is adopting as a framework to package together Kubernetes manifests — which is <a href="https://helm.sh/">Helm</a>. That’s why we wrote the <strong>Krateo Composable Operations</strong> module — you can give it a try by leveraging the dedicated scenario on Killercoda: <a href="https://killercoda.com/krateoplatformops/scenario/krateo-composable-operations">https://killercoda.com/krateoplatformops/scenario/krateo-composable-operations</a>.</p><p>The Platform Team within a company will write the Composition of the different Operators implemented by the vertical I&amp;O teams through a Helm chart. Kubernetes is the de-facto backend, orchestrator, and database of your Cloud Management Platform.</p><p>How do you offer your Compositions to your internal or external users? Through an Internal Developer Platform.</p><blockquote>Gartner defines internal developer portals as tools that enable self-service discovery, automation and access to reusable components, tools, platform services and knowledge assets in modern software development environments. The portals help improve developer experience and service reliability while enabling centralized governance and shared visibility across multiple teams. Capabilities include service and resource catalogs, scorecards to benchmark software quality and security, scaffolding templates for building new components and plug-ins for integrating with platform services. Platform engineering teams provide the portal to product development teams either as a stand-alone application or as integral components of DevOps platforms and broader internal developer platforms.</blockquote><p><a href="https://medium.com/krateo-platformops/krateo-recognised-as-a-representative-vendor-in-the-2023-gartner-market-guide-for-internal-216141010385">Don’t miss our previous article where we announced that Krateo has been recognized as a representative vendor in the 2023 Gartner market guide for internal developer portals.</a></p><p><a href="https://backstage.io/">Backstage</a> gained a lot of attention since its release and every alternative solution should compare to it to differentiate itself. The concepts behind the project are clear: the portal doesn’t act only as a trigger for self-service automation but it should centralize the governance and give visibility of all the relevant data that are usually scattered through different tools.</p><p>Cons of Backstage are the monolithic codebase and the requirement to know how to maintain Javascript code for the frontend and backend. We chose to maintain the core idea behind Backstage and write our own Internal Developer Portal, which is based on a completely declarative approach.</p><p>What does it mean to have a declarative portal? We’re not referring to a micro frontend approach. Our frontend renders at the client side and at runtime the components that are baked by our backend for frontend, which knows which components have been composed by the user (page layout, buttons, widgets, etc) and collects all the data that will fill the components for the frontend.</p><p>In this way, the user experience is always consistent. There’s no black box or monolithic approach. There’s no need to know how to maintain the codebase for a frontend or a backend. We can integrate with any API reachable from the backend for frontend. The Platform Team has the power to tailor the integrations of the entire toolchain by just writing YAML Custom Resource files and adding them to Kubernetes.</p><p>What about Role-Based Access Control?</p><p>We’re not a platform running on Kubernetes, we are eventually extending it. We leverage Kubernetes RBAC. If a user cannot delete a resource, that action won’t be allowed both from a Kubectl interaction but also from our portal.</p><p>What about Authentication?</p><p>From that perspective, Kubernetes allows us to integrate also custom Authentication method but that won’t be so easy when you’re leveraging Managed Kubernetes clusters. So we decided to stick with the default authentication method based on certificates. Who generates these certificates then? We implemented our authentication server, which serves basic auth, OAuth2, and LDAP protocols — in a declarative way. Once the user is authenticated, we generate the certificate leveraging Kubernetes <a href="https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/">Certificates and Certificate Signing Requests</a>.</p><p>In the following articles, we will dig deeper into Krateo PlatformOps v2 architecture but in the meantime, we would be happy to get your feedback about our design choice and use cases you think we are solving with our approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8408cae66e71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/krateo-platformops/why-we-wrote-an-internal-developer-portal-based-on-a-cloud-management-platform-approach-8408cae66e71">Why we wrote an Internal Developer Portal based on a Cloud Management Platform approach</a> was originally published in <a href="https://medium.com/krateo-platformops">Krateo PlatformOps</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>