What is `helm.sh/resource-policy: keep`?
IntermediateConceptHelm 3 Architecture & Release Storage
Answer
An annotation that tells Helm not to delete the resource during helm uninstall, or when it disappears from the chart during an upgrade. The object becomes orphaned and must be deleted by hand.
metadata:
annotations:
helm.sh/resource-policy: keep
We use it on PersistentVolumeClaims and on generated Secrets (database passwords) so an accidental uninstall does not destroy data. Remember that reinstalling will then hit "resource already exists" unless the ownership annotations still match.
More on Helm 3 Architecture & Release Storage
What is Helm, in one sentence?BeginnerDefine chart, release, revision and repository.BeginnerWhat was Tiller and why was it removed in Helm 3?BeginnerWhere does Helm 3 store release information?BeginnerWhat is inside a release Secret and how do you decode it?AdvancedWhat storage drivers does Helm support and how do you switch?Advanced