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

Make k3s version configurable #218

Closed
wants to merge 1 commit into from
Closed

Make k3s version configurable #218

wants to merge 1 commit into from

Conversation

negz
Copy link

@negz negz commented Mar 13, 2022

Fixes #46

Previously there was a hidden --kubernetes-version flag that was ignored. This commit plumbs it through to the version of k3s that is installed. I noticed in #46 there was some talk of automatically detecting k3s versions (presumably to always install the latest version by default?). That functionality would be handy, but in the meantime I feel this PR is a step in the right direction, as it makes it possible to select a different version rather than having it hardcoded.

Now, when I don't supply a version I see the same behavior I used to (i.e. k3s v1.22.x is installed).

$ ./_output/binaries/colima-Darwin-arm64 start --runtime containerd --with-kubernetes -c 4 -m 4
INFO[0000] starting colima                              
INFO[0000] creating and starting ...                     context=vm
INFO[0021] starting ...                                  context=containerd
INFO[0026] waiting for startup to complete ...           context=containerd
INFO[0027] downloading and installing ...                context=kubernetes
INFO[0032] loading oci images ...                        context=kubernetes
> unpacking docker.io/rancher/mirrored-library-busybox:1.32.1 (sha256:6b23544141396cd3a36fa1b3ed3ccade0d30068c1802bbae64eef1e3e5ab9d54)...done
> unpacking docker.io/rancher/mirrored-library-traefik:2.5.0 (sha256:8a718325f4c589a2e44688ae87f74dab4c64648431ab9457dee9aa96aad93354)...done
> unpacking docker.io/rancher/mirrored-metrics-server:v0.5.0 (sha256:1a89693d2093a62715e24714fcc88f980c144fe2a769531c62a487cd1dcd5b3c)...ctr: failed to resolve rootfs: content digest sha256:ee11f1e38ac66c96e91e9504296e77a57733101b02a678
WARN[0034] error loading oci images: exit status 1       context=kubernetes
WARN[0034] startup may delay a bit as images will be pulled from oci registry  context=kubernetes
INFO[0034] starting ...                                  context=kubernetes
INFO[0039] updating config ...                           context=kubernetes
INFO[0040] Switched to context "colima".                 context=kubernetes
INFO[0040] done                                         

$ ./_output/binaries/colima-Darwin-arm64 ssh
colima:/Users/negz/control/abiosoft/colima$ k3s --version
k3s version v1.22.4+k3s1 (bec170bc)
go version go1.16.10

However, when I supply the --kubernetes-version flag I can pick a different K3S version:

$ ./_output/binaries/colima-Darwin-arm64 start --runtime containerd --with-kubernetes --kubernetes-version v1.23.4+k3s1 -c 4 -m 4
INFO[0000] starting colima                              
INFO[0000] creating and starting ...                     context=vm
INFO[0021] starting ...                                  context=containerd
INFO[0026] waiting for startup to complete ...           context=containerd
INFO[0026] downloading and installing ...                context=kubernetes
INFO[0037] loading oci images ...                        context=kubernetes
> unpacking docker.io/rancher/local-path-provisioner:v0.0.21 (sha256:7d89362db230fd1178ba9465bc3582b09872ee6be72037e2ad80cf812751299e)...done
> unpacking docker.io/rancher/mirrored-coredns-coredns:1.8.6 (sha256:a6d8488c231616918f517bd33321ade37f6b55e9355450cbf512d053e4df505e)...ctr: failed to resolve rootfs: content digest sha256:edaa71f2aee883484133da046954ad70fd6bf1fa42e5ae
WARN[0039] error loading oci images: exit status 1       context=kubernetes
WARN[0039] startup may delay a bit as images will be pulled from oci registry  context=kubernetes
INFO[0040] starting ...                                  context=kubernetes
INFO[0045] updating config ...                           context=kubernetes
INFO[0046] Switched to context "colima".                 context=kubernetes
INFO[0046] done                                         

$ ./_output/binaries/colima-Darwin-arm64 ssh
colima:/Users/negz/control/abiosoft/colima$ k3s --version
k3s version v1.23.4+k3s1 (43b1cb48)
go version go1.17.5

Previously there was a hidden --kubernetes-version flag that was
ignored. This commit plumbs it through to the version of k3s that is
installed.

Signed-off-by: Nic Cope <nicc@rk0n.org>
@abiosoft
Copy link
Owner

abiosoft commented Apr 5, 2022

This is being implemented as part of #251.

@abiosoft abiosoft closed this Apr 5, 2022
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 this pull request may close these issues.

Add support for different kubernetes versions
2 participants