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

Adds configurable containerd base dir during bootstrap / join #817

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

claudiubelu
Copy link
Contributor

Adds configurable containerd base dir during bootstrap / join

Currently, for the classic k8s snap, the default locations for the containerd-related files are:

- /etc/containerd/
- /run/containerd/
- /var/lib/containerd/

These paths can conflict with other containerd installations on the host (e.g. from docker), meaning that the k8s snap cannot be installed. In a developer's usecase, we shouldn't require the other services to be disabled, but we can allow the k8s snap's containerd to be installed in a different location during bootstrap / node join.

Adds the --containerd-base-dir option for k8s bootstrap and join-cluster commands. If not given, the snap's default paths will be used instead. After the node was initialized, save the containerd base location in a file, so we can properly reference it later / on restart.

Depends-On: canonical/k8s-snap-api#19

@claudiubelu claudiubelu requested a review from a team as a code owner November 20, 2024 13:51
@claudiubelu claudiubelu marked this pull request as draft November 20, 2024 13:52
@claudiubelu claudiubelu changed the title Ku 2155/configure containerd base dir Adds configurable containerd base dir during bootstrap / join Nov 20, 2024
src/k8s/go.mod Outdated
@@ -177,3 +177,5 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/canonical/k8s-snap-api v1.0.13 => github.com/claudiubelu/k8s-snap-api v0.0.0-20241119131040-dc75989e4d14
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: this change and the go.sum one is only for testing purposes.

Comment on lines 40 to 44
if req.ContainerdBaseDir != "" {
e.provider.Snap().SetContainerdBaseDir(req.ContainerdBaseDir)
}
Copy link
Contributor

@eaudetcobello eaudetcobello Nov 20, 2024

Choose a reason for hiding this comment

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

I would rather see this in ClusterConfig's SetDefaults().

Copy link
Contributor

@bschimke95 bschimke95 left a comment

Choose a reason for hiding this comment

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

We don't want this option to be part of the CLI. This should be an optional entry in the bootstrap config file.

@claudiubelu claudiubelu force-pushed the KU-2155/configure-containerd-base-dir branch 6 times, most recently from 60e1613 to ba46ef5 Compare November 22, 2024 07:53
Currently, for the classic k8s snap, the default locations for the
containerd-related files are:

- /etc/containerd/
- /run/containerd/
- /var/lib/containerd/

These paths can conflict with other containerd installations on the host
(e.g. from docker), meaning that the k8s snap cannot be installed. In a
developer's usecase, we shouldn't require the other services to be
disabled, but we can allow the k8s snap's containerd to be installed in
a different location during bootstrap / node join.

Adds the --containerd-base-dir option for k8s bootstrap and join-cluster
commands. If not given, the snap's default paths will be used instead.
After the node was initialized, save the containerd base location in a
file, so we can properly reference it later / on restart.
@claudiubelu claudiubelu force-pushed the KU-2155/configure-containerd-base-dir branch from ba46ef5 to a862186 Compare November 22, 2024 08:59
@eaudetcobello
Copy link
Contributor

Instead of creating a new feature, can this be set by the ExtraContainerdArgs bootstrap option we already have?

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.

4 participants