<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guide on helm-schema</title><link>https://romnn.github.io/helm-schema/docs/guide/</link><description>Recent content in Guide on helm-schema</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://romnn.github.io/helm-schema/docs/guide/index.xml" rel="self" type="application/rss+xml"/><item><title>Template analysis</title><link>https://romnn.github.io/helm-schema/docs/guide/template-analysis/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/template-analysis/</guid><description>&lt;h1 id="template-analysis"&gt;Template analysis&lt;a class="anchor" href="#template-analysis"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The core of &lt;code&gt;helm-schema&lt;/code&gt; is reading the chart&amp;rsquo;s templates. This page explains what it extracts and how the control flow around a value shapes the schema — which is what lets you predict the output.&lt;/p&gt;
&lt;h2 id="value-extraction"&gt;Value extraction&lt;a class="anchor" href="#value-extraction"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Every &lt;code&gt;.Values.*&lt;/code&gt; path that appears in render logic is collected — from manifests, from &lt;code&gt;_helpers.tpl&lt;/code&gt; helpers, and from YAML fragments loaded via &lt;code&gt;.Files.Get&lt;/code&gt; with a literal path. It reads the template&amp;rsquo;s real structure, so quoting, pipelines, nested calls, and whitespace trimming (&lt;code&gt;{{-&lt;/code&gt;/&lt;code&gt;-}}&lt;/code&gt;) are all handled correctly rather than approximated.&lt;/p&gt;</description></item><item><title>Values &amp; defaults</title><link>https://romnn.github.io/helm-schema/docs/guide/values-and-defaults/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/values-and-defaults/</guid><description>&lt;h1 id="values--defaults"&gt;Values &amp;amp; defaults&lt;a class="anchor" href="#values--defaults"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Beyond where a value is &lt;em&gt;used&lt;/em&gt;, &lt;code&gt;helm-schema&lt;/code&gt; looks at how the chart &lt;em&gt;defaults&lt;/em&gt; it — both the composed &lt;code&gt;values.yaml&lt;/code&gt; document and &lt;code&gt;default&lt;/code&gt; expressions in templates.&lt;/p&gt;
&lt;h2 id="the-composed-values-document"&gt;The composed values document&lt;a class="anchor" href="#the-composed-values-document"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before analysis, the tool builds one effective values document:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the root &lt;code&gt;values.yaml&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;each subchart&amp;rsquo;s defaults merged under its dependency key,&lt;/li&gt;
&lt;li&gt;subchart &lt;code&gt;global&lt;/code&gt; merged into the top-level &lt;code&gt;global&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This composed document seeds the schema&amp;rsquo;s shape and supplies the default value for each path. Use &lt;code&gt;--no-subchart-values&lt;/code&gt; to omit vendored subchart defaults under &lt;code&gt;charts/&lt;/code&gt; (see &lt;a href="https://romnn.github.io/helm-schema/docs/guide/subcharts/"&gt;Subcharts&lt;/a&gt;).&lt;/p&gt;</description></item><item><title>Kubernetes schemas</title><link>https://romnn.github.io/helm-schema/docs/guide/kubernetes-schemas/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/kubernetes-schemas/</guid><description>&lt;h1 id="kubernetes-schemas"&gt;Kubernetes schemas&lt;a class="anchor" href="#kubernetes-schemas"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;When a value flows into a built-in Kubernetes resource field, &lt;code&gt;helm-schema&lt;/code&gt; types it from the upstream Kubernetes JSON schema for that resource. This is what turns &lt;code&gt;spec.replicas&lt;/code&gt; into an &lt;code&gt;int32&lt;/code&gt; with the API&amp;rsquo;s own description, or a &lt;code&gt;resources&lt;/code&gt; block into the full &lt;code&gt;ResourceRequirements&lt;/code&gt; shape.&lt;/p&gt;
&lt;p&gt;Schemas are fetched on demand from the upstream catalog and cached locally. The upstream source is authoritative; the &lt;a href="https://romnn.github.io/helm-schema/docs/reference/caching/"&gt;cache&lt;/a&gt; only makes repeat lookups fast.&lt;/p&gt;
&lt;h2 id="choosing-the-version"&gt;Choosing the version&lt;a class="anchor" href="#choosing-the-version"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm-schema ./mychart --k8s-version v1.34.0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;--k8s-version&lt;/code&gt; selects the Kubernetes minor version whose schemas are consulted. The default is &lt;strong&gt;&lt;code&gt;v1.35.0&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>CRD schemas</title><link>https://romnn.github.io/helm-schema/docs/guide/crd-schemas/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/crd-schemas/</guid><description>&lt;h1 id="crd-schemas"&gt;CRD schemas&lt;a class="anchor" href="#crd-schemas"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Charts that deploy custom resources — a &lt;code&gt;ServiceMonitor&lt;/code&gt;, a &lt;code&gt;Certificate&lt;/code&gt;, an operator&amp;rsquo;s CRD — need schemas that aren&amp;rsquo;t part of the built-in Kubernetes API. &lt;code&gt;helm-schema&lt;/code&gt; resolves those against a &lt;strong&gt;CRD catalog&lt;/strong&gt;, using the same lookup order as built-in resources, with your local overrides at the top.&lt;/p&gt;
&lt;p&gt;The lookup order for any grouped resource is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;local overrides&lt;/strong&gt; (&lt;code&gt;--crd-override-dir&lt;/code&gt;) — authoritative,&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;the CRD catalog&lt;/strong&gt; (fetched and cached, per version),&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;upstream Kubernetes JSON schemas&lt;/strong&gt; (for built-in kinds).&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="version-lookup-strict-vs-loose"&gt;Version lookup: strict vs loose&lt;a class="anchor" href="#version-lookup-strict-vs-loose"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm-schema ./mychart --crd-version-lookup strict &lt;span class="c1"&gt;# default&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm-schema ./mychart --crd-version-lookup loose&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;strict&lt;/code&gt;&lt;/strong&gt; (default) consults only the exact &lt;code&gt;(group, kind, version)&lt;/code&gt; the chart pinned. A CRD version is never substituted — pinning &lt;code&gt;v1&lt;/code&gt; and getting a &lt;code&gt;v1alpha1&lt;/code&gt; schema would be wrong.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;loose&lt;/code&gt;&lt;/strong&gt; resolves identically (still no substitution), but additionally scans the local cache for &lt;em&gt;other&lt;/em&gt; versions of the same &lt;code&gt;(group, kind)&lt;/code&gt;. When the requested version is missing but others are present, it emits a &lt;a href="https://romnn.github.io/helm-schema/docs/reference/diagnostics/"&gt;&lt;code&gt;CrdVersionAvailableAtOtherVersions&lt;/code&gt;&lt;/a&gt; hint — informational only.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;--strict-crd-version&lt;/code&gt; is a short alias for &lt;code&gt;--crd-version-lookup=strict&lt;/code&gt;, kept for symmetry with the other strict flags.&lt;/p&gt;</description></item><item><title>Subcharts &amp; dependencies</title><link>https://romnn.github.io/helm-schema/docs/guide/subcharts/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/subcharts/</guid><description>&lt;h1 id="subcharts--dependencies"&gt;Subcharts &amp;amp; dependencies&lt;a class="anchor" href="#subcharts--dependencies"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;helm-schema&lt;/code&gt; analyzes a chart together with its vendored dependencies, so the schema covers values consumed by subcharts too.&lt;/p&gt;
&lt;h2 id="discovery"&gt;Discovery&lt;a class="anchor" href="#discovery"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Chart discovery reads &lt;code&gt;Chart.yaml&lt;/code&gt; (and &lt;code&gt;Chart.template.yaml&lt;/code&gt;) and walks dependencies under &lt;code&gt;charts/&lt;/code&gt; — both unpacked directories and packaged &lt;code&gt;.tgz&lt;/code&gt;/&lt;code&gt;.tar.gz&lt;/code&gt; archives. Each dependency&amp;rsquo;s templates are analyzed, and the values it consumes appear in the schema under its dependency key.&lt;/p&gt;
&lt;h2 id="composed-values-and-global"&gt;Composed values and &lt;code&gt;global&lt;/code&gt;&lt;a class="anchor" href="#composed-values-and-global"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The effective values document merges:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the parent chart&amp;rsquo;s &lt;code&gt;values.yaml&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;each subchart&amp;rsquo;s defaults, nested under its dependency key,&lt;/li&gt;
&lt;li&gt;each subchart&amp;rsquo;s &lt;code&gt;global&lt;/code&gt; values, merged into the top-level &lt;code&gt;global&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That mirrors how Helm itself composes values, so a value a subchart reads from &lt;code&gt;.Values.global.*&lt;/code&gt; and one the parent sets under &lt;code&gt;subchartName.*&lt;/code&gt; both land where the schema expects them.&lt;/p&gt;</description></item><item><title>Schema overrides</title><link>https://romnn.github.io/helm-schema/docs/guide/overrides/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/helm-schema/docs/guide/overrides/</guid><description>&lt;h1 id="schema-overrides"&gt;Schema overrides&lt;a class="anchor" href="#schema-overrides"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Static analysis can&amp;rsquo;t recover everything — a value assembled through a dynamically-computed key, a field an outer pipeline injects at render time, or a type the templates simply never pin down. For those residual cases, post-process the generated schema with one or more &lt;strong&gt;override schemas&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;helm-schema ./mychart &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --override-schema ../schemas/injected-keys.override.json &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --override-schema ./schema-override.json &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; --output values.schema.json&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;--override-schema&lt;/code&gt; is &lt;strong&gt;repeatable&lt;/strong&gt;. Files are applied in the order given, each merged on top of the previous result. A common split is a shared cross-chart override (for example, top-level keys an outer templating pipeline injects and &lt;code&gt;helm-schema&lt;/code&gt; can&amp;rsquo;t see in &lt;code&gt;values.yaml&lt;/code&gt;) followed by a chart-specific override.&lt;/p&gt;</description></item></channel></rss>