Skip to content

Add example config to deploy kubernetes via RKE2 #1650

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

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

Hirozy
Copy link
Contributor

@Hirozy Hirozy commented Jun 30, 2023

RKE2 V1.27.3 has added support for the arm64 architecture, so there is one more way to deploy K8S on Apple Silicon. The INSTALL_RKE2_CHANNEL=latest indicates that the latest v1.27.x is installed instead of the stable v1.25.x. And I think k8s-rke2.yaml should be in examples/experimental before v1.27.x becomes a stable channel.

env | grep "http_proxy\|https_proxy\|no_proxy" >> /etc/default/rke2-server
sed -i "s/http_proxy/CONTAINERD_HTTP_PROXY/g" /etc/default/rke2-server
sed -i "s/https_proxy/CONTAINERD_HTTPS_PROXY/g" /etc/default/rke2-server
sed -i "s/no_proxy/CONTAINERD_NO_PROXY/g" /etc/default/rke2-server

To avoid service unavailability due to no_proxy, use the variable with the prefix CONTAINERD_ according to the RKE2 documentation.

@Hirozy
Copy link
Contributor Author

Hirozy commented Jul 13, 2023

@jandubois Please kindly review and let me know if you have any comments

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried the template, and it works, but took about 15min for the instance to get ready because several images ended up in an ImagePullBackup state. I haven't tried to figure out why that happens.

I'm not sure about the naming; I would just call ist experimental/rke2.yaml. Otherwise we should rename k8sk8s-kubeadm and k3sk8s-k3s because they are all different ways to install k8s. @AkihiroSuda what do you think?

- mode: system
script: |
#!/bin/sh
curl -sfL https://get.rke2.io | INSTALL_RKE2_CHANNEL=v1.27 sh -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing this PR made me realize that we download the install script for k3s on each boot, whereas it is only needed on the first boot, so I created #1684.

I think a similar check should be added here too:

Suggested change
curl -sfL https://get.rke2.io | INSTALL_RKE2_CHANNEL=v1.27 sh -
if [ ! -d /var/lib/rancher/rke2 ]; then
curl -sfL https://get.rke2.io | INSTALL_RKE2_CHANNEL=v1.27 sh -
...

Copy link
Contributor Author

@Hirozy Hirozy Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comments.
I changed the filename to "experimental/rke2.yaml". And added that check.

@jandubois
Copy link
Member

Maybe the template should include a link to https://docs.rke2.io for references (and add a similar link to https://docs.k3s.io` to templates/k3s.yaml as well)?

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM. Leaving it to @AkihiroSuda to merge if he is ok with the filename.

And FWIW, v1.27.4+rke2r1 was just released today:

$ KUBECONFIG="/Users/jan/.lima/rke2/copied-from-guest/kubeconfig.yaml" k get no
NAME        STATUS   ROLES                       AGE   VERSION
lima-rke2   Ready    control-plane,etcd,master   10m   v1.27.4+rke2r1

@jandubois jandubois added this to the v0.17.0 milestone Jul 28, 2023
@afbjorklund
Copy link
Member

Maybe the template should include a link to https://docs.rke2.io for references (and add a similar link to [https://docs.k3s.io](https://docs.k3s.io%60) to templates/k3s.yaml` as well)?

Feel free to add https://docs.k8s.io/ to templates/k8s.yaml, in that case. There's some step-by-step links now.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 6fba254 into lima-vm:master Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants