Skip to content

Commit

Permalink
node-installer: pass through CDI annotations
Browse files Browse the repository at this point in the history
For GPU support, Kata needs CDI pod annotations. We need to configure containerd to pass these through to Kata.
  • Loading branch information
msanft committed Dec 19, 2024
1 parent 1fb5838 commit 6043870
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions nodeinstaller/internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ func ContainerdRuntimeConfigFragment(baseDir, snapshotter string, platform platf
cfg.Options = map[string]any{
"ConfigPath": filepath.Join(baseDir, "etc", "configuration-qemu-snp.toml"),
}
// For GPU support, we need to pass through the CDI annotations.
if platform == platforms.K3sQEMUSNPGPU {
cfg.PodAnnotations = append(cfg.PodAnnotations, "cdi.k8s.io/*")
}
default:
return nil, fmt.Errorf("unsupported platform: %s", platform)
}
Expand Down
2 changes: 1 addition & 1 deletion nodeinstaller/testdata/expected-aks-clh-snp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ SystemdCgroup = false
[plugins.'io.containerd.grpc.v1.cri'.containerd.runtimes.my-runtime]
runtime_type = 'io.containerd.contrast-cc.v2'
runtime_path = '/opt/edgeless/my-runtime/bin/containerd-shim-contrast-cc-v2'
pod_annotations = ['io.katacontainers.*']
pod_annotations = ['io.katacontainers.*', 'cdi.k8s.io/*']
privileged_without_host_devices = true
snapshotter = 'tardev-my-runtime'

Expand Down
2 changes: 1 addition & 1 deletion nodeinstaller/testdata/expected-bare-metal-qemu-snp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SystemdCgroup = false
[plugins.'io.containerd.grpc.v1.cri'.containerd.runtimes.my-runtime]
runtime_type = 'io.containerd.contrast-cc.v2'
runtime_path = '/opt/edgeless/my-runtime/bin/containerd-shim-contrast-cc-v2'
pod_annotations = ['io.katacontainers.*']
pod_annotations = ['io.katacontainers.*', 'cdi.k8s.io/*']
privileged_without_host_devices = true
snapshotter = 'nydus-my-runtime'

Expand Down
2 changes: 1 addition & 1 deletion nodeinstaller/testdata/expected-bare-metal-qemu-tdx.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SystemdCgroup = false
[plugins.'io.containerd.grpc.v1.cri'.containerd.runtimes.my-runtime]
runtime_type = 'io.containerd.contrast-cc.v2'
runtime_path = '/opt/edgeless/my-runtime/bin/containerd-shim-contrast-cc-v2'
pod_annotations = ['io.katacontainers.*']
pod_annotations = ['io.katacontainers.*', 'cdi.k8s.io/*']
privileged_without_host_devices = true
snapshotter = 'nydus-my-runtime'

Expand Down

0 comments on commit 6043870

Please sign in to comment.