Skip to content

Commit

Permalink
Add missing command line arguments for karmada-operator
Browse files Browse the repository at this point in the history
Signed-off-by: whitewindmills <[email protected]>
  • Loading branch information
whitewindmills committed Jul 11, 2024
1 parent 71de3dc commit 8c1ebe7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions operator/cmd/operator/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ import (
"k8s.io/component-base/config/options"
)

const (
defaultBindAddress = "0.0.0.0"
defaultPort = 8443
)

// Options is the main context object for the karmada-operator.
type Options struct {
// Controllers is the list of controllers to enable or disable
Expand Down Expand Up @@ -73,8 +78,6 @@ func NewOptions() *Options {
ResourceNamespace: "karmada-system",
ResourceName: "karmada-operator",
},
BindAddress: "0.0.0.0",
SecurePort: 8443,
KubeAPIQPS: 50,
KubeAPIBurst: 100,
ConcurrentKarmadaSyncs: 5,
Expand All @@ -84,6 +87,9 @@ func NewOptions() *Options {

// AddFlags adds flags to the specified FlagSet.
func (o *Options) AddFlags(fs *pflag.FlagSet, allControllers []string, disabledByDefaultControllers []string) {
fs.StringVar(&o.BindAddress, "bind-address", defaultBindAddress, "The IP address on which to listen for the --secure-port port.")
fs.IntVar(&o.SecurePort, "secure-port", defaultPort, "The port that the the health server serves at.")
fs.StringVar(&o.MetricsBindAddress, "metrics-bind-address", ":8080", "The TCP address that the controller should bind to for serving prometheus metrics(e.g. 127.0.0.1:8080, :8080). It can be set to \"0\" to disable the metrics serving.")
fs.DurationVar(&o.ResyncPeriod.Duration, "resync-period", o.ResyncPeriod.Duration, "ResyncPeriod determines the minimum frequency at which watched resources are reconciled.")
fs.Float32Var(&o.KubeAPIQPS, "kube-api-qps", o.KubeAPIQPS, "QPS to use while talking with kubernetes apiserver.")
fs.Int32Var(&o.KubeAPIBurst, "kube-api-burst", o.KubeAPIBurst, "Burst to use while talking with kubernetes apiserver.")
Expand Down

0 comments on commit 8c1ebe7

Please sign in to comment.