Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid CRD spec, creation fail #16

Closed
immanuelfodor opened this issue Aug 8, 2020 · 3 comments
Closed

Invalid CRD spec, creation fail #16

immanuelfodor opened this issue Aug 8, 2020 · 3 comments

Comments

@immanuelfodor
Copy link

immanuelfodor commented Aug 8, 2020

Coming from minio/operator#241 I tried to deploy direct-csi in the cluster but I get an error for the CRD at applying the config.

DIRECT_CSI_DRIVES=data{1...4} DIRECT_CSI_DRIVES_DIR=/srv/minio-pv KUBELET_DIR_PATH=/var/lib/kubelet kubectl create --dry-run=client -o yaml -k github.com/minio/direct-csi > minio-direct-csi.yaml
kubectl apply -f minio-direct-csi.yaml
namespace/direct-csi created
storageclass.storage.k8s.io/direct.csi.min.io created
serviceaccount/direct-csi-min-io created
clusterrole.rbac.authorization.k8s.io/direct-csi-min-io created
clusterrolebinding.rbac.authorization.k8s.io/direct-csi-min-io created
configmap/direct-csi-config created
secret/direct-csi-min-io created
service/direct-csi-min-io created
deployment.apps/direct-csi-controller-min-io created
daemonset.apps/direct-csi-min-io created
csidriver.storage.k8s.io/direct.csi.min.io created
The CustomResourceDefinition "storagetopologies.direct.csi.min.io" is invalid: spec.validation.openAPIV3Schema.properties[metadata]: Forbidden: must not specify anything other than name and generateName, but metadata is implicitly specified
kubectl get all
NAME                                               READY   STATUS    RESTARTS   AGE
pod/direct-csi-controller-min-io-57dbfcdb4-9jxjj   2/2     Running   0          16s
pod/direct-csi-controller-min-io-57dbfcdb4-qbf4r   2/2     Running   0          16s
pod/direct-csi-controller-min-io-57dbfcdb4-qthm2   2/2     Running   0          16s
pod/direct-csi-min-io-26t2r                        3/3     Running   0          16s
pod/direct-csi-min-io-lxc84                        3/3     Running   0          16s
pod/direct-csi-min-io-plmll                        3/3     Running   0          16s

NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)     AGE
service/direct-csi-min-io   ClusterIP   10.43.70.228   <none>        12345/TCP   16s

NAME                               DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/direct-csi-min-io   3         3         3       3            3           <none>          16s

NAME                                           READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/direct-csi-controller-min-io   3/3     3            3           16s

NAME                                                     DESIRED   CURRENT   READY   AGE
replicaset.apps/direct-csi-controller-min-io-57dbfcdb4   3         3         3       16s

If I delete the deployment, it says that the CRD was not even created thanks to the original error.

kubectl delete -f minio-direct-csi.yaml 
namespace "direct-csi" deleted
storageclass.storage.k8s.io "direct.csi.min.io" deleted
serviceaccount "direct-csi-min-io" deleted
clusterrole.rbac.authorization.k8s.io "direct-csi-min-io" deleted
clusterrolebinding.rbac.authorization.k8s.io "direct-csi-min-io" deleted
configmap "direct-csi-config" deleted
secret "direct-csi-min-io" deleted
service "direct-csi-min-io" deleted
deployment.apps "direct-csi-controller-min-io" deleted
daemonset.apps "direct-csi-min-io" deleted
csidriver.storage.k8s.io "direct.csi.min.io" deleted
Error from server (NotFound): error when deleting "minio-direct-csi.yaml": customresourcedefinitions.apiextensions.k8s.io "storagetopologies.direct.csi.min.io" not found
@immanuelfodor
Copy link
Author

May I need to run it with --validate=false at the apply? Shouldn't it be solved in the CRD spec instead?

--validate=true: If true, use a schema to validate the input before sending it

@harshavardhana
Copy link
Member

master CRD was incomplete @immanuelfodor please use the master branch now, moved the offending commint to dev branch

@immanuelfodor
Copy link
Author

Thank you, it indeed fixed it, the apply is working fine now.

Praveenrajmani pushed a commit to Praveenrajmani/directpv that referenced this issue Mar 9, 2022
Framework to match the probed device with the list of drives
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants