Sitemap
ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Multi-Environment Helm: Mastering Variants with ConfigHub

6 min readDec 8, 2025

--

In our previous post, we introduced ConfigHub’s Configuration as Data to Helm. We explored the practice of storing fully rendered Helm chart output as the authoritative source of truth in a database. We demonstrated how ConfigHub utilizes the official Helm SDK to maintain full life-cycle compatibility — including Helm’s hooks — while treating manifests as queryable, versioned data rather than ephemeral artifacts.

Press enter or click to view image in full size
Cloning Helm Chart Variants — Image Generated by Gemini Nanobanana

But once you render Helm charts into plain YAML, a new question arises: How do you handle environment-specific customization?

Since its inception, the Helm community has relied on values.yaml files to manage differences between development, staging, and production. However, relying on templates for state management creates a “Visibility Gap” that becomes painfully obvious when you try to answer simple questions about your infrastructure.

The “Fire Drill” Scenario

Imagine your security team sends an urgent Slack message:

“We need to know which deployments across all our environments are using images from registry.compromised.com. We need a list by end-of-day.”

With traditional Helm, this simple query triggers complex work. If you have eight environments, each with its own values.yamlscattered across Git repositories, you cannot simply “grep” for the image. The image URL might be constructed dynamically inside a template helper function.

To answer, you have to:

  1. Loop through every environment’s values file.
  2. Run helm template for every release to resolve the logic.
  3. Parse thousands of lines of generated YAML.
  4. Aggregate the results.

You are essentially writing a custom script just to answer a basic question. This is the fundamental problem with the template-based approach: you cannot ask questions about your configuration without first rendering it.

The templates are authoritative, but the actual configuration running in your cluster is ephemeral — generated on demand and immediately discarded. This creates a “Visibility Gap.”

The Visibility Gap: A Case Study

Let’s look at the kube-prometheus-stack. If you run Kubernetes in production, you are likely to use this chart. It is a comprehensive, production-ready monitoring solution.

It is also massive. The default values.yaml is over 5,000 lines long, containing nested configurations for Grafana, Prometheus, Alertmanager, and various exporters.

Now, imagine trying to answer this question: “What is the actual difference between my Dev and Prod monitoring stacks?”

In the traditional workflow, you have values-dev.yaml and values-prod.yaml. To find the truth, you must render Dev, render Prod, diff the massive outputs, and parse 2,000+ lines of context to find meaningful changes. You cannot simply look at the files to understand the state of your system; you have to mentally compile the code.

Press enter or click to view image in full size
The Prometheus Section in the default values file.

The ConfigHub Approach: Render Once, Clone Anywhere

ConfigHub takes a different path. Instead of storing the recipe (templates + values), we store the cake (the rendered manifests) as structured, queryable data.

When you install a chart with ConfigHub, we use Helm’s engine to generate the YAML once, then store it. To handle multiple environments, we utilize Spaces, Cloning, and Variants.

Step 1: Establish the Base (Infra Space)

First, we create a space for our infrastructure base and install the chart.

# Add Prometheus Community's Helm repo
helm repo add prometheus-community \
https://prometheus-community.github.io/helm-charts
helm repo update

# Create infra space
cub space create infra

# Install the chart. ConfigHub renders it and stores the result.
cub helm install --space infra \
--use-placeholder=false \
--namespace monitoring \
prometheus prometheus-community/kube-prometheus-stack \
--version 79.6.1

Step 2: Creating Environments via Spaces

Next, we prepare our target environments.

# Create dev and prod spaces for each environment
cub space create dev
cub space create prod

Alternatively, you can create spaces via the ConfigHub UI by finding the [Add] button on the Space Listing Page.

Press enter or click to view image in full size
Space Listing Page — you could find the [Add] button on the top-right for creating a new space.
Press enter or click to view image in full size
Type a new space name and click [Save] to create it.

Step 3: Cloning and Variants

Now that we have the infra space with our base units, we need to create Variants for our specific environments.

Get Chanwit Kaewkasi’s stories in your inbox

Join Medium for free to get updates from this writer.

A Variant is a fundamental concept in ConfigHub: it is a customized copy of a Config Unit, created via the Clone operation.

We will clone the Prometheus chart from infra to dev to create the Dev Variant. Then, we will clone from dev to prod to create the Prod Variant.

  1. Create Dev Variant: Select chart units from the infra space, choose the dev space as the destination, and click [Clone Units].
  2. Create Prod Variant: Select units from the dev space, choose the prod space as the destination, and click [Clone].
Press enter or click to view image in full size
Select chart units from the infra space to clone as the Dev Variants.
Press enter or click to view image in full size
Choose the destination (which is the dev space) and click [Clone Units] to do so.

This creates a lineage of configuration:

[infra's Helm charts] → [dev's Helm charts] → [prod's Helm charts]

The Kustomize Connection

If this concept looks familiar, it works similarly to creating an “Overlay” in Kustomize. We start with the base resources and then add the “Dev Overlays” on top of them. However, ConfigHub Variants are designed to be much more intuitive and visible. This isn’t a coincidence. Brian Grant, our CTO, is the original creator of Kustomize. In many ways, the Variant concept was invented to solve the pain points of managing complex overlays, making inheritance and divergence clear and manageable.

Immediate Visibility

After cloning, you don’t need to run a template engine to guess what your configuration looks like. You can retrieve the exact data from your new Variants immediately:

# See the rendered content for the Dev environment
cub unit get --space dev prometheus --data-only

# See the rendered content for the Prod environment
cub unit get --space prod prometheus --data-only

You see the actual manifest. Not a template, not a variable reference, but the literal YAML that determines whether your monitoring stack works or crashes.

Solving the “Fire Drill”

Because we have cloned our variants and stored them as data, we can now solve the security scenario mentioned at the start of this article without rendering a single template.

For example, if we have an image in a compromised registry like this used by a Prometheus resource,

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus-kube-prometheus-prometheus
namespace: monitoring
spec:
image: "registry.compromised.com/prometheus/prometheus:v3.7.3" # <- this
imagePullPolicy: "IfNotPresent"
version: v3.7.3
externalUrl: http://prometheus-kube-prometheus-prometheus.monitoring:9090

To find that compromised image across all environments (Spaces) and Variants, we simply query the database:

# Finding compromised images
cub unit list --space "*" \
--resource-type monitoring.coreos.com/v1/Prometheus \
--where-data "spec.image ~ '.*registry.compromised.com.*'"
NAME SPACE CHANGESET TARGET STATUS LAST-ACTION UPGRADE-NEEDED UNAPPLIED-CHANGES APPLY-GATES LAST-CHANGE-DESCRIPTION
prometheus prod prod-cluster NotLive ? No Yes None change registry to registry.compromised.com

# Finding normal images
cub unit list --space "*" \
--resource-type monitoring.coreos.com/v1/Prometheus \
--where-data "spec.image ~ '.*quay.io.*'"
NAME SPACE CHANGESET TARGET STATUS LAST-ACTION UPGRADE-NEEDED UNAPPLIED-CHANGES APPLY-GATES LAST-CHANGE-DESCRIPTION
prometheus dev dev-cluster Ready ? No None Functions: set-replicas
prometheus infra NotLive ? None Restored revision 2

One query. Zero rendering. Instant answers.

Why “Configuration as Data” Matters

Moving from a template-heavy workflow to a Clone-and-Variant workflow changes the DevOps experience:

  • No More Mental Rendering: You never have to guess what a template will produce. You can query the system at any time to see the literal YAML that will be applied to Dev or Prod.
  • Auditability: Because every environment is a distinct Space with distinct Variants, you have a clear boundary between what is running where.
  • Validation that Works: Because we store rendered manifests, you can run policies (via OPA or CEL) on the actual data before deployment. You validate the configuration, not the template.

ConfigHub doesn’t replace Helm, it elevates it. We use the Helm SDK to ensure that hooks, release tracking, and garbage collection work exactly as you expect, but we change how you manage the output.

We now have preview access to ConfigHub. If you are ready to move beyond the complexity of values files and embrace Variants, we’d love to hear from you. Also, explore our open-source SDK to see how we are bringing these two worlds together.

--

--

Chanwit Kaewkasi
Chanwit Kaewkasi

Written by Chanwit Kaewkasi

Cogentica.AI. ex-ConfigHub, ex-weaveworks. Go nut since r57 (pre v1). creator Goish Rust.

ITNEXT
ITNEXT

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.