// NewKubeControllerCommand returns the Kubernetes controller command.
NewKubeControllerCommand returns the Kubernetes controller command.
// NewKubeControllerCommand returns the Kubernetes controller command .
func NewKubeControllerCommand(app *kingpin.Application) Command {
	c := &kubeControllerCommand{extraLabels: map[string]string{}}
	cmd := app.Command("kubernetes-controller", "Runs Sloth in Kubernetes controller/operator mode.")
	cmd.Alias("controller")
	cmd.Alias("k8s-controller")
	cmd.Flag("kube-local", "Enable local Kubernetes credentials load.").BoolVar(&c.kubeLocal)
	cmd.Flag("mode", "Selects controller run mode.").Default(controllerModeDefault).EnumVar(&c.runMode, controllerModes...)
	kubeHome := filepath.Join(homedir.HomeDir(), ".kube", "config")
	cmd.Flag("kube-config", "kubernetes configuration path, only used when development mode enabled.").Default(kubeHome).StringVar(&c.kubeConfig)
	cmd.Flag("kube-context", "kubernetes context, only used when development mode enabled.").StringVar(&c.kubeContext)
	cmd.Flag("workers", "Concurrent processing workers for each kubernetes controller.").Default("5").IntVar(&c.workers)
	cmd.Flag("resync-interval", "The duration between all resources resync.").Default("15m").DurationVar(&c.resyncInterval)
	cmd.Flag("namespace", "Run the controller targeting specific namespace, by default all.").StringVar(&c.namespace)
	cmd.Flag("label-selector", "Kubernetes label selector that will make the controller filter resources by this selector.").StringVar(&c.labelSelector)
	cmd.Flag("metrics-path", "The path for Prometheus metrics.").Default("/metrics").StringVar(&c.metricsPath)
	cmd.Flag("metrics-listen-addr", "The listen address for Prometheus metrics and pprof.").Default(":8081").StringVar(&c.metricsListenAddr)
	cmd.Flag("hot-reload-addr", "The listen address for hot-reloading components that allow it.").Default(":8082").StringVar(&c.hotReloadAddr)
	cmd.Flag("hot-reload-path", "The webhook path for hot-reloading components that allow it.").Default("/-/reload").StringVar(&c.hotReloadPath)
	cmd.Flag("extra-labels", "Extra labels that will be added to all the generated Prometheus rules ('key=value' form, can be repeated).").Short('l').StringMapVar(&c.extraLabels)
	cmd.Flag("sli-plugins-path", "The path to SLI plugins (can be repeated), if not set it disable plugins support.").Short('p').StringsVar(&c.sliPluginsPaths)
	return c
}
func NewKubeControllerCommand ( app * kingpin . Application ) Command { c := & kubeControllerCommand { extraLabels : map [ string ] string { } } cmd := app . Command ( " " , " " ) cmd . Alias ( " " ) cmd . Alias ( " " ) cmd . Flag ( " " , " " ) . BoolVar ( & c . kubeLocal ) cmd . Flag ( " " , " " ) . Default ( controllerModeDefault ) . EnumVar ( & c . runMode , controllerModes ... ) kubeHome := filepath . Join ( homedir . HomeDir ( ) , " " , " " ) cmd . Flag ( " " , " " ) . Default ( kubeHome ) . StringVar ( & c . kubeConfig ) cmd . Flag ( " " , " " ) . StringVar ( & c . kubeContext ) cmd . Flag ( " " , " " ) . Default ( " " ) . IntVar ( & c . workers ) cmd . Flag ( " " , " " ) . Default ( " " ) . DurationVar ( & c . resyncInterval ) cmd . Flag ( " " , " " ) . StringVar ( & c . namespace ) cmd . Flag ( " " , " " ) . StringVar ( & c . labelSelector ) cmd . Flag ( " " , " " ) . Default ( " " ) . StringVar ( & c . metricsPath ) cmd . Flag ( " " , " " ) . Default ( " " ) . StringVar ( & c . metricsListenAddr ) cmd . Flag ( " " , " " ) . Default ( " " ) . StringVar ( & c . hotReloadAddr ) cmd . Flag ( " " , " " ) . Default ( " " ) . StringVar ( & c . hotReloadPath ) cmd . Flag ( " " , " " ) . Short ( 'l' ) . StringMapVar ( & c . extraLabels ) cmd . Flag ( " " , " " ) . Short ( 'p' ) . StringsVar ( & c . sliPluginsPaths ) return c }
NewKubeControllerCommand returns the Kubernetes controller command.
NewKubeControllerCommand returns the Kubernetes controller command .