Interview Prep/Helm/Release Lifecycle, Repositories & OCI

How does `--force` behave on upgrade, and why is it risky?

AdvancedConceptRelease Lifecycle, Repositories & OCI
Answer

In Helm 3, --force replaces resources (delete and recreate via a PUT replace) instead of patching. It can get past some immutable-field errors, but it causes downtime for replaced objects and fails on fields the API server defaults, such as a Service's clusterIP:

Error: UPGRADE FAILED: failed to replace object: Service "shop-api" is invalid: spec.clusterIP: Invalid value: "": field is immutable

We avoid it. For immutable selector changes we orphan-delete the specific Deployment and upgrade normally. Helm 4 renames it --force-replace.

All Helm questions Roadmap: Helm

More on Release Lifecycle, Repositories & OCI