Enable all available APIs

pull/378/head
Jimmi Dyson 2016-07-21 15:39:37 +01:00
parent f6e39b1e8f
commit a2f789590b
No known key found for this signature in database
GPG Key ID: 978CD4AF4C1E87F5
3 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,7 @@ func NewLocalkubeServer() *localkube.LocalkubeServer {
APIServerInsecurePort: 8080, APIServerInsecurePort: 8080,
ShouldGenerateCerts: true, ShouldGenerateCerts: true,
ShowVersion: false, ShowVersion: false,
RuntimeConfig: map[string]string{"api/all": "true"},
} }
} }
@ -60,6 +61,7 @@ func AddFlags(s *localkube.LocalkubeServer) {
flag.IntVar(&s.APIServerInsecurePort, "apiserver-insecure-port", s.APIServerInsecurePort, "The port the apiserver will listen insecurely on") flag.IntVar(&s.APIServerInsecurePort, "apiserver-insecure-port", s.APIServerInsecurePort, "The port the apiserver will listen insecurely on")
flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates") flag.BoolVar(&s.ShouldGenerateCerts, "generate-certs", s.ShouldGenerateCerts, "If localkube should generate it's own certificates")
flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.") flag.BoolVar(&s.ShowVersion, "version", s.ShowVersion, "If localkube should just print the version and exit.")
flag.Var(&s.RuntimeConfig, "runtime-config", "A set of key=value pairs that describe runtime configuration that may be passed to apiserver. apis/<groupVersion> key can be used to turn on/off specific api versions. apis/<groupVersion>/<resource> can be used to turn on/off specific resources. api/all and api/legacy are special keys to control all and legacy api versions respectively.")
// These two come from vendor/ packages that use flags. We should hide them // These two come from vendor/ packages that use flags. We should hide them
flag.CommandLine.MarkHidden("google-json-key") flag.CommandLine.MarkHidden("google-json-key")

View File

@ -57,6 +57,8 @@ func StartAPIServer(lk LocalkubeServer) func() error {
config.AllowPrivileged = true config.AllowPrivileged = true
config.RuntimeConfig = lk.RuntimeConfig
return func() error { return func() error {
return apiserver.Run(config) return apiserver.Run(config)
} }

View File

@ -24,6 +24,7 @@ import (
"net" "net"
"path" "path"
"k8s.io/kubernetes/pkg/util/config"
utilnet "k8s.io/kubernetes/pkg/util/net" utilnet "k8s.io/kubernetes/pkg/util/net"
"k8s.io/minikube/pkg/util" "k8s.io/minikube/pkg/util"
@ -49,6 +50,7 @@ type LocalkubeServer struct {
APIServerInsecurePort int APIServerInsecurePort int
ShouldGenerateCerts bool ShouldGenerateCerts bool
ShowVersion bool ShowVersion bool
RuntimeConfig config.ConfigurationMap
} }
func (lk *LocalkubeServer) AddServer(server Server) { func (lk *LocalkubeServer) AddServer(server Server) {