You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(controller): add configurable restart timeout and exclude restarting pods from allocation
- Add restart-timeout flag to controller with default 90s for pod restart operations
- Pass restartTimeout value to restartTracker for managing pod lifecycle
- Modify restartTracker to use configurable restartTimeout instead of constant
- Exclude pods in restarting state from allocator’s available pod list
- Add unit test to verify allocator excludes restarting pods during scheduling
- Update e2e test to deploy controller with restart-timeout=10s for timeout testing
- Add setup and teardown steps in e2e test for namespace, CRDs, and controller deployment
- Reduce pod restart timeout wait in e2e test from 4 minutes to 1 minute for faster feedback
// to ensure that exec-entrypoint and run can make use of them.
@@ -78,6 +79,9 @@ func main() {
78
79
varkubeClientQPSfloat64
79
80
varkubeClientBurstint
80
81
82
+
// Restart timeout configuration
83
+
varrestartTimeout time.Duration
84
+
81
85
flag.StringVar(&metricsAddr, "metrics-bind-address", "0", "The address the metrics endpoint binds to. "+
82
86
"Use :8443 for HTTPS or :8080 for HTTP, or leave as 0 to disable the metrics service.")
83
87
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
@@ -105,6 +109,7 @@ func main() {
105
109
flag.BoolVar(&logCompress, "log-compress", true, "Compress determines if the rotated log files should be compressed using gzip")
106
110
flag.Float64Var(&kubeClientQPS, "kube-client-qps", 100, "QPS for Kubernetes client rate limiter.")
107
111
flag.IntVar(&kubeClientBurst, "kube-client-burst", 200, "Burst for Kubernetes client rate limiter.")
112
+
flag.DurationVar(&restartTimeout, "restart-timeout", 90*time.Second, "Timeout for Pod restart operations. If a Pod fails to restart within this duration, it will be deleted.")
0 commit comments