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:
- Apply Helm chart updates to individual components
- Reconcile the umbrella’s
CompositionorClusterServiceVersionresources - 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.yamlorChart.yamlchanges 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.
CompositionCRs were not annotated withmetadata.generationorstatus.conditionsto 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 CompositionorResourceNotFound. - Warnings about
metadata.uidmismatches orstatus.conditionstransitions. - Helm events indicating
hook skippedorvalues 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.generationorstatus.observedGeneration? - Does it preserve
CompositionCRs 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, orresourcesthat might trigger aCompositionreset. - 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.specforCompositionCRs. - Whether the Helm chart’s output matches the umbrella’s
spec.selectororspec.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
CompositionCRs during non-breaking Helm updates (e.g.,image.tagchanges). - Use
metadata.generationto track upgrade intent. - Add annotations like
helm.sh/resource-policy: keepto criticalCompositionCRs.
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.yamlappVersion). - Annotate
CompositionCRs withhelm.sh/resource-policy: keepfor 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 diffbefore applying Helm upgrades to check forCompositionCR 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.mdfile in your umbrella blueprint repo listing breaking changes and mitigation steps. - Tag
CompositionCRs withupgrade-path: v1->v2annotations for clarity.
4. Monitor for Drift
- Use
kubectl get compositions --watchduring upgrades to detect deletions early. - Set up alerts for
CompositionCRs withstatus.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