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

Make ETCD and Scheduler configurable

parent 7533dbb0
...@@ -71,6 +71,11 @@ type ServerConfig struct { ...@@ -71,6 +71,11 @@ type ServerConfig struct {
DataDir string DataDir string
LeaderElect bool LeaderElect bool
UseTokenCA bool UseTokenCA bool
ETCDEndpoints []string
ETCDKeyFile string
ETCDCertFile string
ETCDCAFile string
NoScheduler bool
tlsCert string tlsCert string
tlsKey string tlsKey string
...@@ -103,7 +108,9 @@ func Server(ctx context.Context, config *ServerConfig) error { ...@@ -103,7 +108,9 @@ func Server(ctx context.Context, config *ServerConfig) error {
config.Handler = handler config.Handler = handler
config.Authenticator = auth config.Authenticator = auth
if !config.NoScheduler {
scheduler(ctx, config) scheduler(ctx, config)
}
controllerManager(ctx, config) controllerManager(ctx, config)
return nil return nil
...@@ -143,6 +150,13 @@ func apiServer(ctx context.Context, config *ServerConfig) (authenticator.Request ...@@ -143,6 +150,13 @@ func apiServer(ctx context.Context, config *ServerConfig) (authenticator.Request
} }
s := options.NewServerRunOptions() 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.InsecureServing.BindPort = 0
s.AllowPrivileged = true s.AllowPrivileged = true
s.Authorization.Modes = []string{modes.ModeNode, modes.ModeRBAC} 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