postgres-operator-examples icon indicating copy to clipboard operation
postgres-operator-examples copied to clipboard

Helm do not update CRDs

Open borgez opened this issue 4 years ago • 4 comments

https://helm.sh/docs/topics/charts/

Limitations on CRDs Unlike most objects in Kubernetes, CRDs are installed globally. For that reason, Helm takes a very cautious approach in managing CRDs. CRDs are subject to the following limitations:

CRDs are never reinstalled. If Helm determines that the CRDs in the crds/ directory are already present (regardless of version), Helm will not attempt to install or upgrade. CRDs are never installed on upgrade or rollback. Helm will only create CRDs on installation operations. CRDs are never deleted. Deleting a CRD automatically deletes all of the CRD's contents across all namespaces in the cluster. Consequently, Helm will not delete CRDs. Operators who want to upgrade or delete CRDs are encouraged to do this manually and with great care.

borgez avatar Sep 01 '21 11:09 borgez

Gatekeeper has a specific Job for this, using kubectl apply.

See https://github.com/open-policy-agent/gatekeeper/pull/1485

sathieu avatar Sep 22 '21 09:09 sathieu

@jkatz

What is the proper solution in the meantime. Just copy the content of the latest version and use kubectl edit on the cluster?

ZuSe avatar Nov 03 '21 16:11 ZuSe

Effectively what is said in the original post:

Operators who want to upgrade or delete CRDs are encouraged to do this manually and with great care.

https://helm.sh/docs/topics/charts/#custom-resource-definitions-crds

You can follow the kustomize instructions for upgrades.

jkatz avatar Nov 03 '21 17:11 jkatz

WDYT about the alternatives presented here: https://github.com/CrunchyData/postgres-operator-examples/issues/59

ron1 avatar Nov 18 '21 19:11 ron1

Closing this as near-enough a duplicate of #59 + I've captured it in our backlog

benjaminjb avatar Oct 14 '22 19:10 benjaminjb