Cloudnative-pg addon enable fails / CustomResourceDefinition is invalid
Summary
Cloudnative-PG installation fails when microk8s enable cloudnative-pg is executed.
Error in CLI: The CustomResourceDefinition "poolers.postgresql.cnpg.io" is invalid: metadata.annotations: Too long: must have at most 262144 bytes
What Should Happen Instead?
Cloudnative-PG plugin should get installed with no errors.
Reproduction Steps
Simply run microk8s enable cloudnative-pg. I am running microk8s in Multipass, but I don't think that it is related.
Can you suggest a fix?
Adding --server-side flag to /var/snap/microk8s/common/addons/community/addons/cloudnative-pg/enable script fixes the issue.
Like this:
cnpg_apply_manifest() {
apply_wait=$("${SNAP_DATA}"/bin/kubectl-cnpg install generate | $KUBECTL apply --server-side -f - > /dev/null)
Hello @RedLine89,
This issue seems related to https://github.com/canonical/microk8s/issues/4801.
I can not reproduce your issue on MicroK8s v1.31.3 on x86_64 architecture.
I suspect the issue may be caused by your architecture.
What version of Microk8s are you running on and which architecture are you using?
Best regards, Louise