jx3-gitops-repositories / jx3-kubernetes

Jenkins X 3.x GitOps repository for a vanilla Kubernetes cluster
Apache License 2.0
14 stars 46 forks source link

Incorrect CustomResourceDefinition api version for for kubernetes 1.22+ #10

Closed sentimenti-it closed 2 years ago

sentimenti-it commented 2 years ago

When I'm trying to install operator from instruction (https://jenkins-x.io/v3/admin/setup/operator/), jx-boot-* pod cannot start and I got following error:

customresourcedefinition.apiextensions.k8s.io/previews.preview.jenkins.io created
customresourcedefinition.apiextensions.k8s.io/lighthousebreakpoints.lighthouse.jenkins.io created
customresourcedefinition.apiextensions.k8s.io/lighthousejobs.lighthouse.jenkins.io created
customresourcedefinition.apiextensions.k8s.io/externalsecrets.kubernetes-client.io created
customresourcedefinition.apiextensions.k8s.io/clustertasks.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/conditions.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/pipelineresources.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/pipelineruns.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/pipelines.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/runs.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/taskruns.tekton.dev created
customresourcedefinition.apiextensions.k8s.io/tasks.tekton.dev created
error validating "config-root/customresourcedefinitions/jx/jenkins-x-crds/environments.jenkins.io-crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
error validating "config-root/customresourcedefinitions/jx/jenkins-x-crds/pipelineactivities.jenkins.io-crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
error validating "config-root/customresourcedefinitions/jx/jenkins-x-crds/releases.jenkins.io-crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
error validating "config-root/customresourcedefinitions/jx/jenkins-x-crds/sourcerepositories.jenkins.io-crd.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
unable to recognize "config-root/customresourcedefinitions/kuberhealthy/kuberhealthy/khchecks.comcast.github.io-crd.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
unable to recognize "config-root/customresourcedefinitions/kuberhealthy/kuberhealthy/khjobs.comcast.github.io-crd.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
unable to recognize "config-root/customresourcedefinitions/kuberhealthy/kuberhealthy/khstates.comcast.github.io-crd.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1beta1"
make[1]: *** [versionStream/src/Makefile.mk:288: kubectl-apply] Error 1
make[1]: Leaving directory '/workspace/source'
error: failed to regenerate: failed to regenerate phase 1: failed to run 'make regen-phase-1' command in directory '.', output: ''
make: *** [versionStream/src/Makefile.mk:242: regen-check] Error 1

I think the reason is that CustomResourceDefinition in version "apiextensions.k8s.io/v1beta1" was removed in kubernetes 1.22 (source). But still there is the stable version - "apiextensions.k8s.io/v1".

We are using microk8s in v1.22.4 version (changelog) which is based on kubernetes 1.22

Do you know any workaround for this issue? Is there any way to install operator on kubernetes 1.22+?

aellwein commented 2 years ago

same here, want to test it on 1.22

yelhouti commented 2 years ago

this should have been fixed but some pipeline didn't trigger to update tekton pipeline to version 0.29.0

babadofar commented 2 years ago

Kubernetes 1.22 was not supported untill recently. Try again and open a new issue if there are still problems?

bhomrich commented 2 years ago

I am running a newly installed, on-prem kubernetes 1.22.10, and can confirm this is still happening on the latest install of jx3.

I'll open an issue as @babadofar is requesting.