Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.4] Bug 1809667: The console should wait until it is out of rotation to shut down #387

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion pkg/console/subresource/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func DefaultDeployment(operatorConfig *operatorv1.Console, cm *corev1.ConfigMap,
// pod template, but it does check deployment annotations.
meta.Annotations = annotations
replicas := int32(ConsoleReplicas)
gracePeriod := int64(30)
gracePeriod := int64(40)
tolerationSeconds := int64(120)
volumeConfig := defaultVolumeConfig()
caBundle, caBundleExists := trustedCAConfigMap.Data["ca-bundle.crt"]
Expand Down Expand Up @@ -297,6 +297,17 @@ func consoleContainer(cr *operatorv1.Console, volConfigList []volumeConfig, prox
Protocol: corev1.ProtocolTCP,
ContainerPort: consolePort,
}},
// Delay shutdown for 25 seconds, which is the estimated time for:
// * endpoint propagation on delete to the router: 5s
// * router max reload wait: 5s
// * time for the longest connection to shut down: 15s
Lifecycle: &corev1.Lifecycle{
PreStop: &corev1.Handler{
Exec: &corev1.ExecAction{
Command: []string{"sleep", "25"},
},
},
},
VolumeMounts: volumeMounts,
ReadinessProbe: defaultProbe(),
LivenessProbe: livenessProbe(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/console/subresource/deployment/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestDefaultDeployment(t *testing.T) {
var (
replicaCount int32 = 2
labels = map[string]string{"app": api.OpenShiftConsoleName, "component": "ui"}
gracePeriod int64 = 30
gracePeriod int64 = 40
)
type args struct {
config *operatorsv1.Console
Expand Down