Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MemorySwap #15352

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3791,6 +3791,17 @@ spec:
Kubelet.
format: int32
type: integer
memorySwap:
description: MemorySwap defines the memory swap behavior
type: string
memorySwapConfiguration:
description: MemorySwapConfiguration holds the memory swap configuration
for the kubelet
properties:
swapBehavior:
description: SwapBehavior can be "" or "UnlimitedSwap"
type: string
type: object
networkPluginMTU:
description: NetworkPluginMTU is the MTU to be passed to the network
plugin, and overrides the default MTU for cases where it cannot
Expand Down Expand Up @@ -4220,6 +4231,17 @@ spec:
Kubelet.
format: int32
type: integer
memorySwap:
description: MemorySwap defines the memory swap behavior
type: string
memorySwapConfiguration:
description: MemorySwapConfiguration holds the memory swap configuration
for the kubelet
properties:
swapBehavior:
description: SwapBehavior can be "" or "UnlimitedSwap"
type: string
type: object
networkPluginMTU:
description: NetworkPluginMTU is the MTU to be passed to the network
plugin, and overrides the default MTU for cases where it cannot
Expand Down
11 changes: 11 additions & 0 deletions k8s/crds/kops.k8s.io_instancegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,17 @@ spec:
Kubelet.
format: int32
type: integer
memorySwap:
description: MemorySwap defines the memory swap behavior
type: string
memorySwapConfiguration:
description: MemorySwapConfiguration holds the memory swap configuration
for the kubelet
properties:
swapBehavior:
description: SwapBehavior can be "" or "UnlimitedSwap"
type: string
type: object
networkPluginMTU:
description: NetworkPluginMTU is the MTU to be passed to the network
plugin, and overrides the default MTU for cases where it cannot
Expand Down
11 changes: 10 additions & 1 deletion pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ type KubeletConfigSpec struct {
EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"`
// PodPidsLimit is the maximum number of pids in any pod.
PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"`

// ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by.
// Default: 30s
ShutdownGracePeriod *metav1.Duration `json:"shutdownGracePeriod,omitempty"`
// ShutdownGracePeriodCriticalPods specifies the duration used to terminate critical pods during a node shutdown.
// Default: 10s
ShutdownGracePeriodCriticalPods *metav1.Duration `json:"shutdownGracePeriodCriticalPods,omitempty"`
// MemorySwapConfiguration holds the memory swap configuration for the kubelet
MemorySwapConfiguration *MemorySwapConfiguration `json:"memorySwapConfiguration,omitempty"`
// MemorySwap defines the memory swap behavior
MemorySwap *string `json:"memorySwap,omitempty"`
}

// KubeProxyConfig defines the configuration for a proxy
Expand Down Expand Up @@ -1096,13 +1099,19 @@ type LoadBalancerControllerSpec struct {
// Default: false
EnableWAF bool `json:"enableWAF,omitempty"`
// EnableWAFv2 specifies whether the controller can use WAFs (V2).

// Default: false
EnableWAFv2 bool `json:"enableWAFv2,omitempty"`
// EnableShield specifies whether the controller can enable Shield Advanced.
// Default: false
EnableShield bool `json:"enableShield,omitempty"`
}

type MemorySwapConfiguration struct {
// SwapBehavior can be "" or "UnlimitedSwap"
SwapBehavior *string `json:"swapBehavior,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
10 changes: 9 additions & 1 deletion pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,16 @@ type KubeletConfigSpec struct {
EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"`
// PodPidsLimit is the maximum number of pids in any pod.
PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"`

// ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by.
// Default: 30s
ShutdownGracePeriod *metav1.Duration `json:"shutdownGracePeriod,omitempty"`
// ShutdownGracePeriodCriticalPods specifies the duration used to terminate critical pods during a node shutdown.
// Default: 10s
ShutdownGracePeriodCriticalPods *metav1.Duration `json:"shutdownGracePeriodCriticalPods,omitempty"`
// MemorySwapConfiguration holds the memory swap configuration for the kubelet
MemorySwapConfiguration *MemorySwapConfiguration `json:"memorySwapConfiguration,omitempty"`
// MemorySwap defines the memory swap behavior
MemorySwap *string `json:"memorySwap,omitempty"`
}

// KubeProxyConfig defines the configuration for a proxy
Expand Down Expand Up @@ -1166,6 +1169,11 @@ type LoadBalancerControllerSpec struct {
EnableShield bool `json:"enableShield,omitempty"`
}

type MemorySwapConfiguration struct {
// SwapBehavior can be "" or "UnlimitedSwap"
SwapBehavior *string `json:"swapBehavior,omitempty"`
}

// HasAdmissionController checks if a specific admission controller is enabled
func (c *KubeAPIServerConfig) HasAdmissionController(name string) bool {
for _, x := range c.AdmissionControl {
Expand Down
50 changes: 50 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion pkg/apis/kops/v1alpha3/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,16 @@ type KubeletConfigSpec struct {
EnableCadvisorJsonEndpoints *bool `json:"enableCadvisorJsonEndpoints,omitempty" flag:"enable-cadvisor-json-endpoints"`
// PodPidsLimit is the maximum number of pids in any pod.
PodPidsLimit *int64 `json:"podPidsLimit,omitempty" flag:"pod-max-pids"`

// ShutdownGracePeriod specifies the total duration that the node should delay the shutdown by.
// Default: 30s
ShutdownGracePeriod *metav1.Duration `json:"shutdownGracePeriod,omitempty"`
// ShutdownGracePeriodCriticalPods specifies the duration used to terminate critical pods during a node shutdown.
// Default: 10s
ShutdownGracePeriodCriticalPods *metav1.Duration `json:"shutdownGracePeriodCriticalPods,omitempty"`
// MemorySwapConfiguration holds the memory swap configuration for the kubelet
MemorySwapConfiguration *MemorySwapConfiguration `json:"memorySwapConfiguration,omitempty"`
// MemorySwap defines the memory swap behavior
MemorySwap *string `json:"memorySwap,omitempty"`
}

// KubeProxyConfig defines the configuration for a proxy
Expand Down Expand Up @@ -1095,3 +1098,8 @@ type LoadBalancerControllerSpec struct {
// Default: false
EnableShield bool `json:"enableShield,omitempty"`
}

type MemorySwapConfiguration struct {
// SwapBehavior can be "" or "UnlimitedSwap"
SwapBehavior *string `json:"swapBehavior,omitempty"`
}
50 changes: 50 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading