-
Notifications
You must be signed in to change notification settings - Fork 129
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
Support tarball upgrade #153
Conversation
975bea5
to
f1d5871
Compare
f1d5871
to
b527959
Compare
Thank you for the contribution, @aceeric . In reviewing this I realized a few flaws and decided to take this opportunity to refactor a few things. The first thing is it doesn't make sense to provide both a install_rke2_version string and a tarball file. I can see confusion arising if a tarball version differs from that var so I decided to have the playbook inspect the version of the tar to determine it's version and ignore that var input if the tar is supplied. The second thing is I rearranged the version determining logic so that both rpm and tar installation methods use the same task file. this makes it easier to control when/how it's run. I took your idea of finding the current version of RKE2 and moved it to the previous_install task file to run all the time and make those variables more consolidated. Lastly, this should now not only allow upgrading via tar, but it should also be idempotent and only do the installation if it's not installed or the versions differ. I didn't like that it seemed to do the binary swap regardless. I am going to commit to this today and then do some additional testing. Let me know if you find an issue with any of this. |
@mddamato All your points make sense. Regarding the |
@aceeric , I am not sure I understand what you mean by
Instead of relying on the version var, I want the new functionality to rely on the actual tarball provided. To switch versions you would switch the tarball which would be the only way to switch versions anyway regardless of the var |
@mddamato to amplify - We have an Ansible role that supports staging the binaries based on the existing
So by simply changing |
What type of PR is this?
What this PR does / why we need it:
This PR supports upgrading (and downgrading) RKE2 via the tarball method. It is informed by work done in this ticket.
The Rancher Federal Ansible already supports upgrading a cluster using the RPM method. But for some reason it prevents this in the tarball method. The PR simply enables the tarball method to achieve consistency with the RPM method. (It also supports downgrading via tarball because that comes along with the change for free but that's not really the goal.) This branch takes a minimalist approach: It will do what you tell it. It doesn't try to protect the person installer from doing wrong things, such as upgrading Kubernetes in a disallowed way. I made this choice because the converse would require codifying logic in Ansible that fundamentally is owned by the k8s maintainers.
Which issue(s) this PR fixes:
#154
Special notes for your reviewer:
N/A
Testing
I have tested the following scenarios in AWS :
ONE: With a two-instance cluster consisting of one controller and one worker and after each step the resulting cluster version matched the install version.
Airgap install: v1.25.11+rke2r1
Airgap install: v1.25.13+rke2r1
Airgap install: v1.25.11+rke2r1
Uninstall
Airgap install: v1.25.11+rke2r1
Airgap install: v1.25.11+rke2r1
TWO: Tested the same scenarios above with the RPM install method to ensure the changes didn't affect the RPM path:
RPM install: v1.25.11+rke2r1
RPM install: v1.25.13+rke2r1
RPM install: v1.25.11+rke2r1
The RPM downgrade to
v1.25.11+rke2r1
was ignored by the Ansible. This was consistent with the pre-PR behavior, and so I stopped here for the RPM testing, satisfying myself that I had not impacted the RPM behavior.THREE: Tested one scenario with an H/A cluster consisting of 3 control plane instances and 2 workers:
Airgap install v1.25.11+rke2r1
Airgap install v1.25.13+rke2r1
Release Notes