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

Add support for different kubernetes versions #46

Closed
tibcoplord opened this issue Oct 27, 2021 · 11 comments · Fixed by #251
Closed

Add support for different kubernetes versions #46

tibcoplord opened this issue Oct 27, 2021 · 11 comments · Fixed by #251

Comments

@tibcoplord
Copy link

Currently, kubernetes 1.22 is a little new for me, so I've edited my local colima tree to use v1.21.5+k3s2

It would be nice to be able to specify the kubernetes version on the command line ... will be especially useful for desktop testing applications on different versions.

Cheers.

@abiosoft
Copy link
Owner

abiosoft commented Oct 27, 2021

@tibcoplord thanks for reporting this.

The functionality was built in initially but temporarily disabled. I only need to figure out a way to get the list of k3s versions.

@hown3d
Copy link
Contributor

hown3d commented Oct 28, 2021

@abiosoft K3s creates a release with each version in Github, maybe query it to get the version list. 🤔

@adamalex
Copy link

Good call! The JSON for this is available at https://api.github.com/repos/k3s-io/k3s/tags

@eacarvalho
Copy link

Hi, I have a similar issue, please is it possible to use previous version of Kubernetes? I've tried to edit colima.yaml file but no effect.

I'm running on Mac and installed Colima using Homebrew.

colima version
colima version 0.2.2
git commit: b2c7697bee2d73e995f156fe8e9870eb246c07e6

runtime: docker
client: v20.10.12
server: v20.10.7

kubernetes
Client Version: v1.23.1
Server Version: v1.22.2+k3s2

@abiosoft
Copy link
Owner

please is it possible to use previous version of Kubernetes?

@eacarvalho at the moment, no. But it is being planned.

What version of kubernetes would you like to use?

@eacarvalho
Copy link

Hi @abiosoft, the version should be lower than 1.22, preferable v1.20.x due some incompatibility regarding the 1.22+ version but definitely lower than 1.22 in order to work for our deployment.

Ingress: The extensions/v1beta1 and networking.k8s.io/v1beta1 API versions of Ingress is no longer served as of v1.22.
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

Nice that this is being planned, I wish I could use this feature soon. Thanks a lot!

@abiosoft
Copy link
Owner

abiosoft commented Jan 13, 2022

Nice that this is being planned, I wish I could use this feature soon. Thanks a lot!

@eacarvalho it is not as complex for me to add, what is more tedious is testing different versions and ensuring they still work as desired. I'll see what I can do to speed it up.

Would you be willing to assist with testing and use the development version? It may take a while before the next release.

As a temporary workaround if you can build from source, you can specify your preferred k3s version.

const k3sVersion = "v1.22.4+k3s1"

@eacarvalho
Copy link

Would you be willing to assist with testing and use the development version?

Please let me know in case you produce a development version!

@spkane
Copy link

spkane commented Feb 18, 2022

I would be happy to help support a bit of testing as well. Making it reasonably easy to install a different version of k3s would be very helpful, especially due to the major changes that are currently in 1.22.

@spkane
Copy link

spkane commented Feb 18, 2022

For the time being, you can change the k3s version in the current VM with something like this:

  • Find the release you want here (e.g. v1.21.9+k3s1)
  • Connect to the VM:
$ colima ssh
  • Inside the VM run:
# sudo /usr/local/bin/k3s-uninstall.sh
# sudo apk add curl
# curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.21.9+k3s1 sh -
# sudo cat /etc/rancher/k3s/k3s.yaml
# exit
  • OR

colima exec -- sh -c 'sudo /usr/local/bin/k3s-uninstall.sh && sudo apk add curl && curl -sfL https://get.k3s.io > ~/install-k3s.sh && INSTALL_K3S_VERSION=v1.21.9+k3s1 sh ~/install-k3s.sh && sleep 10 && sudo cat /etc/rancher/k3s/k3s.yaml'

  • And finally, if you copy the contents of the /etc/rancher/k3s/k3s.yaml file on the VM into a file on your local host called ~/.kube/colima-k3s.yaml then you should be able to connect to the new k3s release with something like this kubectl --kubeconfig ~/.kube/colima-k3s.yaml version

@abiosoft
Copy link
Owner

I would be happy to help support a bit of testing as well. Making it reasonably easy to install a different version of k3s would be very helpful, especially due to the major changes that are currently in 1.22.

Alright, thanks. I'll see if I can squeeze this in before the next release.

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

Successfully merging a pull request may close this issue.

6 participants