First Render
What problem this solves
Use the render-only path when your application needs Kubernetes YAML for preview, validation, policy checks, GitOps output, or drift detection without mutating a cluster.
Packages to install
powershell
dotnet add package HelmSharp.Chart --version 1.1.0
dotnet add package HelmSharp.Engine --version 1.1.0Minimal complete code
csharp
public static async Task<RenderedChartPreview> RenderFirstChartAsync(
string chartPath,
string valuesPath,
CancellationToken cancellationToken)
{
var chart = await HelmChartLoader.LoadAsync(chartPath, cancellationToken);
var values = await HelmValues.BuildAsync(
chart: chart,
valuesFiles: [valuesPath],
valuesContent: null,
setValues: new Dictionary<string, string>
{
["image.tag"] = "1.25.3",
["replicaCount"] = "2"
},
setFileValues: null,
setStringValues: null,
setJsonValues: null,
cancellationToken: cancellationToken);
var renderer = new HelmTemplateRenderer(chart, "demo", "default", values);
return new RenderedChartPreview(
Manifest: renderer.Render(),
Notes: renderer.RenderNotes());
}Why these APIs
HelmChartLoader.LoadAsync loads Chart.yaml, values.yaml, templates, CRDs, files, dependencies, and subcharts. HelmValues.BuildAsync applies Helm-style values precedence. HelmTemplateRenderer.Render() returns rendered manifests, while RenderNotes() returns NOTES.txt.
Production notes
- Pass absolute chart paths from your service boundary so diagnostics are reproducible.
- Capture the values inputs used for each preview; the manifest is only explainable with the values set that produced it.
- Use Live Compare or the Helm CLI golden tests when investigating chart-specific differences.
Next step
Read Values to model user overrides correctly.