Skip to content

Commit 87a65f9

Browse files
committed
remove most of the kata manager related code under the assumption that kata manager state is not created ever
1 parent ee47dea commit 87a65f9

3 files changed

Lines changed: 1 addition & 51 deletions

File tree

controllers/object_controls.go

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"k8s.io/utils/ptr"
4646
"sigs.k8s.io/controller-runtime/pkg/client"
4747
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
48-
"sigs.k8s.io/yaml"
4948

5049
gpuv1 "github.com/NVIDIA/gpu-operator/api/nvidia/v1"
5150
driverconfig "github.com/NVIDIA/gpu-operator/internal/config"
@@ -161,8 +160,6 @@ const (
161160
DeviceListStrategyEnvName = "DEVICE_LIST_STRATEGY"
162161
// CDIAnnotationPrefixEnvName is the name of the device-plugin envvar for configuring the CDI annotation prefix
163162
CDIAnnotationPrefixEnvName = "CDI_ANNOTATION_PREFIX"
164-
// KataManagerAnnotationHashKey is the annotation indicating the hash of the kata-manager configuration
165-
KataManagerAnnotationHashKey = "nvidia.com/kata-manager.last-applied-hash"
166163
// DefaultKataArtifactsDir is the default directory to store kata artifacts on the host
167164
DefaultKataArtifactsDir = "/opt/nvidia-gpu-operator/artifacts/runtimeclasses/"
168165
// PodControllerRevisionHashLabelKey is the annotation key for pod controller revision hash value
@@ -577,16 +574,6 @@ func createConfigMap(n ClusterPolicyController, configMapIdx int) (gpuv1.State,
577574
}
578575
}
579576

580-
if obj.Name == "nvidia-kata-manager-config" {
581-
data, err := yaml.Marshal(config.KataManager.Config)
582-
if err != nil {
583-
return gpuv1.NotReady, fmt.Errorf("failed to marshal kata manager config: %v", err)
584-
}
585-
obj.Data = map[string]string{
586-
"config.yaml": string(data),
587-
}
588-
}
589-
590577
if err := controllerutil.SetControllerReference(n.singleton, obj, n.scheme); err != nil {
591578
return gpuv1.NotReady, err
592579
}
@@ -1391,13 +1378,7 @@ func transformForRuntime(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicySpec,
13911378
}
13921379

13931380
// Handle the drop-in configs
1394-
// TODO: It's a bit of a hack to skip the `nvidia-kata-manager` container here.
1395-
// Ideally if the two projects are using the SAME API then this should be
1396-
// captured more rigorously.
1397-
// Note that we probably want to implement drop-in file support in the
1398-
// kata manager in any case -- in which case it will be good to use a
1399-
// similar implementation.
1400-
if dropInConfigFile != "" && container.Name != "nvidia-kata-manager" {
1381+
if dropInConfigFile != "" {
14011382
sourceConfigFileName := path.Base(dropInConfigFile)
14021383
sourceConfigDir := path.Dir(dropInConfigFile)
14031384
containerConfigDir := DefaultRuntimeDropInConfigTargetDir
@@ -5086,11 +5067,6 @@ func RuntimeClasses(n ClusterPolicyController) (gpuv1.State, error) {
50865067
status := gpuv1.Ready
50875068
state := n.idx
50885069

5089-
if n.stateNames[state] == "state-kata-manager" {
5090-
// Kata Manager is deprecated, no need to process anything
5091-
return gpuv1.Ready, nil
5092-
}
5093-
50945070
nvidiaRuntimeClasses := n.resources[state].RuntimeClasses
50955071
if n.stateNames[state] == "pre-requisites" && !n.isStateEnabled(n.stateNames[state]) {
50965072
err := clearRuntimeClasses(n, nvidiaRuntimeClasses)

controllers/state_manager.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ var gpuStateLabels = map[string]map[string]string{
100100
"nvidia.com/gpu.deploy.sandbox-device-plugin": "true",
101101
"nvidia.com/gpu.deploy.sandbox-validator": "true",
102102
"nvidia.com/gpu.deploy.vfio-manager": "true",
103-
"nvidia.com/gpu.deploy.kata-manager": "true",
104103
"nvidia.com/gpu.deploy.cc-manager": "true",
105104
},
106105
gpuWorkloadConfigVMVgpu: {

controllers/transforms_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -504,31 +504,6 @@ func TestTransformForRuntime(t *testing.T) {
504504
},
505505
}),
506506
},
507-
// Cover the kata-manager naming case
508-
{
509-
description: "containerd skips drop-in for kata manager",
510-
runtime: gpuv1.Containerd,
511-
input: NewDaemonset().
512-
WithContainer(corev1.Container{Name: "nvidia-kata-manager"}),
513-
expectedOutput: NewDaemonset().
514-
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
515-
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
516-
WithContainer(corev1.Container{
517-
Name: "nvidia-kata-manager",
518-
Env: []corev1.EnvVar{
519-
{Name: "RUNTIME", Value: gpuv1.Containerd.String()},
520-
{Name: "CONTAINERD_RUNTIME_CLASS", Value: DefaultRuntimeClass},
521-
{Name: "RUNTIME_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultContainerdConfigFile))},
522-
{Name: "CONTAINERD_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultContainerdConfigFile))},
523-
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
524-
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
525-
},
526-
VolumeMounts: []corev1.VolumeMount{
527-
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
528-
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
529-
},
530-
}),
531-
},
532507
{
533508
description: "docker",
534509
runtime: gpuv1.Docker,

0 commit comments

Comments
 (0)