Skip to content

Commit

Permalink
KEP-4603: Node specific kubelet config for maximum backoff down to 1 …
Browse files Browse the repository at this point in the history
…second (#128374)

* Add feature gate, API, and conflict validation tests for enablecrashloopbackoffmax

Signed-off-by: Laura Lorenz <[email protected]>

* Handle when current base is longer than node max

Signed-off-by: Laura Lorenz <[email protected]>

* Update pkg/features/kube_features.go

Co-authored-by: Tsubasa Nagasawa <[email protected]>

* Fix indentation

Signed-off-by: Laura Lorenz <[email protected]>

* Follow convention for success test

Signed-off-by: Laura Lorenz <[email protected]>

* Normalize casing, and change field to Duration

Signed-off-by: Laura Lorenz <[email protected]>

* Fix json name and some other casing errors

Signed-off-by: Laura Lorenz <[email protected]>

* Another one I missed before

Signed-off-by: Laura Lorenz <[email protected]>

* Don't clobber global max function

Signed-off-by: Laura Lorenz <[email protected]>

* Change to flat value in defaults.go

Signed-off-by: Laura Lorenz <[email protected]>

* Streamline validation and defaults

Signed-off-by: Laura Lorenz <[email protected]>

* Fix typecheck

Signed-off-by: Laura Lorenz <[email protected]>

* Lint

Signed-off-by: Laura Lorenz <[email protected]>

* Tighten up validation for subsecond values

Signed-off-by: Laura Lorenz <[email protected]>

* Rename field from MaxBackOffPeriod to MaxContainerRestartPeriod

Signed-off-by: Laura Lorenz <[email protected]>

* A few missed references to renames

Signed-off-by: Laura Lorenz <[email protected]>

* Only compare flags in flags test

Signed-off-by: Laura Lorenz <[email protected]>

* Don't mess with SetDefault signature

Nobody messes with SetDefault signature

Signed-off-by: Laura Lorenz <[email protected]>

* Fix stale signature change, and update test data

Signed-off-by: Laura Lorenz <[email protected]>

* Inspect current feature gates at defaulting time

Signed-off-by: Laura Lorenz <[email protected]>

* Don't use the global feature gate for temp usage

Signed-off-by: Laura Lorenz <[email protected]>

* Expose default error, and some comments

Signed-off-by: Laura Lorenz <[email protected]>

* Hint fuzzer for less arbitrary values to FeatureGates

Signed-off-by: Laura Lorenz <[email protected]>

---------

Signed-off-by: Laura Lorenz <[email protected]>
Co-authored-by: Tsubasa Nagasawa <[email protected]>

Kubernetes-commit: 7fe41da5221b215d097e930c6b7aa52e88324f66
  • Loading branch information
lauralorenz authored and k8s-publishing-bot committed Nov 9, 2024
1 parent 353a4bc commit 3b14f64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions config/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,11 @@ type KubeletConfiguration struct {
// +featureGate=GracefulNodeShutdownBasedOnPodPriority
// +optional
ShutdownGracePeriodByPodPriority []ShutdownGracePeriodByPodPriority `json:"shutdownGracePeriodByPodPriority,omitempty"`
// CrashLoopBackOff contains config to modify node-level parameters for
// container restart behavior
// +featureGate=KubeletCrashLoopBackOffMax
// +optional
CrashLoopBackOff CrashLoopBackOffConfig `json:"crashLoopBackOff,omitempty"`
// reservedMemory specifies a comma-separated list of memory reservations for NUMA nodes.
// The parameter makes sense only in the context of the memory manager feature.
// The memory manager will not allocate reserved memory for container workloads.
Expand Down Expand Up @@ -975,6 +980,15 @@ type MemorySwapConfiguration struct {
SwapBehavior string `json:"swapBehavior,omitempty"`
}

type CrashLoopBackOffConfig struct {
// maxContainerRestartPeriod is the maximum duration the backoff delay can accrue
// to for container restarts, minimum 1 second, maximum 300 seconds. If not set,
// defaults to the internal crashloopbackoff maximum (300s).
// +featureGate=KubeletCrashLoopBackOffMax
// +optional
MaxContainerRestartPeriod *metav1.Duration `json:"maxContainerRestartPeriod,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// CredentialProviderConfig is the configuration containing information about
Expand Down
22 changes: 22 additions & 0 deletions config/v1beta1/zz_generated.deepcopy.go

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

0 comments on commit 3b14f64

Please sign in to comment.