Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
226af4ad
Commit
226af4ad
authored
Feb 07, 2017
by
deads2k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move --runtime-config to kubeapiserver
parent
b2ea7807
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
11 deletions
+54
-11
options.go
cmd/kube-apiserver/app/options/options.go
+3
-0
server.go
cmd/kube-apiserver/app/server.go
+1
-1
options.go
federation/cmd/federation-apiserver/app/options/options.go
+3
-0
server.go
federation/cmd/federation-apiserver/app/server.go
+1
-1
BUILD
pkg/kubeapiserver/options/BUILD
+2
-0
api_enablement.go
pkg/kubeapiserver/options/api_enablement.go
+44
-0
server_run_options.go
...k8s.io/apiserver/pkg/server/options/server_run_options.go
+0
-9
No files found.
cmd/kube-apiserver/app/options/options.go
View file @
226af4ad
...
...
@@ -48,6 +48,7 @@ type ServerRunOptions struct {
Authorization
*
kubeoptions
.
BuiltInAuthorizationOptions
CloudProvider
*
kubeoptions
.
CloudProviderOptions
StorageSerialization
*
kubeoptions
.
StorageSerializationOptions
APIEnablement
*
kubeoptions
.
APIEnablementOptions
AllowPrivileged
bool
EventTTL
time
.
Duration
...
...
@@ -72,6 +73,7 @@ func NewServerRunOptions() *ServerRunOptions {
Authorization
:
kubeoptions
.
NewBuiltInAuthorizationOptions
(),
CloudProvider
:
kubeoptions
.
NewCloudProviderOptions
(),
StorageSerialization
:
kubeoptions
.
NewStorageSerializationOptions
(),
APIEnablement
:
kubeoptions
.
NewAPIEnablementOptions
(),
EventTTL
:
1
*
time
.
Hour
,
MasterCount
:
1
,
...
...
@@ -107,6 +109,7 @@ func (s *ServerRunOptions) AddFlags(fs *pflag.FlagSet) {
s
.
Authorization
.
AddFlags
(
fs
)
s
.
CloudProvider
.
AddFlags
(
fs
)
s
.
StorageSerialization
.
AddFlags
(
fs
)
s
.
APIEnablement
.
AddFlags
(
fs
)
// Note: the weird ""+ in below lines seems to be the only way to get gofmt to
// arrange these text blocks sensibly. Grrr.
...
...
cmd/kube-apiserver/app/server.go
View file @
226af4ad
...
...
@@ -203,7 +203,7 @@ func Run(s *options.ServerRunOptions) error {
genericapiserver
.
NewDefaultResourceEncodingConfig
(
api
.
Registry
),
storageGroupsToEncodingVersion
,
// FIXME: this GroupVersionResource override should be configurable
[]
schema
.
GroupVersionResource
{
batch
.
Resource
(
"cronjobs"
)
.
WithVersion
(
"v2alpha1"
)},
master
.
DefaultAPIResourceConfigSource
(),
s
.
GenericServerRunOptions
.
RuntimeConfig
)
master
.
DefaultAPIResourceConfigSource
(),
s
.
APIEnablement
.
RuntimeConfig
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error in initializing storage factory: %s"
,
err
)
}
...
...
federation/cmd/federation-apiserver/app/options/options.go
View file @
226af4ad
...
...
@@ -40,6 +40,7 @@ type ServerRunOptions struct {
Authorization
*
kubeoptions
.
BuiltInAuthorizationOptions
CloudProvider
*
kubeoptions
.
CloudProviderOptions
StorageSerialization
*
kubeoptions
.
StorageSerializationOptions
APIEnablement
*
kubeoptions
.
APIEnablementOptions
EventTTL
time
.
Duration
}
...
...
@@ -55,6 +56,7 @@ func NewServerRunOptions() *ServerRunOptions {
Authorization
:
kubeoptions
.
NewBuiltInAuthorizationOptions
(),
CloudProvider
:
kubeoptions
.
NewCloudProviderOptions
(),
StorageSerialization
:
kubeoptions
.
NewStorageSerializationOptions
(),
APIEnablement
:
kubeoptions
.
NewAPIEnablementOptions
(),
EventTTL
:
1
*
time
.
Hour
,
}
...
...
@@ -74,6 +76,7 @@ func (s *ServerRunOptions) AddFlags(fs *pflag.FlagSet) {
s
.
Authorization
.
AddFlags
(
fs
)
s
.
CloudProvider
.
AddFlags
(
fs
)
s
.
StorageSerialization
.
AddFlags
(
fs
)
s
.
APIEnablement
.
AddFlags
(
fs
)
fs
.
DurationVar
(
&
s
.
EventTTL
,
"event-ttl"
,
s
.
EventTTL
,
"Amount of time to retain events. Default is 1h."
)
...
...
federation/cmd/federation-apiserver/app/server.go
View file @
226af4ad
...
...
@@ -118,7 +118,7 @@ func Run(s *options.ServerRunOptions) error {
storageFactory
,
err
:=
kubeapiserver
.
BuildDefaultStorageFactory
(
s
.
Etcd
.
StorageConfig
,
s
.
GenericServerRunOptions
.
DefaultStorageMediaType
,
api
.
Codecs
,
genericapiserver
.
NewDefaultResourceEncodingConfig
(
api
.
Registry
),
storageGroupsToEncodingVersion
,
[]
schema
.
GroupVersionResource
{},
resourceConfig
,
s
.
GenericServerRunOptions
.
RuntimeConfig
)
[]
schema
.
GroupVersionResource
{},
resourceConfig
,
s
.
APIEnablement
.
RuntimeConfig
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"error in initializing storage factory: %s"
,
err
)
}
...
...
pkg/kubeapiserver/options/BUILD
View file @
226af4ad
...
...
@@ -11,6 +11,7 @@ load(
go_library(
name = "go_default_library",
srcs = [
"api_enablement.go",
"authentication.go",
"authorization.go",
"cloudprovider.go",
...
...
@@ -29,6 +30,7 @@ go_library(
"//vendor:k8s.io/apimachinery/pkg/runtime/schema",
"//vendor:k8s.io/apiserver/pkg/server",
"//vendor:k8s.io/apiserver/pkg/server/options",
"//vendor:k8s.io/apiserver/pkg/util/flag",
],
)
...
...
pkg/kubeapiserver/options/api_enablement.go
0 → 100644
View file @
226af4ad
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
options
import
(
"github.com/spf13/pflag"
utilflag
"k8s.io/apiserver/pkg/util/flag"
)
// APIEnablementOptions contains the options for which resources to turn on and off.
// Given small aggregated API servers, this option isn't required for "normal" API servers
type
APIEnablementOptions
struct
{
RuntimeConfig
utilflag
.
ConfigurationMap
}
func
NewAPIEnablementOptions
()
*
APIEnablementOptions
{
return
&
APIEnablementOptions
{
RuntimeConfig
:
make
(
utilflag
.
ConfigurationMap
),
}
}
// AddFlags adds flags for a specific APIServer to the specified FlagSet
func
(
s
*
APIEnablementOptions
)
AddFlags
(
fs
*
pflag
.
FlagSet
)
{
fs
.
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."
)
}
staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go
View file @
226af4ad
...
...
@@ -25,7 +25,6 @@ import (
"k8s.io/apiserver/pkg/admission"
"k8s.io/apiserver/pkg/server"
utilfeature
"k8s.io/apiserver/pkg/util/feature"
utilflag
"k8s.io/apiserver/pkg/util/flag"
// add the generic feature gates
_
"k8s.io/apiserver/pkg/features"
...
...
@@ -58,7 +57,6 @@ type ServerRunOptions struct {
MaxRequestsInFlight
int
MaxMutatingRequestsInFlight
int
MinRequestTimeout
int
RuntimeConfig
utilflag
.
ConfigurationMap
TargetRAMMB
int
WatchCacheSizes
[]
string
}
...
...
@@ -77,7 +75,6 @@ func NewServerRunOptions() *ServerRunOptions {
MaxRequestsInFlight
:
defaults
.
MaxRequestsInFlight
,
MaxMutatingRequestsInFlight
:
defaults
.
MaxMutatingRequestsInFlight
,
MinRequestTimeout
:
defaults
.
MinRequestTimeout
,
RuntimeConfig
:
make
(
utilflag
.
ConfigurationMap
),
}
}
...
...
@@ -218,12 +215,6 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) {
"handler, which picks a randomized value above this number as the connection timeout, "
+
"to spread out load."
)
fs
.
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."
)
fs
.
StringSliceVar
(
&
s
.
WatchCacheSizes
,
"watch-cache-sizes"
,
s
.
WatchCacheSizes
,
""
+
"List of watch cache sizes for every resource (pods, nodes, etc.), comma separated. "
+
"The individual override format: resource#size, where size is a number. It takes effect "
+
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment