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

v2 ScaledJob can't be deployed on k8s 1.18 #927

Closed
zroubalik opened this issue Jul 9, 2020 · 3 comments
Closed

v2 ScaledJob can't be deployed on k8s 1.18 #927

zroubalik opened this issue Jul 9, 2020 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@zroubalik
Copy link
Member

Validation changes were introduced in k8s 1.18: https://kubernetes.io/docs/setup/release/notes/#other-api-changes

Our ScaledJob CRD uses k8s.io/api/batch/v1/JobSpec which results in a CRD that is not possible to deploy on k8s 1.18:

kubectl apply -f deploy/crds/keda.sh_scaledjobs_crd.yaml                                                                                    ✔ 
The CustomResourceDefinition "scaledjobs.keda.sh" is invalid: 
* spec.validation.openAPIV3Schema.properties[spec].properties[jobTargetRef].properties[template].properties[spec].properties[containers].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[jobTargetRef].properties[template].properties[spec].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

As a workaround we need to manually mark protocol property as reguired in the generated CRD (on a 3 places), after every CRD generation.

We need to wait till this issue is solved: operator-framework/operator-sdk#3235

@zroubalik
Copy link
Member Author

This patch solves this issue https://github.com/kedacore/keda/blob/00f663426e46fae64bcad8d4d9cd05b4c5ab3e8c/config/crd/patches/scaledjob_patch.yaml

Once this issue is solved upstream (in operator-sdk) we can remove the patch.

@rajatvig
Copy link

Could the patch file be merged in with the CRD? I am trying to deploy keda using Jsonnet and need a static location for the CRD to apply and I cannot use helm or kustomise.

@zroubalik
Copy link
Member Author

@rajatvig you can consume installation resources from yaml file. You can find them in the releases https://github.com/kedacore/keda/releases

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

No branches or pull requests

2 participants