diff --git a/config/v1beta1/types.go b/config/v1beta1/types.go index d10578f2..e5ac2d18 100644 --- a/config/v1beta1/types.go +++ b/config/v1beta1/types.go @@ -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. @@ -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 diff --git a/config/v1beta1/zz_generated.deepcopy.go b/config/v1beta1/zz_generated.deepcopy.go index 0ab6259f..89dda0df 100644 --- a/config/v1beta1/zz_generated.deepcopy.go +++ b/config/v1beta1/zz_generated.deepcopy.go @@ -28,6 +28,27 @@ import ( apiv1 "k8s.io/component-base/tracing/api/v1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CrashLoopBackOffConfig) DeepCopyInto(out *CrashLoopBackOffConfig) { + *out = *in + if in.MaxContainerRestartPeriod != nil { + in, out := &in.MaxContainerRestartPeriod, &out.MaxContainerRestartPeriod + *out = new(v1.Duration) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrashLoopBackOffConfig. +func (in *CrashLoopBackOffConfig) DeepCopy() *CrashLoopBackOffConfig { + if in == nil { + return nil + } + out := new(CrashLoopBackOffConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CredentialProvider) DeepCopyInto(out *CredentialProvider) { *out = *in @@ -441,6 +462,7 @@ func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) { *out = make([]ShutdownGracePeriodByPodPriority, len(*in)) copy(*out, *in) } + in.CrashLoopBackOff.DeepCopyInto(&out.CrashLoopBackOff) if in.ReservedMemory != nil { in, out := &in.ReservedMemory, &out.ReservedMemory *out = make([]MemoryReservation, len(*in))