Commit 3ccde359 authored by Darren Shepherd's avatar Darren Shepherd

Make ETCD and Scheduler configurable

parent 7533dbb0
......@@ -71,6 +71,11 @@ type ServerConfig struct {
DataDir string
LeaderElect bool
UseTokenCA bool
ETCDEndpoints []string
ETCDKeyFile string
ETCDCertFile string
ETCDCAFile string
NoScheduler bool
tlsCert string
tlsKey string
......@@ -103,7 +108,9 @@ func Server(ctx context.Context, config *ServerConfig) error {
config.Handler = handler
config.Authenticator = auth
scheduler(ctx, config)
if !config.NoScheduler {
scheduler(ctx, config)
}
controllerManager(ctx, config)
return nil
......@@ -143,6 +150,13 @@ func apiServer(ctx context.Context, config *ServerConfig) (authenticator.Request
}
s := options.NewServerRunOptions()
s.Etcd.StorageConfig.ServerList = config.ETCDEndpoints
s.Etcd.StorageConfig.KeyFile = config.ETCDKeyFile
s.Etcd.StorageConfig.CertFile = config.ETCDCertFile
s.Etcd.StorageConfig.CAFile = config.ETCDCAFile
if len(config.ETCDEndpoints) > 0 {
s.Etcd.StorageConfig.Type = storagebackend.StorageTypeETCD3
}
s.InsecureServing.BindPort = 0
s.AllowPrivileged = true
s.Authorization.Modes = []string{modes.ModeNode, modes.ModeRBAC}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment