diff --git a/cmd/consul-dataplane/main.go b/cmd/consul-dataplane/main.go index 1d2c8a7f..63ed9247 100644 --- a/cmd/consul-dataplane/main.go +++ b/cmd/consul-dataplane/main.go @@ -148,9 +148,6 @@ func init() { // Default is false because it will generally be configured appropriately by Helm // configuration or pod annotation. BoolVar(&shutdownDrainListeners, "shutdown-drain-listeners", false, "DP_SHUTDOWN_DRAIN_LISTENERS", "Wait for proxy listeners to drain before terminating the proxy container.") - // TODO: Should the grace period be implemented as a minimum or maximum? If all - // connections have drained from the proxy before the end of the grace period, - // should it terminate earlier? // Default is 0 because it will generally be configured appropriately by Helm // configuration or pod annotation. IntVar(&shutdownGracePeriod, "shutdown-grace-period", 0, "DP_SHUTDOWN_GRACE_PERIOD", "Amount of time to wait after receiving a SIGTERM signal before terminating the proxy.") @@ -233,12 +230,16 @@ func main() { }, }, Envoy: &consuldp.EnvoyConfig{ - AdminBindAddress: adminBindAddr, - AdminBindPort: adminBindPort, - ReadyBindAddress: readyBindAddr, - ReadyBindPort: readyBindPort, - EnvoyConcurrency: envoyConcurrency, - ExtraArgs: flag.Args(), + AdminBindAddress: adminBindAddr, + AdminBindPort: adminBindPort, + ReadyBindAddress: readyBindAddr, + ReadyBindPort: readyBindPort, + EnvoyConcurrency: envoyConcurrency, + ShutdownDrainListeners: shutdownDrainListeners, + ShutdownGracePeriod: shutdownGracePeriod, + GracefulShutdownPath: gracefulShutdownPath, + GracefulPort: gracefulPort, + ExtraArgs: flag.Args(), }, XDSServer: &consuldp.XDSServer{ BindAddress: xdsBindAddr, diff --git a/pkg/consuldp/config.go b/pkg/consuldp/config.go index 7d41d4fd..823b808c 100644 --- a/pkg/consuldp/config.go +++ b/pkg/consuldp/config.go @@ -274,6 +274,14 @@ type EnvoyConfig struct { ReadyBindPort int // EnvoyConcurrency is the envoy concurrency https://www.envoyproxy.io/docs/envoy/latest/operations/cli#cmdoption-concurrency EnvoyConcurrency int + // ShutdownDrainListeners configures whether to wait for all proxy listeners to drain before terminating the proxy container. + ShutdownDrainListeners bool + // ShutdownGracePeriod is the amount of time to wait after receiving a SIGTERM before terminating the proxy container. + ShutdownGracePeriod int + // GracefulShutdownPath is the path on which the HTTP endpoint to initiate a graceful shutdown of Envoy is served + GracefulShutdownPath string + // GracefulPort is the port on which the HTTP server for graceful shutdown endpoints will be available. + GracefulPort int // ExtraArgs are the extra arguments passed to envoy at startup of the proxy ExtraArgs []string }