kubectl apply -f https://raw.githubusercontent.com/percona/percona-server-mongodb-operator/v1.14.0/deploy/crd.yaml
Warning: resource customresourcedefinitions/perconaservermongodbs.psmdb.percona.com is missing the kubectl.kubernetes.io/last-applied-configuration annotation which is required by kubectl apply. kubectl apply should only be used on resources created declaratively by either kubectl create --save-config or kubectl apply. The missing annotation will be patched automatically.
The CustomResourceDefinition “perconaservermongodbs.psmdb.percona.com” is invalid: metadata.annotations: Too long: must have at most 262144 bytes
If using --server-side, there will be no errors. But if applying cr.yaml then you get this issue
error: error validating “generated-luz-mongodb-01-cluster.yaml”: error validating data: ValidationError(PerconaServerMongoDB.spec.replsets.expose): unknown field “clusterServiceDNSMode” in com.percona.psmdb.v1.PerconaServerMongoDB.spec.replsets.expose; if you choose to ignore these errors, turn validation off with --validate=false
which needs to be fixed with --validate=false
which then can cause other issues, because validation is turned off.
=> pls make the crd.yaml pass the size check !
Hi @jamoser ,
For installing CRD, kindly follow the steps mentioned in Percona documentation. Post that if you still face issue, kindly let us know.
For cr.yaml validation, “clusterServiceDNSMode” should be under “spec:” section instead of “spec.replsets.expose”. Kindly refer the link for cr.yaml.
You should read my post more carefully:
creates more problems then it solves. The issue why this has to be used is because the crd.yaml is too large.
But what to do when we use the helm chart
We are still facing same issue with the chart and we can’t use --server-side in that case
Found it !
@jamoser validation passes fine if you deploy the crd with --server-side on a fresh installation. If you try to apply it without it and then add a server-side validation error would appear. It is just how k8s works.
The size of the CRD is bigger as we are using openAPI to validate CRDs as the best practice.
@Mehdi_BF you are right, this is the way to go. I have a blog post it here for PostgreSQL and ArgoCD: Deploy PostgreSQL on Kubernetes Using GitOps and ArgoCD