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

node-installer: configure and run tardev-snapshotter #697

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

katexochen
Copy link
Member

@katexochen katexochen commented Jul 10, 2024

With this change, we improve the stability of Contrast by deploying our own tardev-snapshotter on the host as part of the node-installer deployment. Previously, the Contrast runtime would use the tardev-snapshotter installed on the host, which is managed by Azure. However, the snapshotter is highly coupled with the guest image, and breaking changes to the snaphotter led to workload pods not being able to start in Contrast. Therefore, we are shipping a pinned snapshotter as part of the runtime. This will also allow running multiple Contrast runtime next to each other that require different versions of the snapshotter.

@katexochen katexochen added this to the v0.9.0 milestone Jul 10, 2024
Freax13

This comment was marked as resolved.

@katexochen katexochen force-pushed the p/tardev-installer branch from 6e7f5ce to c0307ab Compare July 11, 2024 13:25
@katexochen katexochen added the feature Shiny new feature for our users label Jul 11, 2024
@katexochen katexochen marked this pull request as ready for review July 11, 2024 13:30
@katexochen katexochen force-pushed the p/tardev-installer branch from c0307ab to a249004 Compare July 12, 2024 05:58
@katexochen katexochen requested a review from burgerdev July 12, 2024 06:40
@@ -199,19 +199,23 @@ func patchContainerdConfig(runtimeName, basePath, configPath string, platform pl
existing = constants.ContainerdBaseConfig()
}

snapshotterName := "no-snapshotter"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this not tardev-$hash?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is set to that a few lines below in case we are on a platform that uses a snapshotter.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see - thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interestingly, we're already switching on the platform outside these functions:

switch platform {
case platforms.AKSCloudHypervisorSNP:
// AKS or any external-containerd based K8s distro: We can just patch the existing containerd config at /etc/containerd/config.toml
if err := patchContainerdConfig(config.RuntimeHandlerName, runtimeBase, containerdConfigPath, platform); err != nil {
return fmt.Errorf("patching containerd configuration: %w", err)
}
case platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
// K3s or RKE2: We need to extend the configuration template, which, in it's un-templated form, is non-TOML.
// Therefore just write the TOML configuration fragment ourselves and append it to the template file.
// This assumes that the user does not yet have a runtime with the same name configured himself,
// but as our runtimes are hash-named, this should be a safe assumption.
if err := patchContainerdConfigTemplate(config.RuntimeHandlerName, runtimeBase, containerdConfigPath, platform); err != nil {
return fmt.Errorf("patching containerd configuration: %w", err)
}
.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's indeed confusing (but necessary with the current structure, as some platforms won't call patchContainerdConfig.

@@ -199,19 +199,23 @@ func patchContainerdConfig(runtimeName, basePath, configPath string, platform pl
existing = constants.ContainerdBaseConfig()
}

snapshotterName := "no-snapshotter"
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see - thanks.

@katexochen katexochen merged commit 75706e9 into main Jul 12, 2024
9 checks passed
@katexochen katexochen deleted the p/tardev-installer branch July 12, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Shiny new feature for our users
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants