Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

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

Open
abowloflrf opened this issue Jun 12, 2020 · 13 comments · May be fixed by #436
Open
Labels
bug Something isn't working

Comments

@abowloflrf
Copy link

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
@functicons
Copy link
Collaborator

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

@functicons functicons added the bug Something isn't working label Jun 12, 2020
@functicons
Copy link
Collaborator

Related info: SeldonIO/seldon-core#1675 (comment)

@Enzo90910
Copy link

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.

@bnu0
Copy link
Contributor

bnu0 commented Jul 16, 2020

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.

@Enzo90910
Copy link

Enzo90910 commented Jul 16, 2020

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

@elanv
Copy link
Contributor

elanv commented Jul 17, 2020

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.

@Enzo90910
Copy link

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

@vp999
Copy link

vp999 commented Jul 19, 2020

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/controller-gen@v0.3.0 ;"
to
"go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.4 ;"

@hwk42
Copy link

hwk42 commented Sep 9, 2020

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`

@guruprasathT
Copy link
Contributor

guruprasathT commented Sep 9, 2020

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

@hwk42
Copy link

hwk42 commented Sep 9, 2020

@ibexmonj
Copy link

ibexmonj commented Mar 9, 2021

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

@ManoharGovind
Copy link

Getting the same error even after trying the workarounds:
1)Tried changing the controller-gen@v0.3.0 ; to controller-gen@v0.2.4 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
10 participants