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

Improve kubernetes version check #266

Open
ludusrusso opened this issue Feb 20, 2023 · 3 comments
Open

Improve kubernetes version check #266

ludusrusso opened this issue Feb 20, 2023 · 3 comments
Assignees

Comments

@ludusrusso
Copy link

ludusrusso commented Feb 20, 2023

If I try to create or update a TPC with a non existing minor version of kubernetes, the CRD API call succede but the tcp remain in an provisioning state.

How to reproduce:

apiVersion: kamaji.clastix.io/v1alpha1
kind: TenantControlPlane
metadata:
  name: non-existing-version
  namespace: default
spec:
  controlPlane:
    deployment:
      replicas: 1
    service:
      serviceType: ClusterIP
  kubernetes:
    version: "v1.25.90" # <- non existing version
    kubelet:
      cgroupfs: cgroupfs
    admissionControllers:
      - ResourceQuota
      - LimitRanger
  networkProfile:
    port: 6443
  addons:
    coreDNS: {}
    kubeProxy: {}

Expected behavior

Get an error similar to the one obtained with a non existing major version

admission webhook "vtenantcontrolplane.kb.io" denied the request: unable to upgrade to a version greater than the supported one, actually 1.26.0

@prometherion
Copy link
Member

Unfortunately, the single way to address this is to hard-code all the available versions of Kubernetes.

This would require more maintenance toil, and it could a technical debt in the future where we could specify a different image repository mirror or any different Kubernetes distribution (although not yet supported).

I summon @bsctl to have his insights about UX.

@johannwagner
Copy link
Contributor

We technically could check in an admission webhook, if there are images for the given Kubernetes version (or given image for custom Kubernetes distros), but I do not see the value, tbh. CP will spawn and give you an ErrImgPull error, which is simple and clear.

@gecube
Copy link

gecube commented Oct 30, 2024

CP will spawn and give you an ErrImgPull error, which is simple and clear.

It could be anything else - like ghcr is not available, the image was removed etc. I think that the precise error message on admission webhook side would be much cleaner and more understandable. Unfortunately, it means, that the list of supported k8s versions should be hardcoded somewhere in the code of operator, but maybe it is good thing (particularly for promotion of commercial version of kamaji)...

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