Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate descheduler custom flag of http-enabled #1503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't love this part :/ [default=false] (default true)

Copy link
Contributor

@ingvagabund ingvagabund Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, [default=false] is part of the usage string. The descheduler code could access the usage string and drop [default=false]. I.e. calling VisitAll and editing Flag.Usage field. Worth trying that.

--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
Loading