當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。