keikoproj / upgrade-manager

Reliable, extensible rolling-upgrades of Autoscaling groups in Kubernetes
Apache License 2.0
141 stars 45 forks source link

Error during CRD installation - unknown field "x-kubernetes-int-or-string" #119

Open infa-ddeore opened 4 years ago

infa-ddeore commented 4 years ago

BUG REPORT:

What happened: Error while installing the CRD as per README

$ kubectl apply -f https://raw.githubusercontent.com/keikoproj/upgrade-manager/master/config/crd/bases/upgrademgr.keikoproj.io_rollingupgrades.yaml

error: error validating "https://raw.githubusercontent.com/keikoproj/upgrade-manager/master/config/crd/bases/upgrademgr.keikoproj.io_rollingupgrades.yaml": error validating data: ValidationError(CustomResourceDefinition.spec.validation.openAPIV3Schema.properties.spec.properties.strategy.properties.maxUnavailable): unknown field "x-kubernetes-int-or-string" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps; if you choose to ignore these errors, turn validation off with --validate=false

What you expected to happen: CRD should be installed without an error

How to reproduce it (as minimally and precisely as possible): $ kubectl apply -f https://raw.githubusercontent.com/keikoproj/upgrade-manager/master/config/crd/bases/upgrademgr.keikoproj.io_rollingupgrades.yaml

I tried with kubectl 1.16, 1.19 and 1.14 version, same issue with all.

Anything else we need to know?: EKS Server Version: v1.14.9-eks-658790

Environment: EKS, client and server version is given above

eytan-avisror commented 4 years ago

Hi there @infa-ddeore

This is actually server-side validation that was added from Kubernetes 1.15 Unfortunately it means if you try to install a CRD with this new validation type on a cluster that is under 1.15, it will fail with that message because that validation of int-or-string type is unsupported.

In this case, simply remove that line from the CRD and it will allow you to proceed and apply it.

infa-ddeore commented 4 years ago

thanks for the reply, I added --validate=false to the kubectl apply command, i think that will have the similar effect as removing the line.