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

Vcluster 0.21 seems to not respect --kubernetes-version #2294

Open
felipecrs opened this issue Nov 22, 2024 · 5 comments
Open

Vcluster 0.21 seems to not respect --kubernetes-version #2294

felipecrs opened this issue Nov 22, 2024 · 5 comments
Labels

Comments

@felipecrs
Copy link
Contributor

What happened?

If I try to create a vcluster with --kubernetes-version 1.27 in a host cluster running K8s 1.30.4, the --kubernetes-version 1.27 flag seems ignored. Nothing is shown in the logs either. The final vcluster k8s version ends up as 1.30.4.

What did you expect to happen?

This was working fine on 0.20. I was expecting it to work the same?

How can we reproduce it (as minimally and precisely as possible)?

$ k3d cluster create # right now it creates a 1.30.4 cluster

$ vcluster create --kubernetes-version 1.27 felipe
17:02:45 info Creating namespace vcluster-felipe
17:02:45 info Chart not embedded: "open chart/vcluster-0.21.1.tgz: file does not exist", pulling from helm repository.
17:02:45 info Create vcluster felipe...
17:02:45 info execute command: helm upgrade felipe https://charts.loft.sh/charts/vcluster-0.21.1.tgz --create-namespace --kubeconfig /tmp/899677600 --namespace vcluster-felipe --install --repository-config='' --values /tmp/3145409311
17:02:47 done Successfully created virtual cluster felipe in namespace vcluster-felipe
17:02:55 info Waiting for vcluster to come up...
17:03:04 info vcluster is waiting, because vcluster pod felipe-0 has status: Init:1/3
17:03:14 info vcluster is waiting, because vcluster pod felipe-0 has status: Init:2/3
17:03:34 done vCluster is up and running
17:03:34 info Starting background proxy container...
17:03:46 done Switched active kube context to vcluster_felipe_vcluster-felipe_k3d-k3s-default
- Use `vcluster disconnect` to return to your previous kube context
- Use `kubectl get namespaces` to access the vcluster

$ vcluster connect felipe -- kubectl version
17:05:08 done vCluster is up and running
Client Version: v1.31.3
Kustomize Version: v5.4.2
Server Version: v1.30.4

Anything else we need to know?

No response

Host cluster Kubernetes version

$ kubectl version
Client Version: v1.31.3
Kustomize Version: v5.4.2
Server Version: v1.30.4+k3s1
Kubecolor Version: 0.4.0

vcluster version

$ vcluster --version
vcluster version 0.21.1

VCluster Config

N/A

@cbron
Copy link
Contributor

cbron commented Nov 25, 2024

Confirmed with both 1.27 and v1.29. Thanks @felipecrs for the report.

@deniseschannon
Copy link
Contributor

@felipecrs For v0.20+, we should be using the vcluster.yaml (not CLI flags) to set the k8s version.

This is only supported for the k8s distro as of today.
https://www.vcluster.com/docs/vcluster/configure/vcluster-yaml/control-plane/components/distro/k8s

controlPlane:
  distro:
    k8s:
      # Version specifies k8s components (scheduler, kube-controller-manager & apiserver) version.
      # It is a shortcut for controlPlane.distro.k8s.apiServer.image.tag,
      # controlPlane.distro.k8s.controllerManager.image.tag and
      # controlPlane.distro.k8s.scheduler.image.tag
      # If e.g. controlPlane.distro.k8s.version is set to v1.30.1 and
      # controlPlane.distro.k8s.scheduler.image.tag
      # (or controlPlane.distro.k8s.controllerManager.image.tag or controlPlane.distro.k8s.apiServer.image.tag)
      # is set to v1.31.0,
      # value from controlPlane.distro.k8s.(controlPlane-component).image.tag will be used
      # (where controlPlane-component is apiServer, controllerManager and scheduler).
      version: ""

@felipecrs
Copy link
Contributor Author

Thank you, I'll try that.

I suppose you forgot to remove the --kubernetes-version CLI flag then?

https://github.com/loft-sh/vcluster/blob/main/docs/pages/cli/vcluster_create.md#L43

@deniseschannon
Copy link
Contributor

Yes, we most likely forgot to deprecate/remove it and it's something we are following up on.

Please let me know if you have any issues using the version in the vcluster.yaml.

@felipecrs
Copy link
Contributor Author

It worked. :)

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

No branches or pull requests

3 participants