mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #14820 from gmarek/playground
Auto commit by PR queue bot
This commit is contained in:
commit
6ca515c312
@ -381,6 +381,7 @@ func (s *KubeletServer) KubeletConfig() (*KubeletConfig, error) {
|
||||
NetworkPluginName: s.NetworkPluginName,
|
||||
NetworkPlugins: ProbeNetworkPlugins(s.NetworkPluginDir),
|
||||
NodeStatusUpdateFrequency: s.NodeStatusUpdateFrequency,
|
||||
OOMAdjuster: oom.NewOOMAdjuster(),
|
||||
OSInterface: kubecontainer.RealOS{},
|
||||
PodCIDR: s.PodCIDR,
|
||||
PodInfraContainerImage: s.PodInfraContainerImage,
|
||||
@ -449,7 +450,7 @@ func (s *KubeletServer) Run(kcfg *KubeletConfig) error {
|
||||
glog.V(2).Infof("Using root directory: %v", s.RootDirectory)
|
||||
|
||||
// TODO(vmarmol): Do this through container config.
|
||||
oomAdjuster := oom.NewOOMAdjuster()
|
||||
oomAdjuster := kcfg.OOMAdjuster
|
||||
if err := oomAdjuster.ApplyOOMScoreAdj(0, s.OOMScoreAdj); err != nil {
|
||||
glog.Warning(err)
|
||||
}
|
||||
@ -639,6 +640,7 @@ func SimpleKubelet(client *client.Client,
|
||||
MinimumGCAge: minimumGCAge,
|
||||
Mounter: mount.New(),
|
||||
NodeStatusUpdateFrequency: nodeStatusUpdateFrequency,
|
||||
OOMAdjuster: oom.NewFakeOOMAdjuster(),
|
||||
OSInterface: osInterface,
|
||||
PodInfraContainerImage: dockertools.PodInfraContainerImage,
|
||||
Port: port,
|
||||
@ -819,6 +821,7 @@ type KubeletConfig struct {
|
||||
NetworkPlugins []network.NetworkPlugin
|
||||
NodeName string
|
||||
NodeStatusUpdateFrequency time.Duration
|
||||
OOMAdjuster *oom.OOMAdjuster
|
||||
OSInterface kubecontainer.OSInterface
|
||||
PodCIDR string
|
||||
PodInfraContainerImage string
|
||||
@ -910,7 +913,8 @@ func createAndInitKubelet(kc *KubeletConfig) (k KubeletBootstrap, pc *config.Pod
|
||||
kc.DockerExecHandler,
|
||||
kc.ResolverConfig,
|
||||
kc.CPUCFSQuota,
|
||||
daemonEndpoints)
|
||||
daemonEndpoints,
|
||||
kc.OOMAdjuster)
|
||||
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
@ -320,6 +320,7 @@ func (ks *KubeletExecutorServer) createAndInitKubelet(
|
||||
&api.NodeDaemonEndpoints{
|
||||
KubeletEndpoint: api.DaemonEndpoint{Port: int(kc.Port)},
|
||||
},
|
||||
kc.OOMAdjuster,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
|
@ -178,7 +178,8 @@ func NewMainKubelet(
|
||||
dockerExecHandler dockertools.ExecHandler,
|
||||
resolverConfig string,
|
||||
cpuCFSQuota bool,
|
||||
daemonEndpoints *api.NodeDaemonEndpoints) (*Kubelet, error) {
|
||||
daemonEndpoints *api.NodeDaemonEndpoints,
|
||||
oomAdjuster *oom.OOMAdjuster) (*Kubelet, error) {
|
||||
if rootDirectory == "" {
|
||||
return nil, fmt.Errorf("invalid root directory %q", rootDirectory)
|
||||
}
|
||||
@ -307,7 +308,6 @@ func NewMainKubelet(
|
||||
return nil, err
|
||||
}
|
||||
|
||||
oomAdjuster := oom.NewOOMAdjuster()
|
||||
procFs := procfs.NewProcFs()
|
||||
|
||||
// Initialize the runtime.
|
||||
|
@ -20,6 +20,7 @@ type FakeOOMAdjuster struct{}
|
||||
|
||||
func NewFakeOOMAdjuster() *OOMAdjuster {
|
||||
return &OOMAdjuster{
|
||||
pidLister: func(cgroupName string) ([]int, error) { return make([]int, 0), nil },
|
||||
ApplyOOMScoreAdj: fakeApplyOOMScoreAdj,
|
||||
ApplyOOMScoreAdjContainer: fakeApplyOOMScoreAdjContainer,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user