mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
072396f774
In rke2 everything is a static pod so this causes a chicken and egg situation in which we need the kubelet running before the kube-apiserver can be launched. By starting the apiserver in the background this allows us to do this odd bootstrapping.
45 lines
1010 B
Go
45 lines
1010 B
Go
package executor
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"k8s.io/apiserver/pkg/authentication/authenticator"
|
|
)
|
|
|
|
type Executor interface {
|
|
Kubelet(args []string) error
|
|
KubeProxy(args []string) error
|
|
APIServer(ctx context.Context, args []string) (authenticator.Request, http.Handler, error)
|
|
Scheduler(apiReady <-chan struct{}, args []string) error
|
|
ControllerManager(apiReady <-chan struct{}, args []string) error
|
|
}
|
|
|
|
var (
|
|
executor Executor
|
|
)
|
|
|
|
func Set(driver Executor) {
|
|
executor = driver
|
|
}
|
|
|
|
func Kubelet(args []string) error {
|
|
return executor.Kubelet(args)
|
|
}
|
|
|
|
func KubeProxy(args []string) error {
|
|
return executor.KubeProxy(args)
|
|
}
|
|
|
|
func APIServer(ctx context.Context, args []string) (authenticator.Request, http.Handler, error) {
|
|
return executor.APIServer(ctx, args)
|
|
}
|
|
|
|
func Scheduler(apiReady <-chan struct{}, args []string) error {
|
|
return executor.Scheduler(apiReady, args)
|
|
}
|
|
|
|
func ControllerManager(apiReady <-chan struct{}, args []string) error {
|
|
return executor.ControllerManager(apiReady, args)
|
|
}
|