@@ -36,7 +36,6 @@ import (
36
36
podresourcesapi "k8s.io/kubernetes/pkg/kubelet/apis/podresources/v1alpha1"
37
37
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
38
38
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager"
39
- "k8s.io/kubernetes/pkg/kubelet/cm/devicemanager"
40
39
"k8s.io/kubernetes/pkg/kubelet/cm/topologymanager"
41
40
"k8s.io/kubernetes/pkg/kubelet/config"
42
41
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
@@ -53,10 +52,6 @@ type containerManagerImpl struct {
53
52
cadvisorInterface cadvisor.Interface
54
53
// Config of this node.
55
54
nodeConfig NodeConfig
56
- // Interface for exporting and allocating devices reported by device plugins.
57
- deviceManager devicemanager.Manager
58
- // Interface for Topology resource co-ordination
59
- topologyManager topologymanager.Manager
60
55
}
61
56
62
57
type noopWindowsResourceAllocator struct {}
@@ -84,11 +79,6 @@ func (cm *containerManagerImpl) Start(node *v1.Node,
84
79
}
85
80
}
86
81
87
- // Starts device manager.
88
- if err := cm .deviceManager .Start (devicemanager .ActivePodsFunc (activePods ), sourcesReady ); err != nil {
89
- return err
90
- }
91
-
92
82
return nil
93
83
}
94
84
@@ -103,23 +93,11 @@ func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.I
103
93
}
104
94
capacity := cadvisor .CapacityFromMachineInfo (machineInfo )
105
95
106
- cm := & containerManagerImpl {
96
+ return & containerManagerImpl {
107
97
capacity : capacity ,
108
98
nodeConfig : nodeConfig ,
109
99
cadvisorInterface : cadvisorInterface ,
110
- }
111
-
112
- klog .Infof ("Creating device plugin manager: %t" , devicePluginEnabled )
113
- if devicePluginEnabled {
114
- cm .deviceManager , err = devicemanager .NewManagerImpl (nil , cm .topologyManager )
115
- } else {
116
- cm .deviceManager , err = devicemanager .NewManagerStub ()
117
- }
118
- if err != nil {
119
- return nil , err
120
- }
121
-
122
- return cm , nil
100
+ }, nil
123
101
}
124
102
125
103
func (cm * containerManagerImpl ) SystemCgroupsLimit () v1.ResourceList {
@@ -172,36 +150,23 @@ func (cm *containerManagerImpl) GetCapacity() v1.ResourceList {
172
150
}
173
151
174
152
func (cm * containerManagerImpl ) GetPluginRegistrationHandler () cache.PluginHandler {
175
- return cm . deviceManager . GetWatcherHandler ()
153
+ return nil
176
154
}
177
155
178
156
func (cm * containerManagerImpl ) GetDevicePluginResourceCapacity () (v1.ResourceList , v1.ResourceList , []string ) {
179
- return cm . deviceManager . GetCapacity ()
157
+ return nil , nil , [] string {}
180
158
}
181
159
182
160
func (cm * containerManagerImpl ) NewPodContainerManager () PodContainerManager {
183
161
return & podContainerManagerStub {}
184
162
}
185
163
186
164
func (cm * containerManagerImpl ) GetResources (pod * v1.Pod , container * v1.Container ) (* kubecontainer.RunContainerOptions , error ) {
187
- opts := & kubecontainer.RunContainerOptions {}
188
- // Allocate should already be called during predicateAdmitHandler.Admit(),
189
- // just try to fetch device runtime information from cached state here
190
- devOpts , err := cm .deviceManager .GetDeviceRunContainerOptions (pod , container )
191
- if err != nil {
192
- return nil , err
193
- } else if devOpts == nil {
194
- return opts , nil
195
- }
196
- opts .Devices = append (opts .Devices , devOpts .Devices ... )
197
- opts .Mounts = append (opts .Mounts , devOpts .Mounts ... )
198
- opts .Envs = append (opts .Envs , devOpts .Envs ... )
199
- opts .Annotations = append (opts .Annotations , devOpts .Annotations ... )
200
- return opts , nil
165
+ return & kubecontainer.RunContainerOptions {}, nil
201
166
}
202
167
203
- func (cm * containerManagerImpl ) UpdatePluginResources (node * schedulerframework.NodeInfo , attrs * lifecycle.PodAdmitAttributes ) error {
204
- return cm . deviceManager . UpdatePluginResources ( node , attrs )
168
+ func (cm * containerManagerImpl ) UpdatePluginResources (* schedulerframework.NodeInfo , * lifecycle.PodAdmitAttributes ) error {
169
+ return nil
205
170
}
206
171
207
172
func (cm * containerManagerImpl ) InternalContainerLifecycle () InternalContainerLifecycle {
@@ -212,12 +177,12 @@ func (cm *containerManagerImpl) GetPodCgroupRoot() string {
212
177
return ""
213
178
}
214
179
215
- func (cm * containerManagerImpl ) GetDevices (podUID , containerName string ) []* podresourcesapi.ContainerDevices {
216
- return cm . deviceManager . GetDevices ( podUID , containerName )
180
+ func (cm * containerManagerImpl ) GetDevices (_ , _ string ) []* podresourcesapi.ContainerDevices {
181
+ return nil
217
182
}
218
183
219
184
func (cm * containerManagerImpl ) ShouldResetExtendedResourceCapacity () bool {
220
- return cm . deviceManager . ShouldResetExtendedResourceCapacity ()
185
+ return false
221
186
}
222
187
223
188
func (cm * containerManagerImpl ) GetAllocateResourcesPodAdmitHandler () lifecycle.PodAdmitHandler {
0 commit comments