Sitelet https://github.com/kubernetes/kops/pull/18406
Skip to content

feat: add gVisor RuntimeClass support for containerd - #18406

Merged
k8s-ci-robot merged 4 commits into
kubernetes:masterfrom
ameukam:gvisor-runtime-support
Jun 7, 2026
Merged

k8s-ci-robot merged 4 commits into
kubernetes:masterfrom
ameukam:gvisor-runtime-support

Conversation

@ameukam

@ameukam ameukam commented May 23, 2026

Copy link
Copy Markdown
Member

Add support for running workloads under gVisor (runsc) as a containerd runtime handler, following the existing NVIDIA GPU runtime pattern.

gVisor is gated to Debian-family distributions only. The runsc apt package provides both runsc and containerd-shim-runsc-v1.

Assisted by Opus 4.6

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 23, 2026
@k8s-ci-robot
k8s-ci-robot requested review from hakman and olemarkus May 23, 2026 15:23
Add support for running workloads under gVisor (runsc) as a containerd
runtime handler, following the existing NVIDIA GPU runtime pattern.

gVisor is gated to Debian-family distributions only. The runsc apt
package provides both runsc and containerd-shim-runsc-v1.

Assisted by Opus 4.6

Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
@ameukam
ameukam force-pushed the gvisor-runtime-support branch from 7c5a8e8 to 60b47c6 Compare May 23, 2026 15:27
@ameukam

ameukam commented May 23, 2026

Copy link
Copy Markdown
Member Author

/test pull-kops-e2e-k8s-gce-distro-debian13

@ameukam

ameukam commented May 23, 2026

Copy link
Copy Markdown
Member Author

/retest

@hakman

hakman commented May 23, 2026

Copy link
Copy Markdown
Member

@ameukam no need to deal with the tests for now, all good

@ameukam

ameukam commented May 24, 2026

Copy link
Copy Markdown
Member Author

/test pull-kops-e2e-k8s-gce-distro-debian13

@ameukam

ameukam commented May 24, 2026

Copy link
Copy Markdown
Member Author

@ameukam no need to deal with the tests for now, all good

Ok. let me check the debian13 at least.

FYI @rifelpet @justinsb

Comment thread nodeup/pkg/model/context.go Outdated
func (c *NodeupModelContext) InstallGVisorRuntime() bool {
return c.NodeupConfig.GVisor != nil &&
fi.ValueOf(c.NodeupConfig.GVisor.Enabled) &&
c.Distribution.IsDebianFamily()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: we should probably warn if we're not on debian but gvisor is enabled

Also, this probably gets to the whole "package" field naming :-)

return nil
}

c.AddTask(&nodetasks.AptSource{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Personally I would put the IsDebianFamily logic here, rather than in InstallGvisorRuntime.

Comment thread pkg/apis/nodeup/config.go Outdated
}

if (cluster.Spec.Containerd != nil && cluster.Spec.Containerd.GVisor != nil) || (instanceGroup.Spec.Containerd != nil && instanceGroup.Spec.Containerd.GVisor != nil) {
config.GVisor = buildGVisorConfig(cluster, instanceGroup)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: we could probably put the if (cluster.Spec.Containerd != nil && cluster.Spec.Containerd.GVisor != nil) || (instanceGroup.Spec.Containerd != nil && instanceGroup.Spec.Containerd.GVisor != nil) into buildGVisorConfig

}

// Label nodes that have gVisor enabled so the RuntimeClass nodeSelector works.
clusterGVisor := cluster.Spec.Containerd != nil && cluster.Spec.Containerd.GVisor != nil && fi.ValueOf(cluster.Spec.Containerd.GVisor.Enabled)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside: I wish we had cluster.Spec.GetContainerd().GetGVisor().GetEnabled(), like we get in proto.

// everywhere including VMs) or "kvm" (bare-metal with KVM support).
Platform string `json:"platform,omitempty"`
// Packages overrides the URL and hash for the gVisor packages.
Packages *PackagesConfig `json:"packages,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we actually do anything with packages? I think I posted it before, but maybe I didn't... "packages" feels very specific to install deb or rpm packages. What if we want to install it from a tar.gz or a future format (e.g. a container image).

If we're not using it yet, that's awesome, we can just remove it for now and avoid the naming problems!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Looks we want a SourcesSpec where we can be more explicity how we install binaries ? we may it limitations with immutable OS ?

@hakman hakman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Besides the Packages field being unused, there is also a more philosophical Q, should this be scoped to all types of IGs or just to workers and should it be allowed at cluster level or just meant to be specified for each IG.

Comment thread pkg/apis/kops/v1alpha3/containerdconfig.go Outdated
@ameukam

ameukam commented Jun 1, 2026

Copy link
Copy Markdown
Member Author

Besides the Packages field being unused, there is also a more philosophical Q, should this be scoped to all types of IGs or just to workers and should it be allowed at cluster level or just meant to be specified for each IG.

@hakman I have been thinking about this. I theorized we may have use-cases where third-party workloads on the Control plane IGs but it's very speculative. I'll scope this only to the workers and probably allow specificity for each worker.

@hakman

hakman commented Jun 1, 2026

Copy link
Copy Markdown
Member

Besides the Packages field being unused, there is also a more philosophical Q, should this be scoped to all types of IGs or just to workers and should it be allowed at cluster level or just meant to be specified for each IG.

@hakman I have been thinking about this. I theorized we may have use-cases where third-party workloads on the Control plane IGs but it's very speculative. I'll scope this only to the workers and probably allow specificity for each worker.

I guess you men scope it per IG and block with validation the Cluster level change.
Ideally we should add a pre-submit also, to make sure it actually works, though we can do it afterwards.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 6, 2026
Comment thread docs/releases/1.36-NOTES.md Outdated
kOps now supports running workloads under [gVisor](https://gvisor.dev/) (runsc) as a containerd runtime handler. When enabled, kOps installs the `runsc` runtime via apt, configures containerd with a `runsc` runtime handler, and creates a `gvisor` RuntimeClass. Pods targeting the RuntimeClass are automatically scheduled to nodes with gVisor enabled via the `kops.k8s.io/gvisor` node label.

gVisor can be enabled at the cluster or instance group level:
gVisor can be enabled at the cluster level or on worker instance groups. Cluster-level configuration installs gVisor only on worker instance groups, and instance group-level configuration is accepted only for workers:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's what I wanted to avoid, no cluster level setting with other weird gotchas as warm pools.
I would prefer to block the cluster setting via validation. If someone wants to enable it, do it one instance group at a time.

ameukam added 3 commits June 6, 2026 13:28
Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
gVisor (runsc) was previously installable on any instance group role.
Restrict it to nodes with role Node: reject cluster/IG configs that
enable gVisor on control plane, apiserver, or bastion roles, strip the
gVisor config from non-worker nodeup configs, and only apply the
gVisor node label and RuntimeClass addon when a worker has it enabled.

Also harden nil handling for cluster.Spec.Containerd in nodeup config
and bootstrapchannelbuilder. Update release notes and add tests across
validation, nodeup config, gvisor builder, and instancegroup spec.
@ameukam
ameukam force-pushed the gvisor-runtime-support branch from bb2a944 to 90d5ed3 Compare June 6, 2026 11:34
@ameukam

ameukam commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

/test pull-kops-e2e-k8s-gce-distro-debian13

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 7, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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

The pull request process is described here

Details 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 7, 2026
@hakman

hakman commented Jun 7, 2026

Copy link
Copy Markdown
Member

/override pull-kops-e2e-k8s-gce-distro-debian13

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-k8s-gce-distro-debian13

Details

In response to this:

/override pull-kops-e2e-k8s-gce-distro-debian13

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-sigs/prow repository.

@k8s-ci-robot
k8s-ci-robot merged commit c270160 into kubernetes:master Jun 7, 2026
42 checks passed
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. area/addons area/api area/documentation area/nodeup cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants