flink-on-k8s-operator icon indicating copy to clipboard operation
flink-on-k8s-operator copied to clipboard

make deploy failed: The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid

Open abowloflrf opened this issue 4 years ago • 13 comments

Failed to deploy the operator on my minikube cluster (v1.18.2):

make deply error log:

go: creating new go.mod: module tmp
go: found sigs.k8s.io/controller-tools/cmd/controller-gen in sigs.k8s.io/controller-tools v0.3.0
/home/ruofeng/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./api/v1beta1/..." output:crd:artifacts:config=config/crd/bases
go mod tidy
kubectl apply -f config/crd/bases
The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid:
* spec.validation.openAPIV3Schema.properties[spec].properties[job].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
* spec.validation.openAPIV3Schema.properties[spec].properties[jobManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
* spec.validation.openAPIV3Schema.properties[spec].properties[taskManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
make: *** [Makefile:94: install] Error 1

abowloflrf avatar Jun 12 '20 09:06 abowloflrf

The operator has problem with k8s 1.18, we will fix it. As a work around, you might use a lower version.

functicons avatar Jun 12 '20 14:06 functicons

Related info: https://github.com/SeldonIO/seldon-core/issues/1675#issuecomment-635844096

functicons avatar Jun 12 '20 21:06 functicons

Anything I can do to help fix this? I can't really downgrade my Kubernetes on premise cluster and I would really like to give the operator a try.

Enzo90910 avatar Jul 16 '20 11:07 Enzo90910

As a temporary workaround, the crd will deploy (on 1.18 in my case) by removing the instances of protocol from the several x-kubernetes-list-map-keys arrays in the generated crd.

bnu0 avatar Jul 16 '20 11:07 bnu0

As a temporary workaround, the crd will deploy (on 1.18 in my case) by removing the instances of protocol from the several x-kubernetes-list-map-keys arrays in the generated crd.

I actually tried something like that (I added protocol to the required properties) and the deploy worked but I am now stuck with the Server-side apply problems (The FlinkCluster "beam-flink-cluster" is invalid: metadata.managedFields.fieldsType: Invalid value: "": must be FieldsV1) when creating the FlinkCluster in /example

Enzo90910 avatar Jul 16 '20 12:07 Enzo90910

If you must use k8s 1.18, it seems that you can avoid this problem by changing controller-gen version 0.2.4 in Makefile as a workaround.

elanv avatar Jul 17 '20 07:07 elanv

I confirm switching to controller-gen 0.2.4 functions as a workaround for this issue.

Enzo90910 avatar Jul 17 '20 08:07 Enzo90910

Thanks for the suggested workaound, Saved my time while setting up the operator for first time

i changed following line (60) in Make file and it worked "go get sigs.k8s.io/controller-tools/cmd/[email protected] ;" to "go get sigs.k8s.io/controller-tools/cmd/[email protected] ;"

vp999 avatar Jul 19 '20 08:07 vp999

i got the similar problem when deploying the operator to v1.18 with the yaml file,is it also because of the k8s verson ? and how can i help to fix this? i just run kubectl create -f https://raw.githubusercontent.com/GoogleCloudPlatform/flink-on-k8s-operator/master/config/crd/bases/flinkoperator.k8s.io_flinkclusters.yaml ,and it output that `The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid:

  • spec.validation.openAPIV3Schema.properties[spec].properties[job].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[jobManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[jobManager].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[taskManager].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[taskManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property`

hwk42 avatar Sep 09 '20 03:09 hwk42

Did you tried changing here https://github.com/GoogleCloudPlatform/flink-on-k8s-operator/blob/master/Makefile#L65 and did local build & applied in your K8s v1.18 cluster?

For local build maybe you will be interested in this page https://github.com/GoogleCloudPlatform/flink-on-k8s-operator/blob/master/docs/developer_guide.md#developer-guide

guruprasathT avatar Sep 09 '20 08:09 guruprasathT

I did othing to change,just follow the guide https://github.com/GoogleCloudPlatform/flink-on-k8s-operator/blob/master/helm-chart/flink-operator/README.md#installing-the-chart to deploy.

hwk42 avatar Sep 09 '20 10:09 hwk42

what changes are required for folks like me who are leveraging the helm chart to deploy this on a 1.18 server ?

ibexmonj avatar Mar 09 '21 18:03 ibexmonj

Getting the same error even after trying the workarounds: 1)Tried changing the [email protected] ; to [email protected] in MakeFile; 2)Added protocol to the required fields [mentioned in issue #311 ] Both Didn't Work Any suggestions ? To fix this The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid:

  • spec.validation.openAPIV3Schema.properties[spec].properties[taskManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[taskManager].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[jobManager].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[jobManager].properties[sidecars].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property
  • spec.validation.openAPIV3Schema.properties[spec].properties[job].properties[initContainers].items.properties[ports].items.properties[protocol].default: Required value: this property is in x-kubernetes-list-map-keys, so it must have a default or be a required property Makefile:94: recipe for target 'install' failed make: *** [install] Error 1

ManoharGovind avatar Dec 21 '21 06:12 ManoharGovind