Skip to content

Commit

Permalink
Revert "cmd: add CLI flags for proxy shutdown lifecycle management (#100
Browse files Browse the repository at this point in the history
)"

This reverts commit 3d37b9f.
  • Loading branch information
DanStough committed Jun 14, 2023
1 parent bd1da00 commit dda339a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 35 deletions.
3 changes: 0 additions & 3 deletions .changelog/100.txt

This file was deleted.

30 changes: 6 additions & 24 deletions cmd/consul-dataplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ var (

consulDNSBindAddr string
consulDNSPort int

shutdownDrainListenersEnabled bool
shutdownGracePeriodSeconds int
gracefulShutdownPath string
gracefulPort int
)

func init() {
Expand Down Expand Up @@ -144,15 +139,6 @@ func init() {

StringVar(&consulDNSBindAddr, "consul-dns-bind-addr", "127.0.0.1", "DP_CONSUL_DNS_BIND_ADDR", "The address that will be bound to the consul dns proxy.")
IntVar(&consulDNSPort, "consul-dns-bind-port", -1, "DP_CONSUL_DNS_BIND_PORT", "The port the consul dns proxy will listen on. By default -1 disables the dns proxy")

// Default is false because it will generally be configured appropriately by Helm
// configuration or pod annotation.
BoolVar(&shutdownDrainListenersEnabled, "shutdown-drain-listeners", false, "DP_SHUTDOWN_DRAIN_LISTENERS", "Wait for proxy listeners to drain before terminating the proxy container.")
// Default is 0 because it will generally be configured appropriately by Helm
// configuration or pod annotation.
IntVar(&shutdownGracePeriodSeconds, "shutdown-grace-period-seconds", 0, "DP_SHUTDOWN_GRACE_PERIOD_SECONDS", "Amount of time to wait after receiving a SIGTERM signal before terminating the proxy.")
StringVar(&gracefulShutdownPath, "graceful-shutdown-path", "/graceful_shutdown", "DP_GRACEFUL_SHUTDOWN_PATH", "An HTTP path to serve the graceful shutdown endpoint.")
IntVar(&gracefulPort, "graceful-port", 20300, "DP_GRACEFUL_PORT", "A port to serve HTTP endpoints for graceful shutdown.")
}

// validateFlags performs semantic validation of the flag values
Expand Down Expand Up @@ -230,16 +216,12 @@ func main() {
},
},
Envoy: &consuldp.EnvoyConfig{
AdminBindAddress: adminBindAddr,
AdminBindPort: adminBindPort,
ReadyBindAddress: readyBindAddr,
ReadyBindPort: readyBindPort,
EnvoyConcurrency: envoyConcurrency,
ShutdownDrainListenersEnabled: shutdownDrainListenersEnabled,
ShutdownGracePeriodSeconds: shutdownGracePeriodSeconds,
GracefulShutdownPath: gracefulShutdownPath,
GracefulPort: gracefulPort,
ExtraArgs: flag.Args(),
AdminBindAddress: adminBindAddr,
AdminBindPort: adminBindPort,
ReadyBindAddress: readyBindAddr,
ReadyBindPort: readyBindPort,
EnvoyConcurrency: envoyConcurrency,
ExtraArgs: flag.Args(),
},
XDSServer: &consuldp.XDSServer{
BindAddress: xdsBindAddr,
Expand Down
8 changes: 0 additions & 8 deletions pkg/consuldp/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,6 @@ type EnvoyConfig struct {
ReadyBindPort int
// EnvoyConcurrency is the envoy concurrency https://www.envoyproxy.io/docs/envoy/latest/operations/cli#cmdoption-concurrency
EnvoyConcurrency int
// ShutdownDrainListenersEnabled configures whether to wait for all proxy listeners to drain before terminating the proxy container.
ShutdownDrainListenersEnabled bool
// ShutdownGracePeriodSeconds is the amount of time to wait after receiving a SIGTERM before terminating the proxy container.
ShutdownGracePeriodSeconds 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
}
Expand Down

0 comments on commit dda339a

Please sign in to comment.