Skip to content

Commit 06dd32b

Browse files
committed
remove most of the kata manager related code under the assumption that kata manager state is not created ever
1 parent dbd99c9 commit 06dd32b

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
@@ -609,16 +606,6 @@ func createConfigMap(n ClusterPolicyController, configMapIdx int) (gpuv1.State,
609606
}
610607
}
611608

612-
if obj.Name == "nvidia-kata-manager-config" {
613-
data, err := yaml.Marshal(config.KataManager.Config)
614-
if err != nil {
615-
return gpuv1.NotReady, fmt.Errorf("failed to marshal kata manager config: %v", err)
616-
}
617-
obj.Data = map[string]string{
618-
"config.yaml": string(data),
619-
}
620-
}
621-
622609
if err := controllerutil.SetControllerReference(n.singleton, obj, n.scheme); err != nil {
623610
return gpuv1.NotReady, err
624611
}
@@ -1462,13 +1449,7 @@ func transformRuntimeConfigAndSocketMounts(obj *appsv1.DaemonSet, runtime string
14621449
}
14631450

14641451
// Handle the drop-in configs
1465-
// TODO: It's a bit of a hack to skip the `nvidia-kata-manager` container here.
1466-
// Ideally if the two projects are using the SAME API then this should be
1467-
// captured more rigorously.
1468-
// Note that we probably want to implement drop-in file support in the
1469-
// kata manager in any case -- in which case it will be good to use a
1470-
// similar implementation.
1471-
if dropInConfigFile != "" && container.Name != "nvidia-kata-manager" {
1452+
if dropInConfigFile != "" {
14721453
sourceConfigFileName := path.Base(dropInConfigFile)
14731454
sourceConfigDir := path.Dir(dropInConfigFile)
14741455
containerConfigDir := DefaultRuntimeDropInConfigTargetDir
@@ -5181,11 +5162,6 @@ func RuntimeClasses(n ClusterPolicyController) (gpuv1.State, error) {
51815162
status := gpuv1.Ready
51825163
state := n.idx
51835164

5184-
if n.stateNames[state] == "state-kata-manager" {
5185-
// Kata Manager is deprecated, no need to process anything
5186-
return gpuv1.Ready, nil
5187-
}
5188-
51895165
nvidiaRuntimeClasses := n.resources[state].RuntimeClasses
51905166
if n.stateNames[state] == "pre-requisites" && !n.isStateEnabled(n.stateNames[state]) {
51915167
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
@@ -511,31 +511,6 @@ func TestTransformForRuntime(t *testing.T) {
511511
},
512512
}),
513513
},
514-
// Cover the kata-manager naming case
515-
{
516-
description: "containerd skips drop-in for kata manager",
517-
runtime: gpuv1.Containerd,
518-
input: NewDaemonset().
519-
WithContainer(corev1.Container{Name: "nvidia-kata-manager"}),
520-
expectedOutput: NewDaemonset().
521-
WithHostPathVolume("containerd-config", filepath.Dir(DefaultContainerdConfigFile), ptr.To(corev1.HostPathDirectoryOrCreate)).
522-
WithHostPathVolume("containerd-socket", filepath.Dir(DefaultContainerdSocketFile), nil).
523-
WithContainer(corev1.Container{
524-
Name: "nvidia-kata-manager",
525-
Env: []corev1.EnvVar{
526-
{Name: "RUNTIME", Value: gpuv1.Containerd.String()},
527-
{Name: "CONTAINERD_RUNTIME_CLASS", Value: DefaultRuntimeClass},
528-
{Name: "RUNTIME_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultContainerdConfigFile))},
529-
{Name: "CONTAINERD_CONFIG", Value: filepath.Join(DefaultRuntimeConfigTargetDir, filepath.Base(DefaultContainerdConfigFile))},
530-
{Name: "RUNTIME_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
531-
{Name: "CONTAINERD_SOCKET", Value: filepath.Join(DefaultRuntimeSocketTargetDir, filepath.Base(DefaultContainerdSocketFile))},
532-
},
533-
VolumeMounts: []corev1.VolumeMount{
534-
{Name: "containerd-config", MountPath: DefaultRuntimeConfigTargetDir},
535-
{Name: "containerd-socket", MountPath: DefaultRuntimeSocketTargetDir},
536-
},
537-
}),
538-
},
539514
{
540515
description: "docker",
541516
runtime: gpuv1.Docker,

0 commit comments

Comments
 (0)