API change: add MemorySwap to KubeletConfiguration

This commit is contained in:
Elana Hashman 2021-06-11 17:08:53 -07:00
parent 9eeec68d67
commit bda03b4818
No known key found for this signature in database
GPG Key ID: D37F7B2A20B48FA0
5 changed files with 25 additions and 0 deletions

View File

@ -209,6 +209,7 @@ var (
"MaxOpenFiles",
"MaxPods",
"MemoryManagerPolicy",
"MemorySwap.SwapBehavior",
"NodeLeaseDurationSeconds",
"NodeStatusMaxImages",
"NodeStatusUpdateFrequency.Duration",

View File

@ -58,6 +58,7 @@ makeIPTablesUtilChains: true
maxOpenFiles: 1000000
maxPods: 110
memoryManagerPolicy: None
memorySwap: {}
nodeLeaseDurationSeconds: 40
nodeStatusMaxImages: 50
nodeStatusReportFrequency: 5m0s

View File

@ -58,6 +58,7 @@ makeIPTablesUtilChains: true
maxOpenFiles: 1000000
maxPods: 110
memoryManagerPolicy: None
memorySwap: {}
nodeLeaseDurationSeconds: 40
nodeStatusMaxImages: 50
nodeStatusReportFrequency: 5m0s

View File

@ -326,6 +326,10 @@ type KubeletConfiguration struct {
FeatureGates map[string]bool
// Tells the Kubelet to fail to start if swap is enabled on the node.
FailSwapOn bool
// Configure swap memory available to container workloads.
// +featureGate=NodeSwapEnabled
// +optional
MemorySwap MemorySwapConfiguration
// A quantity defines the maximum size of the container log file before it is rotated. For example: "5Mi" or "256Ki".
ContainerLogMaxSize string
// Maximum number of container log files that can be present for a container.
@ -568,3 +572,10 @@ type MemoryReservation struct {
NumaNode int32
Limits v1.ResourceList
}
type MemorySwapConfiguration struct {
// Configure swap memory available to container workloads. May be one of
// "", "NoSwap": workloads cannot use swap
// "UnlimitedSwap": workloads can use unlimited swap, up to the allocatable limit.
SwapBehavior string
}

View File

@ -752,6 +752,10 @@ type KubeletConfiguration struct {
// Default: true
// +optional
FailSwapOn *bool `json:"failSwapOn,omitempty"`
// Configure swap memory available to container workloads.
// +featureGate=NodeSwapEnabled
// +optional
MemorySwap MemorySwapConfiguration `json:"memorySwap,omitempty"`
// containerLogMaxSize is a quantity defining the maximum size of the container log
// file before it is rotated. For example: "5Mi" or "256Ki".
// Dynamic Kubelet Config (beta): If dynamically updating this field, consider that
@ -1035,3 +1039,10 @@ type MemoryReservation struct {
NumaNode int32 `json:"numaNode"`
Limits v1.ResourceList `json:"limits"`
}
// Configure swap memory available to container workloads. May be one of
// "", "NoSwap": workloads cannot use swap
// "UnlimitedSwap": workloads can use unlimited swap, up to the allocatable limit.
type MemorySwapConfiguration struct {
SwapBehavior string `json:"swapBehavior,omitempty"`
}