Enable all available APIs
parent
f6e39b1e8f
commit
a2f789590b
|
@ -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")
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue