dcg

Helm

kubernetes.helm

Protects against destructive Helm operations like uninstall and rollback without dry-run

  • 4blocking rules
  • 12safe patterns
  • 1Critical
  • 3High
~/.config/dcg/config.toml
[packs]
enabled = ["kubernetes.helm"]

Evaluated when a command contains helm, uninstall, delete, rollback.

Blocking rules

Each rule ID is kubernetes.helm:<name>. Use it in allowlists and [policy.rules].

  1. uninstall

    Critical

    helm uninstall removes the release and all its resources. Use --dry-run first.

    Explanation
    helm uninstall deletes the release and ALL Kubernetes resources created by it: - Deployments, services, and pods are terminated - ConfigMaps and secrets are deleted - Persistent volume claims may be deleted (depends on chart) - Release history is purged (no rollback possible) Safer alternatives: - helm uninstall <release> --dry-run: Preview what will be deleted - helm status <release>: Review current release state - helm get all <release>: See all resources managed by release - helm get manifest <release>: Get the actual Kubernetes manifests
  2. rollback

    High

    helm rollback reverts to a previous release. Use --dry-run to preview changes.

    Explanation
    helm rollback reverts the release to a previous revision. This can cause unexpected behavior if the previous version differs significantly: - Pod configurations are reverted (may break dependencies) - ConfigMaps and secrets are rolled back - Database migrations are NOT automatically undone - Downtime may occur during the transition Safer alternatives: - helm rollback <release> <revision> --dry-run: Preview changes - helm history <release>: Review available revisions - helm diff rollback <release> <revision>: Compare changes (requires diff plugin)
  3. upgrade-force

    High

    helm upgrade --force deletes and recreates resources, causing downtime.

    Explanation
    The --force flag causes Helm to delete and recreate resources instead of updating them in place. This can cause service disruption: - Pods are terminated and recreated (downtime between) - Persistent volume claims may be deleted and recreated - In-flight requests are dropped during recreation - Service IP addresses may change Safer alternatives: - Remove --force to use rolling updates - helm upgrade --dry-run --debug: Preview changes - helm diff upgrade: Compare before upgrading (requires diff plugin)
  4. upgrade-reset-values

    High

    helm upgrade --reset-values discards all previously set values.

    Explanation
    The --reset-values flag discards all values from previous releases, using only chart defaults and explicitly provided values. This can unexpectedly change: - Resource limits and replica counts - Database connection strings and credentials - Feature flags and environment variables - Any customization from previous 'helm upgrade' commands Safer alternatives: - helm get values <release>: Review current values first - helm upgrade --reuse-values: Keep existing values (default) - helm upgrade -f values.yaml: Explicitly set all needed values

Safe patterns

Checked first. A command that matches one is never blocked by this pack.

  • helm-list
  • helm-status
  • helm-history
  • helm-show
  • helm-inspect
  • helm-get
  • helm-search
  • helm-repo
  • helm-dry-run
  • helm-template
  • helm-lint
  • helm-diff