Unverified Commit 743e4fba authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #67709 from feiskyer/inodes-clean

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Kubelet: only apply default hard evictions of nodefs.inodesFree on Linux **What this PR does / why we need it**: Kubelet sets default hard evictions of `nodefs.inodesFree ` for all platforms today. This will cause errors on Windows and a lot `no observation found for eviction signal nodefs.inodesFree` errors will be logs for kubelet. ``` kubelet.err.log:4961:W0711 22:21:12.378789 2872 helpers.go:808] eviction manager: no observation found for eviction signal nodefs.inodesFree kubelet.err.log:4967:W0711 22:21:30.411371 2872 helpers.go:808] eviction manager: no observation found for eviction signal nodefs.inodesFree kubelet.err.log:4974:W0711 22:21:48.446456 2872 helpers.go:808] eviction manager: no observation found for eviction signal nodefs.inodesFree kubelet.err.log:4978:W0711 22:22:06.482441 2872 helpers.go:808] eviction manager: no observation found for eviction signal nodefs.inodesFree ``` This PR updates the default hard eviction value and only apply nodefs.inodesFree on Linux. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #66088 **Special notes for your reviewer**: **Release note**: ```release-note Kubelet only applies default hard evictions of nodefs.inodesFree on Linux ```
parents 8f906fef 8255318b
...@@ -81,12 +81,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} { ...@@ -81,12 +81,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
obj.KubeAPIQPS = 5 obj.KubeAPIQPS = 5
obj.KubeAPIBurst = 10 obj.KubeAPIBurst = 10
obj.HairpinMode = v1beta1.PromiscuousBridge obj.HairpinMode = v1beta1.PromiscuousBridge
obj.EvictionHard = map[string]string{ obj.EvictionHard = kubeletconfigv1beta1.DefaultEvictionHard
"memory.available": "100Mi",
"nodefs.available": "10%",
"nodefs.inodesFree": "5%",
"imagefs.available": "15%",
}
obj.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 5 * time.Minute} obj.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 5 * time.Minute}
obj.MakeIPTablesUtilChains = true obj.MakeIPTablesUtilChains = true
obj.IPTablesMasqueradeBit = kubeletconfigv1beta1.DefaultIPTablesMasqueradeBit obj.IPTablesMasqueradeBit = kubeletconfigv1beta1.DefaultIPTablesMasqueradeBit
......
...@@ -9,6 +9,8 @@ go_library( ...@@ -9,6 +9,8 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"defaults.go", "defaults.go",
"defaults_linux.go",
"defaults_others.go",
"doc.go", "doc.go",
"register.go", "register.go",
"zz_generated.conversion.go", "zz_generated.conversion.go",
......
...@@ -178,12 +178,7 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura ...@@ -178,12 +178,7 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura
obj.SerializeImagePulls = utilpointer.BoolPtr(true) obj.SerializeImagePulls = utilpointer.BoolPtr(true)
} }
if obj.EvictionHard == nil { if obj.EvictionHard == nil {
obj.EvictionHard = map[string]string{ obj.EvictionHard = DefaultEvictionHard
"memory.available": "100Mi",
"nodefs.available": "10%",
"nodefs.inodesFree": "5%",
"imagefs.available": "15%",
}
} }
if obj.EvictionPressureTransitionPeriod == zeroDuration { if obj.EvictionPressureTransitionPeriod == zeroDuration {
obj.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 5 * time.Minute} obj.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 5 * time.Minute}
......
// +build linux
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
// DefaultEvictionHard includes default options for hard eviction.
var DefaultEvictionHard = map[string]string{
"memory.available": "100Mi",
"nodefs.available": "10%",
"nodefs.inodesFree": "5%",
"imagefs.available": "15%",
}
// +build !linux
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
// DefaultEvictionHard includes default options for hard eviction.
var DefaultEvictionHard = map[string]string{
"memory.available": "100Mi",
"nodefs.available": "10%",
"imagefs.available": "15%",
}
...@@ -45,9 +45,8 @@ func (ds *dockerService) ImageFsInfo(_ context.Context, _ *runtimeapi.ImageFsInf ...@@ -45,9 +45,8 @@ func (ds *dockerService) ImageFsInfo(_ context.Context, _ *runtimeapi.ImageFsInf
filesystems := []*runtimeapi.FilesystemUsage{ filesystems := []*runtimeapi.FilesystemUsage{
{ {
Timestamp: time.Now().UnixNano(), Timestamp: time.Now().UnixNano(),
UsedBytes: &runtimeapi.UInt64Value{Value: fsinfo.Usage}, UsedBytes: &runtimeapi.UInt64Value{Value: fsinfo.Usage},
InodesUsed: &runtimeapi.UInt64Value{Value: 0},
FsId: &runtimeapi.FilesystemIdentifier{ FsId: &runtimeapi.FilesystemIdentifier{
Mountpoint: info.DockerRootDir, Mountpoint: info.DockerRootDir,
}, },
......
...@@ -182,9 +182,11 @@ func (p *criStatsProvider) ImageFsStats() (*statsapi.FsStats, error) { ...@@ -182,9 +182,11 @@ func (p *criStatsProvider) ImageFsStats() (*statsapi.FsStats, error) {
// TODO(yguo0905): Support returning stats of multiple image filesystems. // TODO(yguo0905): Support returning stats of multiple image filesystems.
for _, fs := range resp { for _, fs := range resp {
s := &statsapi.FsStats{ s := &statsapi.FsStats{
Time: metav1.NewTime(time.Unix(0, fs.Timestamp)), Time: metav1.NewTime(time.Unix(0, fs.Timestamp)),
UsedBytes: &fs.UsedBytes.Value, UsedBytes: &fs.UsedBytes.Value,
InodesUsed: &fs.InodesUsed.Value, }
if fs.InodesUsed != nil {
s.InodesUsed = &fs.InodesUsed.Value
} }
imageFsInfo := p.getFsInfo(fs.GetFsId()) imageFsInfo := p.getFsInfo(fs.GetFsId())
if imageFsInfo != nil { if imageFsInfo != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment