Skip to content

Commit

Permalink
deprecate descheduler custom flag of http-enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Alavi <[email protected]>
  • Loading branch information
a7i committed Aug 28, 2024
1 parent 4e4c5f7 commit 5abe141
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/descheduler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func NewDeschedulerServer() (*DeschedulerServer, error) {

secureServing := apiserveroptions.NewSecureServingOptions().WithLoopback()
secureServing.BindPort = DefaultDeschedulerPort
secureServing.DisableHTTP2Serving = true

return &DeschedulerServer{
DeschedulerConfiguration: *cfg,
Expand Down Expand Up @@ -101,7 +102,7 @@ func (rs *DeschedulerServer) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&rs.Tracing.ServiceNamespace, "otel-trace-namespace", "", "OTEL Trace namespace to be used with the resources")
fs.Float64Var(&rs.Tracing.SampleRate, "otel-sample-rate", 1.0, "Sample rate to collect the Traces")
fs.BoolVar(&rs.Tracing.FallbackToNoOpProviderOnError, "otel-fallback-no-op-on-error", false, "Fallback to NoOp Tracer in case of error")
fs.BoolVar(&rs.EnableHTTP2, "enable-http2", false, "If http/2 should be enabled for the metrics and health check")
fs.BoolVar(&rs.EnableHTTP2, "enable-http2", false, "Deprecated: use disable-http2-serving instead. If http/2 should be enabled for the metrics and health check")

componentbaseoptions.BindLeaderElectionFlags(&rs.LeaderElection, fs)

Expand Down
4 changes: 3 additions & 1 deletion cmd/descheduler/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command {
return err
}

secureServing.DisableHTTP2 = !s.EnableHTTP2
if cmd.Flag("enable-http2").Changed {
secureServing.DisableHTTP2 = !s.EnableHTTP2
}

ctx, done := signal.NotifyContext(cmd.Context(), syscall.SIGINT, syscall.SIGTERM)

Expand Down
4 changes: 2 additions & 2 deletions docs/cli/descheduler.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ descheduler [flags]
--client-connection-kubeconfig string File path to kube configuration for interacting with kubernetes apiserver.
--client-connection-qps float32 QPS to use for interacting with kubernetes apiserver.
--descheduling-interval duration Time interval between two consecutive descheduler executions. Setting this value instructs the descheduler to run in a continuous loop at the interval specified.
--disable-http2-serving If true, HTTP2 serving will be disabled [default=false]
--disable-http2-serving If true, HTTP2 serving will be disabled [default=false] (default true)
--disable-metrics Disables metrics. The metrics are by default served through https://localhost:10258/metrics. Secure address, resp. port can be changed through --bind-address, resp. --secure-port flags.
--dry-run Execute descheduler in dry run mode.
--enable-http2 If http/2 should be enabled for the metrics and health check
--enable-http2 Deprecated: use disable-http2-serving instead. If http/2 should be enabled for the metrics and health check
-h, --help help for descheduler
--http2-max-streams-per-connection int The limit that the server gives to clients for the maximum number of streams in an HTTP/2 connection. Zero means to use golang's default.
--kubeconfig string File with kube configuration. Deprecated, use client-connection-kubeconfig instead.
Expand Down

0 comments on commit 5abe141

Please sign in to comment.