Change:
limitations under the License. */ <ins> // containerManagerImpl implements container manager on Windows. // Only GetNodeAllocatableReservation() and GetCapacity() are implemented now. </ins> package cm import ( <del> "github.com/golang/glog" </del> <ins> "fmt" "github.com/golang/glog" </ins> "k8s.io/api/core/v1" <ins> "k8s.io/apimachinery/pkg/api/resource" utilfeature "k8s.io/apiserver/pkg/util/feature" </ins> "k8s.io/client-go/tools/record" <ins> kubefeatures "k8s.io/kubernetes/pkg/features" </ins> internalapi "k8s.io/kubernetes/pkg/kubelet/apis/cri" "k8s.io/kubernetes/pkg/kubelet/cadvisor" <ins> "k8s.io/kubernetes/pkg/kubelet/cm/cpumanager" </ins> "k8s.io/kubernetes/pkg/kubelet/config" <ins> kubecontainer "k8s.io/kubernetes/pkg/kubelet/container" "k8s.io/kubernetes/pkg/kubelet/lifecycle" </ins> "k8s.io/kubernetes/pkg/kubelet/status" <ins> "k8s.io/kubernetes/pkg/kubelet/util/pluginwatcher" schedulercache "k8s.io/kubernetes/pkg/scheduler/cache" </ins> "k8s.io/kubernetes/pkg/util/mount" ) type containerManagerImpl struct { <del> containerManagerStub </del> <ins> // Capacity of this node. capacity v1.ResourceList // Interface for cadvisor. cadvisorInterface cadvisor.Interface // Config of this node. nodeConfig NodeConfig </ins> } <del> var _ ContainerManager = &containerManagerImpl{} </del> <ins> func (cm *containerManagerImpl) Start(node *v1.Node, activePods ActivePodsFunc, sourcesReady config.SourcesReady, podStatusProvider status.PodStatusProvider, runtimeService internalapi.RuntimeService) error { glog.V(2).Infof("Starting Windows container manager") if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.LocalStorageCapacityIsolation) { rootfs, err := cm.cadvisorInterface.RootFsInfo() if err != nil { return fmt.Errorf("failed to get rootfs info: %v", err) } for rName, rCap := range cadvisor.EphemeralStorageCapacityFromFsInfo(rootfs) { cm.capacity[rName] = rCap } } </ins> <del> func (cm *containerManagerImpl) Start(_ *v1.Node, _ ActivePodsFunc, _ config.SourcesReady, _ status.PodStatusProvider, _ internalapi.RuntimeService) error { glog.V(2).Infof("Starting Windows stub container manager") </del> return nil } <ins> // NewContainerManager creates windows container manager. </ins> func NewContainerManager(mountUtil mount.Interface, cadvisorInterface cadvisor.Interface, nodeConfig NodeConfig, failSwapOn bool, devicePluginEnabled bool, recorder record.EventRecorder) (ContainerManager, error) { <del> return &containerManagerImpl{}, nil </del> <ins> var capacity = v1.ResourceList{} // It is safe to invoke `MachineInfo` on cAdvisor before logically initializing cAdvisor here because // machine info is computed and cached once as part of cAdvisor object creation. // But `RootFsInfo` and `ImagesFsInfo` are not available at this moment so they will be called later during manager starts machineInfo, err := cadvisorInterface.MachineInfo() if err != nil { return nil, err } capacity = cadvisor.CapacityFromMachineInfo(machineInfo) return &containerManagerImpl{ capacity:          capacity, nodeConfig:        nodeConfig, cadvisorInterface: cadvisorInterface, }, nil } func (cm *containerManagerImpl) SystemCgroupsLimit() v1.ResourceList { return v1.ResourceList{} } func (cm *containerManagerImpl) GetNodeConfig() NodeConfig { return NodeConfig{} } func (cm *containerManagerImpl) GetMountedSubsystems() *CgroupSubsystems { return &CgroupSubsystems{} } func (cm *containerManagerImpl) GetQOSContainersInfo() QOSContainersInfo { return QOSContainersInfo{} } func (cm *containerManagerImpl) UpdateQOSCgroups() error { return nil } func (cm *containerManagerImpl) Status() Status { return Status{} } func (cm *containerManagerImpl) GetNodeAllocatableReservation() v1.ResourceList { evictionReservation := hardEvictionReservation(cm.nodeConfig.HardEvictionThresholds, cm.capacity) result := make(v1.ResourceList) for k := range cm.capacity { value := resource.NewQuantity(0, resource.DecimalSI) if cm.nodeConfig.SystemReserved != nil { value.Add(cm.nodeConfig.SystemReserved[k]) } if cm.nodeConfig.KubeReserved != nil { value.Add(cm.nodeConfig.KubeReserved[k]) } if evictionReservation != nil { value.Add(evictionReservation[k]) } if !value.IsZero() { result[k] = *value } } return result } func (cm *containerManagerImpl) GetCapacity() v1.ResourceList { return cm.capacity } func (cm *containerManagerImpl) GetPluginRegistrationHandler() pluginwatcher.PluginHandler { return nil } func (cm *containerManagerImpl) GetDevicePluginResourceCapacity() (v1.ResourceList, v1.ResourceList, []string) { return nil, nil, []string{} } func (cm *containerManagerImpl) NewPodContainerManager() PodContainerManager { return &podContainerManagerStub{} } func (cm *containerManagerImpl) GetResources(pod *v1.Pod, container *v1.Container) (*kubecontainer.RunContainerOptions, error) { return &kubecontainer.RunContainerOptions{}, nil } func (cm *containerManagerImpl) UpdatePluginResources(*schedulercache.NodeInfo, *lifecycle.PodAdmitAttributes) error { return nil } func (cm *containerManagerImpl) InternalContainerLifecycle() InternalContainerLifecycle { return &internalContainerLifecycleImpl{cpumanager.NewFakeManager()} } func (cm *containerManagerImpl) GetPodCgroupRoot() string { return "" </ins> }

Discussion:
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug What happened: After running some tests, we're seeing that the combined usage of kubelet + docker can be around 2Gi. We need to be able to account for this in scheduling to avoid crashing these services. The first step towards this is using kube-reserved and system-reserved to avoid oversubscribing the virtual memory space available on the Windows nodes with too many containers. What you expected to happen: It should reduce node allocatable memory by kube-reserved + system-reserved. How to reproduce it (as minimally and precisely as possible): This logs an error in the kubelet log such as: code: Anything else we need to know?: /milestone v1.13 /assign feiskyer /sig windows This blocks a PR where I want to set it by default to 2Gi Environment: Kubernetes version (use ): v1.11.3 (also v1.12) Cloud provider or hardware configuration: Azure OS (e.g. from /etc/os-release): Windows Server version 1803 Install tools: acs-engine
You must be a member of the github team to set the milestone. <detailsIn response to : Is this a BUG REPORT or FEATURE REQUEST?: What happened: What you expected to happen: This logs an error in the kubelet log such as: code: /milestone v1.13 /assign feiskyer Kubernetes version (use ): v1.11.3 (also v1.12) Cloud provider or hardware configuration: Azure OS (e.g. from /etc/os-release): Windows Server version 1803 Install tools: acs-engine Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/milestone v1.13
/priority important-soon