mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
move pkg/controllermanager to cmd/kube-controller-manager/app
This commit is contained in:
parent
cb09571768
commit
0b17c0f225
@ -21,7 +21,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/controllermanager"
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
|
||||||
sched "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/server"
|
sched "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/scheduler/server"
|
||||||
)
|
)
|
||||||
@ -33,7 +32,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hk.AddServer(NewKubeAPIServer())
|
hk.AddServer(NewKubeAPIServer())
|
||||||
hk.AddServer(controllermanager.NewHyperkubeServer())
|
hk.AddServer(NewKubeControllerManager())
|
||||||
hk.AddServer(sched.NewHyperkubeServer())
|
hk.AddServer(sched.NewHyperkubeServer())
|
||||||
hk.AddServer(NewKubelet())
|
hk.AddServer(NewKubelet())
|
||||||
hk.AddServer(NewKubeProxy())
|
hk.AddServer(NewKubeProxy())
|
||||||
|
38
cmd/hyperkube/kube-controller-manager.go
Normal file
38
cmd/hyperkube/kube-controller-manager.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 Google Inc. All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
controllermgr "github.com/GoogleCloudPlatform/kubernetes/cmd/kube-controller-manager/app"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewKubeControllerManager creates a new hyperkube Server object that includes the
|
||||||
|
// description and flags.
|
||||||
|
func NewKubeControllerManager() *hyperkube.Server {
|
||||||
|
s := controllermgr.NewCMServer()
|
||||||
|
|
||||||
|
hks := hyperkube.Server{
|
||||||
|
SimpleUsage: "controller-manager",
|
||||||
|
Long: "A server that runs a set of active components. This includes replication controllers, service endpoints and nodes.",
|
||||||
|
Run: func(_ *hyperkube.Server, args []string) error {
|
||||||
|
return s.Run(args)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
s.AddFlags(hks.Flags())
|
||||||
|
return &hks
|
||||||
|
}
|
@ -14,10 +14,10 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Package controllermanager implements a server that runs a set of active
|
// Package app implements a server that runs a set of active
|
||||||
// components. This includes replication controllers, service endpoints and
|
// components. This includes replication controllers, service endpoints and
|
||||||
// nodes.
|
// nodes.
|
||||||
package controllermanager
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net"
|
"net"
|
||||||
@ -32,7 +32,6 @@ import (
|
|||||||
nodeControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/controller"
|
nodeControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider/controller"
|
||||||
replicationControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
|
replicationControllerPkg "github.com/GoogleCloudPlatform/kubernetes/pkg/controller"
|
||||||
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
|
_ "github.com/GoogleCloudPlatform/kubernetes/pkg/healthz"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/hyperkube"
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/resourcequota"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/resourcequota"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/service"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/service"
|
||||||
@ -84,22 +83,6 @@ func NewCMServer() *CMServer {
|
|||||||
return &s
|
return &s
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewHyperkubeServer creates a new hyperkube Server object that includes the
|
|
||||||
// description and flags.
|
|
||||||
func NewHyperkubeServer() *hyperkube.Server {
|
|
||||||
s := NewCMServer()
|
|
||||||
|
|
||||||
hks := hyperkube.Server{
|
|
||||||
SimpleUsage: "controller-manager",
|
|
||||||
Long: "A server that runs a set of active components. This includes replication controllers, service endpoints and nodes.",
|
|
||||||
Run: func(_ *hyperkube.Server, args []string) error {
|
|
||||||
return s.Run(args)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
s.AddFlags(hks.Flags())
|
|
||||||
return &hks
|
|
||||||
}
|
|
||||||
|
|
||||||
// AddFlags adds flags for a specific CMServer to the specified FlagSet
|
// AddFlags adds flags for a specific CMServer to the specified FlagSet
|
||||||
func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
|
func (s *CMServer) AddFlags(fs *pflag.FlagSet) {
|
||||||
fs.IntVar(&s.Port, "port", s.Port, "The port that the controller-manager's http service runs on")
|
fs.IntVar(&s.Port, "port", s.Port, "The port that the controller-manager's http service runs on")
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package controllermanager
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// This file exists to force the desired plugin implementations to be linked.
|
// This file exists to force the desired plugin implementations to be linked.
|
@ -25,7 +25,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/controllermanager"
|
"github.com/GoogleCloudPlatform/kubernetes/cmd/kube-controller-manager/app"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/version/verflag"
|
||||||
|
|
||||||
@ -34,7 +34,7 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
s := controllermanager.NewCMServer()
|
s := app.NewCMServer()
|
||||||
s.AddFlags(pflag.CommandLine)
|
s.AddFlags(pflag.CommandLine)
|
||||||
|
|
||||||
util.InitFlags()
|
util.InitFlags()
|
||||||
|
Loading…
Reference in New Issue
Block a user