pod autoremoval feature added
This commit is contained in:
@@ -63,6 +63,26 @@ type ImageUpdatePolicy struct {
|
||||
RestartAnnotation string `json:"restartAnnotation,omitempty"`
|
||||
}
|
||||
|
||||
// CrashLoopPolicy defines the policy for handling pods in CrashLoopBackOff.
|
||||
type CrashLoopPolicy struct {
|
||||
// Enabled toggles the CrashLoopBackOff handling feature.
|
||||
// +optional
|
||||
Enabled bool `json:"enabled,omitempty"`
|
||||
|
||||
// MonitoredDeployments is a list of Deployments (in "namespace/name" format)
|
||||
// whose pods should be monitored for CrashLoopBackOff.
|
||||
// +optional
|
||||
MonitoredDeployments []string `json:"monitoredDeployments,omitempty"`
|
||||
|
||||
// RestartThreshold is the number of container restarts after which
|
||||
// a pod in CrashLoopBackOff will be deleted to attempt rescheduling.
|
||||
// Minimum recommended value: 3 or 5.
|
||||
// +kubebuilder:validation:Minimum=1
|
||||
// +kubebuilder:default=5
|
||||
// +optional
|
||||
RestartThreshold int32 `json:"restartThreshold,omitempty"`
|
||||
}
|
||||
|
||||
// NodeTainterConfigSpec defines the desired state of NodeTainterConfig.
|
||||
type NodeTainterConfigSpec struct {
|
||||
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
|
||||
@@ -95,6 +115,9 @@ type NodeTainterConfigSpec struct {
|
||||
|
||||
// +optional
|
||||
ImageUpdatePolicy *ImageUpdatePolicy `json:"imageUpdatePolicy,omitempty"`
|
||||
|
||||
// +optional
|
||||
CrashLoopPolicy *CrashLoopPolicy `json:"crashLoopPolicy,omitempty"`
|
||||
}
|
||||
|
||||
// NodeTainterConfigStatus defines the observed state of NodeTainterConfig.
|
||||
|
@@ -25,6 +25,26 @@ import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CrashLoopPolicy) DeepCopyInto(out *CrashLoopPolicy) {
|
||||
*out = *in
|
||||
if in.MonitoredDeployments != nil {
|
||||
in, out := &in.MonitoredDeployments, &out.MonitoredDeployments
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrashLoopPolicy.
|
||||
func (in *CrashLoopPolicy) DeepCopy() *CrashLoopPolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CrashLoopPolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ImageUpdatePolicy) DeepCopyInto(out *ImageUpdatePolicy) {
|
||||
*out = *in
|
||||
@@ -144,6 +164,11 @@ func (in *NodeTainterConfigSpec) DeepCopyInto(out *NodeTainterConfigSpec) {
|
||||
*out = new(ImageUpdatePolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.CrashLoopPolicy != nil {
|
||||
in, out := &in.CrashLoopPolicy, &out.CrashLoopPolicy
|
||||
*out = new(CrashLoopPolicy)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeTainterConfigSpec.
|
||||
|
Reference in New Issue
Block a user