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

Charts >=2.31.0 require newer version of K8S than what is listed in prerequisites #950

Open
rwa-siteimprove opened this issue Nov 17, 2023 · 5 comments

Comments

@rwa-siteimprove
Copy link

rwa-siteimprove commented Nov 17, 2023

Kong chart 2.31.0 introduced K8S validations which appear to have been added in K8S 1.25. The current prerequisites for Kong on https://artifacthub.io/packages/helm/kong/kong#prerequisites state that K8S 1.17 or greater is required. Therefore it appears a breaking change was made to the Kong chart in a minor revision.

The following error is seen when trying to use a Kong chart >= 2.31.0 on K8S versions earlier than 1.25 (I'm guessing based on K8S docs as I don't have that version installed).

error validating data: ValidationError(CustomResourceDefinition.spec.versions[0].schema.openAPIV3Schema): unknown field "x-kubernetes-validations" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps

It appears the validation was added here e66bd91#diff-8f052035f2e058d0d78ded7469c0bff29bede9030b5b870e7e72759def41e455R950

I have a few suggestions:

  1. Increment the major version as this is a breaking change, or
  2. Make this check optional somehow (I don't know if that can be done)
  3. Simply update the documentation to state that a newer version of K8S is required for newer charts.
@rwa-siteimprove
Copy link
Author

I have confirmed we're on K8S version 1.21

@tao12345666333
Copy link
Member

Thanks for your report.

@tao12345666333 tao12345666333 self-assigned this Nov 20, 2023
@rainest
Copy link
Contributor

rainest commented Feb 19, 2024

This is from CEL validation, which we now use in a number of places. I don't think there's a way to opportunistically use it if possible by default. CRDs aren't templated, so we can't do a version gate for the field using a Kubernetes version lookup.

Older versions can drop the unknown field if you ask, but I don't think Helm has a way to request that. You'd need to install them separately via kubectl. For example:

kubectl kustomize https://github.com/Kong/kubernetes-ingress-controller/config/crd?ref=v3.1.0 | kubectl apply -f - --validate=false

using your controller version string instead of 3.1.0. Do you see any issues using that approach?

@czeslavo
Copy link
Contributor

I agree it's not a perfect experience from the Helm chart user's perspective as the version of the chart itself hasn't been bumped despite bumping a major version of KIC. KIC itself documents that incompatibility correctly though so I will just leave a link to its compatibility matrix here for context: https://docs.konghq.com/kubernetes-ingress-controller/latest/reference/version-compatibility/#kubernetes.

@rwa-siteimprove
Copy link
Author

using your controller version string instead of 3.1.0. Do you see any issues using that approach?

I'm not entirely sure what you're asking here. We're using the HELM chart and deploying via ArgoCD so I'm not sure I can do this.

Our config looks like:

      source:
        chart: kong
        repoURL: https://charts.konghq.com
        targetRevision: 2.30.0
        helm:
          releaseName: kong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants