microk8s icon indicating copy to clipboard operation
microk8s copied to clipboard

Cloudnative-pg addon enable fails / CustomResourceDefinition is invalid

Open RedLine89 opened this issue 11 months ago • 1 comments

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)

RedLine89 avatar Jan 03 '25 22:01 RedLine89

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

louiseschmidtgen avatar Jan 09 '25 08:01 louiseschmidtgen