Skip to content

Commit

Permalink
cmd+hack+operator+pkg: unify addons constants
Browse files Browse the repository at this point in the history
In this commit we unify the usage of addon names i.e
`karmada-descheduler`, `karmada-scheduler-estimator`, `karmada-search`,
and `karmada-metrics-adapter` across the codebase.

Signed-off-by: Mohamed Awnallah <mohamedmohey2352@gmail.com>
  • Loading branch information
mohamedawnallah committed Dec 4, 2024
1 parent 616a95e commit 8c973ad
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 32 deletions.
5 changes: 3 additions & 2 deletions cmd/descheduler/app/descheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/karmada-io/karmada/cmd/descheduler/app/options"
"github.com/karmada-io/karmada/pkg/descheduler"
karmadaclientset "github.com/karmada-io/karmada/pkg/generated/clientset/versioned"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/sharedcli"
"github.com/karmada-io/karmada/pkg/sharedcli/klogflag"
"github.com/karmada-io/karmada/pkg/sharedcli/profileflag"
Expand Down Expand Up @@ -80,7 +81,7 @@ func NewDeschedulerCommand(stopChan <-chan struct{}) *cobra.Command {
opts := options.NewOptions()

cmd := &cobra.Command{
Use: "karmada-descheduler",
Use: addonsinit.DeschedulerResourceName,
Long: `The karmada-descheduler evicts replicas from member clusters
if they are failed to be scheduled for a period of time. It relies on
karmada-scheduler-estimator to get replica status.`,
Expand Down Expand Up @@ -113,7 +114,7 @@ karmada-scheduler-estimator to get replica status.`,
logsFlagSet := fss.FlagSet("logs")
klogflag.Add(logsFlagSet)

cmd.AddCommand(sharedcommand.NewCmdVersion("karmada-descheduler"))
cmd.AddCommand(sharedcommand.NewCmdVersion(addonsinit.DeschedulerResourceName))
cmd.Flags().AddFlagSet(genericFlagSet)
cmd.Flags().AddFlagSet(logsFlagSet)

Expand Down
3 changes: 2 additions & 1 deletion cmd/descheduler/app/descheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ import (
"github.com/stretchr/testify/require"

"github.com/karmada-io/karmada/cmd/descheduler/app/options"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
)

func TestNewDeschedulerCommand(t *testing.T) {
stopCh := make(chan struct{})
cmd := NewDeschedulerCommand(stopCh)

assert.NotNil(t, cmd)
assert.Equal(t, "karmada-descheduler", cmd.Use)
assert.Equal(t, addonsinit.DeschedulerResourceName, cmd.Use)
assert.NotEmpty(t, cmd.Long)
}

Expand Down
5 changes: 3 additions & 2 deletions cmd/descheduler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"
componentbaseconfig "k8s.io/component-base/config"

addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/sharedcli/profileflag"
"github.com/karmada-io/karmada/pkg/util"
)
Expand Down Expand Up @@ -90,7 +91,7 @@ func NewOptions() *Options {
LeaderElect: true,
ResourceLock: resourcelock.LeasesResourceLock,
ResourceNamespace: util.NamespaceKarmadaSystem,
ResourceName: "karmada-descheduler",
ResourceName: addonsinit.DeschedulerResourceName,
LeaseDuration: defaultElectionLeaseDuration,
RenewDeadline: defaultElectionRenewDeadline,
RetryPeriod: defaultElectionRetryPeriod,
Expand Down Expand Up @@ -129,7 +130,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&o.SchedulerEstimatorCaFile, "scheduler-estimator-ca-file", "", "SSL Certificate Authority file used to secure scheduler estimator communication.")
fs.BoolVar(&o.InsecureSkipEstimatorVerify, "insecure-skip-estimator-verify", false, "Controls whether verifies the scheduler estimator's certificate chain and host name.")
fs.StringVar(&o.SchedulerEstimatorServiceNamespace, "scheduler-estimator-service-namespace", util.NamespaceKarmadaSystem, "The namespace to be used for discovering scheduler estimator services.")
fs.StringVar(&o.SchedulerEstimatorServicePrefix, "scheduler-estimator-service-prefix", "karmada-scheduler-estimator", "The prefix of scheduler estimator service name")
fs.StringVar(&o.SchedulerEstimatorServicePrefix, "scheduler-estimator-service-prefix", addonsinit.EstimatorResourceName, "The prefix of scheduler estimator service name")
fs.DurationVar(&o.DeschedulingInterval.Duration, "descheduling-interval", defaultDeschedulingInterval, "Time interval between two consecutive descheduler executions. Setting this value instructs the descheduler to run in a continuous loop at the interval specified.")
fs.DurationVar(&o.UnschedulableThreshold.Duration, "unschedulable-threshold", defaultUnschedulableThreshold, "The period of pod unschedulable condition. This value is considered as a classification standard of unschedulable replicas.")
fs.StringVar(&o.MetricsBindAddress, "metrics-bind-address", ":8080", "The TCP address that the server 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. Defaults to 0.0.0.0:8080.")
Expand Down
8 changes: 5 additions & 3 deletions cmd/karmada-search/app/karmada-search.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import (
"github.com/karmada-io/karmada/pkg/util/lifted"
"github.com/karmada-io/karmada/pkg/version"
"github.com/karmada-io/karmada/pkg/version/sharedcommand"

addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
)

// Option configures a framework.Registry.
Expand All @@ -63,7 +65,7 @@ func NewKarmadaSearchCommand(ctx context.Context, registryOptions ...Option) *co
opts := options.NewOptions()

cmd := &cobra.Command{
Use: "karmada-search",
Use: addonsinit.SearchResourceName,
Long: `The karmada-search starts an aggregated server. It provides
capabilities such as global search and resource proxy in a multi-cloud environment.`,
RunE: func(_ *cobra.Command, _ []string) error {
Expand All @@ -89,7 +91,7 @@ capabilities such as global search and resource proxy in a multi-cloud environme
logsFlagSet := fss.FlagSet("logs")
klogflag.Add(logsFlagSet)

cmd.AddCommand(sharedcommand.NewCmdVersion("karmada-search"))
cmd.AddCommand(sharedcommand.NewCmdVersion(addonsinit.SearchResourceName))
cmd.Flags().AddFlagSet(genericFlagSet)
cmd.Flags().AddFlagSet(logsFlagSet)

Expand Down Expand Up @@ -173,7 +175,7 @@ func config(o *options.Options, outOfTreeRegistryOptions ...Option) (*search.Con
sets.NewString("attach", "exec", "proxy", "log", "portforward"))
serverConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(searchscheme.Scheme))
serverConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(generatedopenapi.GetOpenAPIDefinitions, openapi.NewDefinitionNamer(searchscheme.Scheme))
serverConfig.OpenAPIConfig.Info.Title = "karmada-search"
serverConfig.OpenAPIConfig.Info.Title = addonsinit.SearchResourceName
if err := o.ApplyTo(serverConfig); err != nil {
return nil, err
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/metrics-adapter/app/metrics-adapter.go
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"k8s.io/component-base/term"

"github.com/karmada-io/karmada/cmd/metrics-adapter/app/options"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/sharedcli"
"github.com/karmada-io/karmada/pkg/sharedcli/klogflag"
"github.com/karmada-io/karmada/pkg/version/sharedcommand"
Expand All @@ -35,7 +36,7 @@ func NewMetricsAdapterCommand(ctx context.Context) *cobra.Command {
opts := options.NewOptions()

cmd := &cobra.Command{
Use: "karmada-metrics-adapter",
Use: addonsinit.MetricsAdapterResourceName,
Long: `The karmada-metrics-adapter is a adapter to aggregate the metrics from member clusters.`,
RunE: func(_ *cobra.Command, _ []string) error {
if err := opts.Complete(); err != nil {
Expand Down Expand Up @@ -68,7 +69,7 @@ func NewMetricsAdapterCommand(ctx context.Context) *cobra.Command {
logsFlagSet := fss.FlagSet("logs")
klogflag.Add(logsFlagSet)

cmd.AddCommand(sharedcommand.NewCmdVersion("karmada-metrics-adapter"))
cmd.AddCommand(sharedcommand.NewCmdVersion(addonsinit.MetricsAdapterResourceName))
cmd.Flags().AddFlagSet(genericFlagSet)
cmd.Flags().AddFlagSet(logsFlagSet)

Expand Down
3 changes: 2 additions & 1 deletion cmd/metrics-adapter/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
karmadaclientset "github.com/karmada-io/karmada/pkg/generated/clientset/versioned"
informerfactory "github.com/karmada-io/karmada/pkg/generated/informers/externalversions"
generatedopenapi "github.com/karmada-io/karmada/pkg/generated/openapi"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/metricsadapter"
"github.com/karmada-io/karmada/pkg/sharedcli/profileflag"
"github.com/karmada-io/karmada/pkg/util"
Expand Down Expand Up @@ -96,7 +97,7 @@ func (o *Options) Config(stopCh <-chan struct{}) (*metricsadapter.MetricsServer,
metricsAdapter := metricsadapter.NewMetricsAdapter(metricsController, o.CustomMetricsAdapterServerOptions)
metricsAdapter.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
metricsAdapter.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(generatedopenapi.GetOpenAPIDefinitions, openapinamer.NewDefinitionNamer(api.Scheme))
metricsAdapter.OpenAPIConfig.Info.Title = "karmada-metrics-adapter"
metricsAdapter.OpenAPIConfig.Info.Title = addonsinit.MetricsAdapterResourceName
metricsAdapter.OpenAPIConfig.Info.Version = "1.0.0"

// Explicitly specify the remote kubeconfig file here to solve the issue that metrics adapter requires to build
Expand Down
5 changes: 3 additions & 2 deletions cmd/scheduler-estimator/app/scheduler-estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (

"github.com/karmada-io/karmada/cmd/scheduler-estimator/app/options"
"github.com/karmada-io/karmada/pkg/estimator/server"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/sharedcli"
"github.com/karmada-io/karmada/pkg/sharedcli/klogflag"
"github.com/karmada-io/karmada/pkg/sharedcli/profileflag"
Expand Down Expand Up @@ -77,7 +78,7 @@ func NewSchedulerEstimatorCommand(ctx context.Context) *cobra.Command {
opts := options.NewOptions()

cmd := &cobra.Command{
Use: "karmada-scheduler-estimator",
Use: addonsinit.EstimatorResourceName,
Long: `The karmada-scheduler-estimator runs an accurate scheduler estimator of a cluster. It
provides the scheduler with more accurate cluster resource information.`,
RunE: func(_ *cobra.Command, _ []string) error {
Expand All @@ -101,7 +102,7 @@ provides the scheduler with more accurate cluster resource information.`,
logsFlagSet := fss.FlagSet("logs")
klogflag.Add(logsFlagSet)

cmd.AddCommand(sharedcommand.NewCmdVersion("karmada-scheduler-estimator"))
cmd.AddCommand(sharedcommand.NewCmdVersion(addonsinit.EstimatorResourceName))
cmd.Flags().AddFlagSet(genericFlagSet)
cmd.Flags().AddFlagSet(logsFlagSet)

Expand Down
3 changes: 2 additions & 1 deletion cmd/scheduler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
componentbaseconfig "k8s.io/component-base/config"

"github.com/karmada-io/karmada/pkg/features"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/scheduler"
frameworkplugins "github.com/karmada-io/karmada/pkg/scheduler/framework/plugins"
"github.com/karmada-io/karmada/pkg/sharedcli/profileflag"
Expand Down Expand Up @@ -153,7 +154,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
fs.BoolVar(&o.DisableSchedulerEstimatorInPullMode, "disable-scheduler-estimator-in-pull-mode", false, "Disable the scheduler estimator for clusters in pull mode, which takes effect only when enable-scheduler-estimator is true.")
fs.DurationVar(&o.SchedulerEstimatorTimeout.Duration, "scheduler-estimator-timeout", 3*time.Second, "Specifies the timeout period of calling the scheduler estimator service.")
fs.StringVar(&o.SchedulerEstimatorServiceNamespace, "scheduler-estimator-service-namespace", util.NamespaceKarmadaSystem, "The namespace to be used for discovering scheduler estimator services.")
fs.StringVar(&o.SchedulerEstimatorServicePrefix, "scheduler-estimator-service-prefix", "karmada-scheduler-estimator", "The prefix of scheduler estimator service name")
fs.StringVar(&o.SchedulerEstimatorServicePrefix, "scheduler-estimator-service-prefix", addonsinit.EstimatorResourceName, "The prefix of scheduler estimator service name")
fs.IntVar(&o.SchedulerEstimatorPort, "scheduler-estimator-port", defaultEstimatorPort, "The secure port on which to connect the accurate scheduler estimator.")
fs.StringVar(&o.SchedulerEstimatorCertFile, "scheduler-estimator-cert-file", "", "SSL certification file used to secure scheduler estimator communication.")
fs.StringVar(&o.SchedulerEstimatorKeyFile, "scheduler-estimator-key-file", "", "SSL key file used to secure scheduler estimator communication.")
Expand Down
9 changes: 5 additions & 4 deletions hack/tools/gencomponentdocs/gen_component_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
estiapp "github.com/karmada-io/karmada/cmd/scheduler-estimator/app"
schapp "github.com/karmada-io/karmada/cmd/scheduler/app"
webhookapp "github.com/karmada-io/karmada/cmd/webhook/app"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/util/lifted"
)

Expand Down Expand Up @@ -69,19 +70,19 @@ func main() {
case "karmada-aggregated-apiserver":
// generate docs for karmada-aggregated-apiserver
cmd = aaapp.NewAggregatedApiserverCommand(context.TODO())
case "karmada-descheduler":
case addonsinit.DeschedulerResourceName:
// generate docs for karmada-descheduler
cmd = deschapp.NewDeschedulerCommand(nil)
case "karmada-search":
case addonsinit.SearchResourceName:
// generate docs for karmada-search
cmd = searchapp.NewKarmadaSearchCommand(context.TODO())
case "karmada-scheduler-estimator":
case addonsinit.EstimatorResourceName:
// generate docs for karmada-scheduler-estimator
cmd = estiapp.NewSchedulerEstimatorCommand(context.TODO())
case "karmada-webhook":
// generate docs for karmada-webhook
cmd = webhookapp.NewWebhookCommand(context.TODO())
case "karmada-metrics-adapter":
case addonsinit.MetricsAdapterResourceName:
// generate docs for karmada-metrics-adapter
cmd = adapterapp.NewMetricsAdapterCommand(context.TODO())
default:
Expand Down
8 changes: 5 additions & 3 deletions operator/pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import (

"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"

addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
)

const (
Expand Down Expand Up @@ -56,11 +58,11 @@ const (
// KarmadaWebhook defines the name of the karmada-webhook component
KarmadaWebhook = "karmada-webhook"
// KarmadaSearch defines the name of the karmada-search component
KarmadaSearch = "karmada-search"
KarmadaSearch = addonsinit.SearchResourceName
// KarmadaDescheduler defines the name of the karmada-descheduler component
KarmadaDescheduler = "karmada-descheduler"
KarmadaDescheduler = addonsinit.DeschedulerResourceName
// KarmadaMetricsAdapter defines the name of the karmada-metrics-adapter component
KarmadaMetricsAdapter = "karmada-metrics-adapter"
KarmadaMetricsAdapter = addonsinit.MetricsAdapterResourceName

// KarmadaSystemNamespace defines the leader selection namespace for karmada components
KarmadaSystemNamespace = "karmada-system"
Expand Down
3 changes: 2 additions & 1 deletion pkg/descheduler/descheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
informerfactory "github.com/karmada-io/karmada/pkg/generated/informers/externalversions"
clusterlister "github.com/karmada-io/karmada/pkg/generated/listers/cluster/v1alpha1"
worklister "github.com/karmada-io/karmada/pkg/generated/listers/work/v1alpha2"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/util"
"github.com/karmada-io/karmada/pkg/util/fedinformer"
"github.com/karmada-io/karmada/pkg/util/gclient"
Expand Down Expand Up @@ -131,7 +132,7 @@ func NewDescheduler(karmadaClient karmadaclientset.Interface, kubeClient kuberne
eventBroadcaster := record.NewBroadcaster()
eventBroadcaster.StartStructuredLogging(0)
eventBroadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: kubeClient.CoreV1().Events(metav1.NamespaceAll)})
desched.eventRecorder = eventBroadcaster.NewRecorder(gclient.NewSchema(), corev1.EventSource{Component: "karmada-descheduler"})
desched.eventRecorder = eventBroadcaster.NewRecorder(gclient.NewSchema(), corev1.EventSource{Component: addonsinit.DeschedulerResourceName})

return desched
}
Expand Down
8 changes: 4 additions & 4 deletions pkg/karmadactl/addons/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (

// Install install the karmada addons process in Addons
func Install() {
addonsinit.Addons["karmada-descheduler"] = descheduler.AddonDescheduler
addonsinit.Addons["karmada-metrics-adapter"] = metricsadapter.AddonMetricsAdapter
addonsinit.Addons["karmada-scheduler-estimator"] = estimator.AddonEstimator
addonsinit.Addons["karmada-search"] = search.AddonSearch
addonsinit.Addons[addonsinit.DeschedulerResourceName] = descheduler.AddonDescheduler
addonsinit.Addons[addonsinit.MetricsAdapterResourceName] = metricsadapter.AddonMetricsAdapter
addonsinit.Addons[addonsinit.EstimatorResourceName] = estimator.AddonEstimator
addonsinit.Addons[addonsinit.SearchResourceName] = search.AddonSearch
}
8 changes: 4 additions & 4 deletions pkg/karmadactl/addons/install/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ func TestInstall(t *testing.T) {
}{
{
name: "Install_WithKarmadaDeschedulerAddon_Installed",
key: "karmada-descheduler",
key: addonsinit.DeschedulerResourceName,
expectedAddon: descheduler.AddonDescheduler,
},
{
name: "Install_WithKarmadaMetricsAdapterAddon_Installed",
key: "karmada-metrics-adapter",
key: addonsinit.MetricsAdapterResourceName,
expectedAddon: metricsadapter.AddonMetricsAdapter,
},
{
name: "Install_WithKarmadaSchedulerEstimatorAddon_Installed",
key: "karmada-scheduler-estimator",
key: addonsinit.EstimatorResourceName,
expectedAddon: estimator.AddonEstimator,
},
{
name: "Install_WithKarmadaSearchAddon_Installed",
key: "karmada-search",
key: addonsinit.SearchResourceName,
expectedAddon: search.AddonSearch,
},
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/search/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
searchapis "github.com/karmada-io/karmada/pkg/apis/search"
searchscheme "github.com/karmada-io/karmada/pkg/apis/search/scheme"
informerfactory "github.com/karmada-io/karmada/pkg/generated/informers/externalversions"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
searchstorage "github.com/karmada-io/karmada/pkg/registry/search/storage"
"github.com/karmada-io/karmada/pkg/search/proxy"
)
Expand Down Expand Up @@ -79,7 +80,7 @@ var apiGroupInstaller = func(server *APIServer, apiGroupInfo *genericapiserver.A
}

func (c completedConfig) New() (*APIServer, error) {
genericServer, err := c.GenericConfig.New("karmada-search", genericapiserver.NewEmptyDelegate())
genericServer, err := c.GenericConfig.New(addonsinit.SearchResourceName, genericapiserver.NewEmptyDelegate())
if err != nil {
return nil, err
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/search/proxy/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
informerfactory "github.com/karmada-io/karmada/pkg/generated/informers/externalversions"
clusterlisters "github.com/karmada-io/karmada/pkg/generated/listers/cluster/v1alpha1"
searchlisters "github.com/karmada-io/karmada/pkg/generated/listers/search/v1alpha1"
addonsinit "github.com/karmada-io/karmada/pkg/karmadactl/addons/init"
"github.com/karmada-io/karmada/pkg/search/proxy/framework"
"github.com/karmada-io/karmada/pkg/search/proxy/framework/plugins"
pluginruntime "github.com/karmada-io/karmada/pkg/search/proxy/framework/runtime"
Expand Down Expand Up @@ -299,7 +300,7 @@ func (ctl *Controller) Connect(ctx context.Context, proxyPath string, responder
}

h = metrics.InstrumentHandlerFunc(requestInfo.Verb, requestInfo.APIGroup, requestInfo.APIVersion, requestInfo.Resource, requestInfo.Subresource,
"", "karmada-search", false, "", h.ServeHTTP)
"", addonsinit.SearchResourceName, false, "", h.ServeHTTP)
h.ServeHTTP(rw, newReq)
}), nil
}
Expand Down

0 comments on commit 8c973ad

Please sign in to comment.