fix: Let RunnerDeployment scale RunnerReplicaSet to zero before terminating it

so that hopefully RunnerDeployment can gracefully termiante older RunnerReplicaSet on update.
This commit is contained in:
Yusuke Kuoka
2022-03-13 12:18:22 +00:00
parent 326d6a1fe8
commit c612e87d85
2 changed files with 29 additions and 2 deletions

View File

@@ -65,6 +65,10 @@ func (r *RunnerReplicaSetReconciler) Reconcile(ctx context.Context, req ctrl.Req
}
if !rs.ObjectMeta.DeletionTimestamp.IsZero() {
// RunnerReplicaSet cannot be gracefuly removed.
// That means any runner that is running a job can be prematurely terminated.
// To gracefully remove a RunnerReplicaSet, scale it down to zero first, observe RunnerReplicaSet's status replicas,
// and remove it only after the status replicas becomes zero.
return ctrl.Result{}, nil
}