flink-on-k8s-operator
flink-on-k8s-operator copied to clipboard
make deploy failed: The CustomResourceDefinition "flinkclusters.flinkoperator.k8s.io" is invalid
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
The operator has problem with k8s 1.18, we will fix it. As a work around, you might use a lower version.
Related info: https://github.com/SeldonIO/seldon-core/issues/1675#issuecomment-635844096
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.
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.
As a temporary workaround, the crd will deploy (on 1.18 in my case) by removing the instances of
protocol
from the severalx-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
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.
I confirm switching to controller-gen 0.2.4 functions as a workaround for this issue.
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] ;"
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`
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
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.
what changes are required for folks like me who are leveraging the helm chart to deploy this on a 1.18 server ?
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