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

Allow manually configuring containerd version via CLI flag #1518

Merged
merged 2 commits into from Dec 21, 2022

Conversation

dajudge
Copy link
Contributor

@dajudge dajudge commented Dec 19, 2022

What this PR does / why we need it:
A broken containerd release made it impossible for our setup to provision working new nodes. This was a result of machine-controller automatically installing the latest 1.6* release of containerd available.

This PR introduces the command line flag --node-containerd-version to manually pin the containerd version to install to a specific release.

The default for this new flag is empty, so the previously existing behavior remains intact if the flag is not specified.

Which issue(s) this PR fixes:
Implements partially kubermatic/kubeone#2545

What type of PR is this?
/kind feature

Does this PR introduce a user-facing change? Then add your Release Note here:

Introduce `--node-conterainerd-version` CLI flag.

Documentation:

NONE

@kubermatic-bot kubermatic-bot added docs/none Denotes a PR that doesn't need documentation (changes). release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 19, 2022
@kubermatic-bot
Copy link
Contributor

Hi @dajudge. Thanks for your PR.

I'm waiting for a kubermatic member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kubermatic-bot kubermatic-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Dec 19, 2022
Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this contribution, we really appreciate it! 🎉

I have one question, but other than that, LGTM.

pkg/containerruntime/containerruntime.go Show resolved Hide resolved
@kubermatic-bot kubermatic-bot added dco-signoff: no Denotes that at least one commit in the pull request doesn't have a valid DCO signoff message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 20, 2022
@kubermatic-bot kubermatic-bot added dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. and removed dco-signoff: no Denotes that at least one commit in the pull request doesn't have a valid DCO signoff message. labels Dec 20, 2022
@dajudge
Copy link
Contributor Author

dajudge commented Dec 20, 2022

I also noticed that the containerd version gets overwritten to a legacy version in the case of AmazonLinux at the following places:

https://github.com/AtomicJar/machine-controller/blob/5d54195d47e9e78104f330bc877030b5cefd9740/pkg/containerruntime/docker.go#L98

https://github.com/AtomicJar/machine-controller/blob/5d54195d47e9e78104f330bc877030b5cefd9740/pkg/containerruntime/containerd.go#L77

Maybe it would make sense to move those if blocks above the switch to be below the latter so the value provided via CLI overrides this fallback? 🤔

@dajudge dajudge changed the title Pin containerd version Allow manually configuring containerd version via CLI flag Dec 20, 2022
Alex Stockinger added 2 commits December 20, 2022 09:35
Signed-off-by: Alex Stockinger <alex@atomicjar.com>
Signed-off-by: Alex Stockinger <alex@atomicjar.com>
@xmudrii
Copy link
Member

xmudrii commented Dec 20, 2022

Maybe it would make sense to move those if blocks above the switch to be below the latter so the value provided via CLI overrides this fallback?

I don't have strong opinions. Amazon Linux is a bit specific -- they ship only one specific version of containerd (and other relevant packages). I think, for consistency reasons, it might make sense to do so.

In the meanwhile, I'll trigger tests for this PR.
/test all

@dajudge
Copy link
Contributor Author

dajudge commented Dec 21, 2022

Maybe it would make sense to move those if blocks above the switch to be below the latter so the value provided via CLI overrides this fallback?

To unblock this PR I've put above change on a separate branch.

Once this is PR here is on main I'd simply open a new PR and we can discuss it in detail there.

WDYT?

Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Dec 21, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 847018c4e6ab0534b9e87d08bd0dd78d15182b61

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dajudge, xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 21, 2022
@kubermatic-bot kubermatic-bot merged commit f391c61 into kubermatic:main Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants