当前位置: 首页>>代码示例>>Golang>>正文


Golang options.NewCMServer函数代码示例

本文整理汇总了Golang中k8s/io/kubernetes/federation/cmd/federation-controller-manager/app/options.NewCMServer函数的典型用法代码示例。如果您正苦于以下问题:Golang NewCMServer函数的具体用法?Golang NewCMServer怎么用?Golang NewCMServer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NewCMServer函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: NewFederationCMServer

// NewFederationCMServer creates a new hyperkube Server object that includes the
// description and flags.
func NewFederationCMServer() *Server {
	s := options.NewCMServer()

	hks := Server{
		SimpleUsage: "federation-controller-manager",
		Long:        "Controller manager for federation control plane. Manages federation service endpoints and controllers",
		Run: func(_ *Server, args []string) error {
			return app.Run(s)
		},
	}
	s.AddFlags(hks.Flags())
	return &hks
}
开发者ID:CodeJuan,项目名称:kubernetes,代码行数:15,代码来源:federation-controller-manager.go

示例2: main

func main() {
	s := options.NewCMServer()
	s.AddFlags(pflag.CommandLine)

	flag.InitFlags()
	logs.InitLogs()
	defer logs.FlushLogs()

	verflag.PrintAndExitIfRequested()

	if err := app.Run(s); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}
开发者ID:AdoHe,项目名称:kubernetes,代码行数:15,代码来源:controller-manager.go

示例3: main

func main() {
	runtime.GOMAXPROCS(runtime.NumCPU())
	s := options.NewCMServer()
	s.AddFlags(pflag.CommandLine)

	flag.InitFlags()
	util.InitLogs()
	defer util.FlushLogs()

	verflag.PrintAndExitIfRequested()

	if err := app.Run(s); err != nil {
		fmt.Fprintf(os.Stderr, "%v\n", err)
		os.Exit(1)
	}
}
开发者ID:Rushit,项目名称:kubernetes,代码行数:16,代码来源:controller-manager.go

示例4: NewControllerManagerCommand

// NewControllerManagerCommand creates a *cobra.Command object with default parameters
func NewControllerManagerCommand() *cobra.Command {
	s := options.NewCMServer()
	s.AddFlags(pflag.CommandLine)
	cmd := &cobra.Command{
		Use: "federation-controller-manager",
		Long: `The federation controller manager is a daemon that embeds
the core control loops shipped with federation. In applications of robotics and
automation, a control loop is a non-terminating loop that regulates the state of
the system. In federation, a controller is a control loop that watches the shared
state of the federation cluster through the apiserver and makes changes attempting
to move the current state towards the desired state. Examples of controllers that
ship with federation today is the cluster controller.`,
		Run: func(cmd *cobra.Command, args []string) {
		},
	}

	return cmd
}
开发者ID:ravihansa3000,项目名称:kubernetes,代码行数:19,代码来源:controllermanager.go


注:本文中的k8s/io/kubernetes/federation/cmd/federation-controller-manager/app/options.NewCMServer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。