Skip to content

Commit

Permalink
add vmss health check after vmss restart
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepc2792 committed Jun 22, 2023
1 parent 7d79741 commit 8751292
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/deploy/predeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,14 @@ func (d *deployer) restartOldScalesets(ctx context.Context, resourceGroupName st

func (d *deployer) restartOldScaleset(ctx context.Context, vmssName string, resourceGroupName string) error {
var restartScript string
var waitForReadiness func(ctx context.Context, vmssName string) error
switch {
case strings.HasPrefix(vmssName, gatewayVMSSPrefix):
restartScript = gatewayRestartScript
waitForReadiness = d.gatewayWaitForReadiness
case strings.HasPrefix(vmssName, rpVMSSPrefix):
restartScript = rpRestartScript
waitForReadiness = d.rpWaitForReadiness
default:
return nil
}
Expand Down Expand Up @@ -537,5 +540,14 @@ func (d *deployer) restartOldScaleset(ctx context.Context, vmssName string, reso
return err
}
}

// wait for load balancer probe to change the health status
time.Sleep(30 * time.Second)
timeoutCtx, cancel := context.WithTimeout(ctx, time.Hour)
defer cancel()
err = waitForReadiness(timeoutCtx, vmssName)
if err != nil {
return err
}
return nil
}

0 comments on commit 8751292

Please sign in to comment.