From bb0a9a74abd7ef118246b2962ad0cac96ca31417 Mon Sep 17 00:00:00 2001 From: Arko Dasgupta Date: Tue, 12 Mar 2024 16:42:52 -0700 Subject: [PATCH] shutdown drainTimeout should also affect envoy drain time (#2898) Signed-off-by: Arko Dasgupta --- internal/infrastructure/kubernetes/proxy/resource.go | 4 ++++ .../proxy/testdata/deployments/shutdown-manager.yaml | 1 + 2 files changed, 5 insertions(+) diff --git a/internal/infrastructure/kubernetes/proxy/resource.go b/internal/infrastructure/kubernetes/proxy/resource.go index 2dcda4eba24..c0cc459da95 100644 --- a/internal/infrastructure/kubernetes/proxy/resource.go +++ b/internal/infrastructure/kubernetes/proxy/resource.go @@ -177,6 +177,10 @@ func expectedProxyContainers(infra *ir.ProxyInfra, args = append(args, fmt.Sprintf("--component-log-level %s", componentsLogLevel)) } + if shutdownConfig != nil && shutdownConfig.DrainTimeout != nil { + args = append(args, fmt.Sprintf("--drain-time-s %.0f", shutdownConfig.DrainTimeout.Seconds())) + } + if infra.Config != nil { args = append(args, infra.Config.Spec.ExtraArgs...) } diff --git a/internal/infrastructure/kubernetes/proxy/testdata/deployments/shutdown-manager.yaml b/internal/infrastructure/kubernetes/proxy/testdata/deployments/shutdown-manager.yaml index 274f6824ada..94db8632dbb 100644 --- a/internal/infrastructure/kubernetes/proxy/testdata/deployments/shutdown-manager.yaml +++ b/internal/infrastructure/kubernetes/proxy/testdata/deployments/shutdown-manager.yaml @@ -167,6 +167,7 @@ spec: resource_api_version: V3 - --log-level warn - --cpuset-threads + - --drain-time-s 30 command: - envoy env: