From 25d08cd97c97e74ea0baba1b7a47f4eab324b41e Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Sun, 1 Mar 2020 22:03:55 -0500 Subject: [PATCH] Router should deploy with a very long grace period In order to allow routers to be tuned to shutdown when a variable length of connections have completed, the grace period needs to be set fairly high. For now, set it to 1 hour until we determine what tunable limits we should allow. In general few transactions will take 1 hour to complete. --- pkg/operator/controller/ingress/deployment.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/operator/controller/ingress/deployment.go b/pkg/operator/controller/ingress/deployment.go index 26f76cb5a..33185ce5b 100644 --- a/pkg/operator/controller/ingress/deployment.go +++ b/pkg/operator/controller/ingress/deployment.go @@ -87,6 +87,10 @@ func desiredRouterDeployment(ci *operatorv1.IngressController, ingressController deployment.Spec.Selector = controller.IngressControllerDeploymentPodSelector(ci) deployment.Spec.Template.Labels = controller.IngressControllerDeploymentPodSelector(ci).MatchLabels + // the router should have a very long grace period by default (1h) + gracePeriod := int64(60 * 60) + deployment.Spec.Template.Spec.TerminationGracePeriodSeconds = &gracePeriod + volumes := deployment.Spec.Template.Spec.Volumes routerVolumeMounts := deployment.Spec.Template.Spec.Containers[0].VolumeMounts