kubernetes-sigs / kubespray

Deploy a Production Ready Kubernetes Cluster
Apache License 2.0
16.21k stars 6.5k forks source link

Support running etcd in a lxc container #11588

Closed DirkTheDaring closed 1 month ago

DirkTheDaring commented 1 month ago

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change /kind bug /kind cleanup /kind design /kind documentation /kind failing-test /kind feature /kind flake

What this PR does / why we need it: In a test lab environment with limited resources, one can save some resources if you run etcds in LXC containers.

Using an LXC container causes kubespray to fail, as it assumes that etcds run on a (virtual) machine. It tries setting swap, and an LXC container does not allow to chown the etcd binary in the standard setting.

This patch introduces the ansible_virtualization_type variable, similar to running normal ansible, which allows you to determine if you run in a LXC container or else.

Then, it makes the necessary adjustments to solve the above issues for an LXC container. Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Support running etcd in a lxc container
k8s-ci-robot commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: DirkTheDaring Once this PR has been reviewed and has the lgtm label, please assign vannten for approval. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-sigs/kubespray/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 1 month ago

Hi @DirkTheDaring. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
VannTen commented 1 month ago

I don't think we want to support this in Kubespray, it's not really in scope.

yankay commented 1 month ago

/ok-to-test

DirkTheDaring commented 1 month ago

Fine with me, fix: works for years on my proxmox environment. I have always maintained it.

k8s-ci-robot commented 1 month ago

Adding label do-not-merge/contains-merge-commits because PR contains merge commits, which are not allowed in this repository. Use git rebase to reapply your commits on top of the target branch. Detailed instructions for doing so can be found here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.