X-ITM Insight

Kubernetes Umbrella Blueprint Patches: Why Composition Layers Break and How to Fix Them

A patch upgrade to a 34-component Kubernetes umbrella blueprint triggered a composition layer reset, deleting 31/34 Composition CRs. Learn why this happens, how to diagnose it, and how to prevent it without full re-creation.

Kubernetes Umbrella Blueprint Patches: Why Composition Layers Break and How to Fix Them

Managing multi-component Kubernetes deployments using umbrella blueprints is a powerful way to standardize infrastructure and applications. However, patch upgrades can introduce unexpected failures—such as the deletion of 31 out of 34 Composition Custom Resources (CRs) in a single upgrade—leaving teams scrambling to restore state. This incident, triggered by misalignment between Helm and umbrella gate mechanisms, highlights a critical blind spot in Kubernetes governance: composition layer resilience during upgrades.

In this guide, we’ll break down:

  • The technical mechanisms behind umbrella blueprint upgrades and why composition layers can reset
  • How to diagnose and recover from a composition layer reset without full re-creation
  • Best practices to prevent future incidents and ensure upgrade safety
  • When and how to leverage platform engineering expertise for large-scale Kubernetes governance

The Root Cause: Helm and Umbrella Gate Misalignment

Kubernetes umbrella blueprints (e.g., ClusterServiceVersion or Composition-based overlays) abstract complexity by managing dependencies across multiple components. When a patch upgrade occurs, the system must:

  1. Apply Helm chart updates to individual components
  2. Reconcile the umbrella’s Composition or ClusterServiceVersion resources
  3. Ensure no drift occurs between the Helm-managed state and the umbrella-managed state

In the observed incident, the upgrade process failed at step 3. The umbrella gate mechanism (likely a controller or admission webhook) interpreted the Helm patch as a full replacement of the component’s state, triggering a Composition CR deletion. This happened because:

  • Helm’s values.yaml or Chart.yaml changes were not flagged as compatible with the umbrella’s expected schema.
  • The umbrella gate lacked fine-grained reconciliation logic to distinguish between breaking and non-breaking Helm updates.
  • Composition CRs were not annotated with metadata.generation or status.conditions to track upgrade intent.

Diagnosing a Composition Layer Reset

If your umbrella blueprint’s Composition CRs vanish during an upgrade, follow these steps to diagnose the issue:

Step 1: Check the Upgrade Logs

Review the logs of the umbrella controller (e.g., ClusterServiceVersion or Composition controller) and Helm’s upgrade output. Look for:

  • Errors like Failed to reconcile Composition or ResourceNotFound.
  • Warnings about metadata.uid mismatches or status.conditions transitions.
  • Helm events indicating hook skipped or values changed.

Step 2: Inspect the Umbrella Gate’s Reconciliation Logic

Examine the umbrella’s reconciliation logic (e.g., in a Reconcile function or webhook). Key questions:

  • Does it treat all Helm updates as full replacements?
  • Are there checks for metadata.generation or status.observedGeneration?
  • Does it preserve Composition CRs during non-breaking updates?

Step 3: Audit the Helm Chart’s values.yaml

Compare the pre- and post-upgrade values.yaml files. Look for:

  • Changes to image.tags, replicaCount, or resources that might trigger a Composition reset.
  • Missing or conflicting annotations (e.g., helm.sh/resource-policy).
  • Deprecated fields that were removed in the patch.

Step 4: Verify CRD Shape Stability

Even if the Composition CRD shape didn’t change, the umbrella’s expected schema might have shifted. Check:

  • The umbrella’s spec.template.spec for Composition CRs.
  • Whether the Helm chart’s output matches the umbrella’s spec.selector or spec.targets.

Recovering Without Full Re-creation

If 31/34 Composition CRs were deleted, you don’t need to start from scratch. Here’s how to restore them:

Option 1: Reapply the Umbrella Blueprint Manually

Use kubectl apply -f to reapply the umbrella’s Composition manifests (e.g., from a backup or Git repo). Example:

kubectl apply -f umbrella-blueprint/compositions.yaml --server-side --force-conflicts

This bypasses the upgrade logic and restores the CRs. Warning: This may skip post-upgrade reconciliations (e.g., Helm hooks).

Option 2: Use Helm’s rollback to Revert Changes

If the Helm upgrade introduced breaking changes, roll back to the pre-upgrade state:

helm rollback  

Then manually reapply the Composition CRs. This ensures Helm and umbrella states align.

Option 3: Patch the Umbrella Gate for Resilience

If the issue persists, modify the umbrella’s reconciliation logic to:

  • Preserve Composition CRs during non-breaking Helm updates (e.g., image.tag changes).
  • Use metadata.generation to track upgrade intent.
  • Add annotations like helm.sh/resource-policy: keep to critical Composition CRs.

Example patch for a Composition CR:

apiVersion: apiextensions.k8s.io/v1
kind: Composition
metadata:
  name: example-composition
  annotations:
    helm.sh/resource-policy: keep  # Prevent deletion during upgrades
spec:
  # ...

Preventing Future Incidents

To avoid composition layer resets in future upgrades, adopt these practices:

1. Design Helm and Umbrella Blueprints for Upgrade Safety

  • Use semantic versioning in Helm charts to signal breaking changes (e.g., Chart.yaml appVersion).
  • Annotate Composition CRs with helm.sh/resource-policy: keep for stable resources.
  • Implement a dry-run mode in the umbrella gate to test upgrades before applying them.

2. Automate Pre-Upgrade Validation

  • Run a kubectl diff before applying Helm upgrades to check for Composition CR conflicts.
  • Use kubectl get compositions -o jsonpath='{.metadata.generation}' to track generations.
  • Integrate a pre-upgrade hook that validates Helm values against the umbrella’s expected schema.

3. Document Upgrade Paths

  • Maintain a UPGRADE.md file in your umbrella blueprint repo listing breaking changes and mitigation steps.
  • Tag Composition CRs with upgrade-path: v1->v2 annotations for clarity.

4. Monitor for Drift

  • Use kubectl get compositions --watch during upgrades to detect deletions early.
  • Set up alerts for Composition CRs with status.conditions:

    Apply this to your environment.

    If this problem exists in your estate, we can review the current architecture and determine whether an assessment, pilot or engineering engagement makes sense.

    Book a Technical Discovery