k3s/pkg/daemons/executor/executor.go
Darren Shepherd 072396f774 Start kube-apiserver in the background
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.
2020-05-06 21:17:23 -07:00

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)
}