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
0140c82c
Unverified
Commit
0140c82c
authored
Jan 06, 2019
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated references from k8s.io/{apiserver,apimachinery} to the new…
Updated references from k8s.io/{apiserver,apimachinery} to the new k8s.io/component-base repo. Co-authored-by @Klaven
parent
2e52d5c3
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
71 additions
and
82 deletions
+71
-82
doc.go
cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go
+1
-2
options_test.go
cmd/cloud-controller-manager/app/options/options_test.go
+5
-6
debugging.go
cmd/controller-manager/app/options/debugging.go
+2
-2
generic.go
cmd/controller-manager/app/options/generic.go
+3
-4
serve.go
cmd/controller-manager/app/serve.go
+2
-2
options_test.go
cmd/kube-controller-manager/app/options/options_test.go
+3
-4
server.go
cmd/kube-proxy/app/server.go
+3
-3
server_test.go
cmd/kube-proxy/app/server_test.go
+2
-2
options.go
cmd/kube-scheduler/app/options/options.go
+2
-2
options_test.go
cmd/kube-scheduler/app/options/options_test.go
+5
-6
config.go
pkg/client/leaderelectionconfig/config.go
+3
-2
types.go
pkg/controller/apis/config/types.go
+4
-5
defaults.go
pkg/controller/apis/config/v1alpha1/defaults.go
+4
-5
types.go
pkg/proxy/apis/config/types.go
+2
-2
validation.go
pkg/proxy/apis/config/validation/validation.go
+2
-2
validation_test.go
pkg/proxy/apis/config/validation/validation_test.go
+4
-4
types.go
pkg/scheduler/apis/config/types.go
+5
-6
defaults.go
pkg/scheduler/apis/config/v1alpha1/defaults.go
+2
-2
validation.go
pkg/scheduler/apis/config/validation/validation.go
+3
-4
validation_test.go
pkg/scheduler/apis/config/validation/validation_test.go
+3
-4
types.go
...c/k8s.io/kube-controller-manager/config/v1alpha1/types.go
+4
-5
types.go
staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go
+2
-2
types.go
staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go
+5
-6
No files found.
cmd/cloud-controller-manager/app/apis/config/v1alpha1/doc.go
View file @
0140c82c
...
...
@@ -21,8 +21,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config
// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config/v1alpha1
// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config/v1alpha1
// +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1
// +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta
...
...
cmd/cloud-controller-manager/app/options/options_test.go
View file @
0140c82c
...
...
@@ -24,11 +24,10 @@ import (
"github.com/spf13/pflag"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
apiserverconfig
"k8s.io/apiserver/pkg/apis/config"
apiserveroptions
"k8s.io/apiserver/pkg/server/options"
componentbaseconfig
"k8s.io/component-base/config"
cmoptions
"k8s.io/kubernetes/cmd/controller-manager/app/options"
)
...
...
@@ -40,13 +39,13 @@ func TestDefaultFlags(t *testing.T) {
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
12
*
time
.
Hour
},
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
20.0
,
Burst
:
30
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
0
},
LeaderElection
:
apiserver
config
.
LeaderElectionConfiguration
{
LeaderElection
:
componentbase
config
.
LeaderElectionConfiguration
{
ResourceLock
:
"endpoints"
,
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
...
...
@@ -158,13 +157,13 @@ func TestAddFlags(t *testing.T) {
Port
:
DefaultInsecureCloudControllerManagerPort
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
100
*
time
.
Minute
},
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
ContentType
:
"application/vnd.kubernetes.protobuf"
,
QPS
:
50.0
,
Burst
:
100
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Minute
},
LeaderElection
:
apiserver
config
.
LeaderElectionConfiguration
{
LeaderElection
:
componentbase
config
.
LeaderElectionConfiguration
{
ResourceLock
:
"configmap"
,
LeaderElect
:
false
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
...
...
cmd/controller-manager/app/options/debugging.go
View file @
0140c82c
...
...
@@ -19,7 +19,7 @@ package options
import
(
"github.com/spf13/pflag"
apiserverconfig
"k8s.io/apiserver/pkg/apis
/config"
componentbaseconfig
"k8s.io/component-base
/config"
)
// DebuggingOptions holds the Debugging options.
...
...
@@ -41,7 +41,7 @@ func (o *DebuggingOptions) AddFlags(fs *pflag.FlagSet) {
}
// ApplyTo fills up Debugging config with options.
func
(
o
*
DebuggingOptions
)
ApplyTo
(
cfg
*
apiserver
config
.
DebuggingConfiguration
)
error
{
func
(
o
*
DebuggingOptions
)
ApplyTo
(
cfg
*
componentbase
config
.
DebuggingConfiguration
)
error
{
if
o
==
nil
{
return
nil
}
...
...
cmd/controller-manager/app/options/generic.go
View file @
0140c82c
...
...
@@ -20,11 +20,10 @@ import (
"fmt"
"strings"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/sets"
apiserverconfig
"k8s.io/apiserver/pkg/apis/config"
apiserverflag
"k8s.io/apiserver/pkg/util/flag"
componentbaseconfig
"k8s.io/component-base/config"
"k8s.io/kubernetes/pkg/client/leaderelectionconfig"
kubectrlmgrconfig
"k8s.io/kubernetes/pkg/controller/apis/config"
)
...
...
@@ -34,9 +33,9 @@ type GenericControllerManagerConfigurationOptions struct {
Port
int32
Address
string
MinResyncPeriod
metav1
.
Duration
ClientConnection
apimachinery
config
.
ClientConnectionConfiguration
ClientConnection
componentbase
config
.
ClientConnectionConfiguration
ControllerStartInterval
metav1
.
Duration
LeaderElection
apiserver
config
.
LeaderElectionConfiguration
LeaderElection
componentbase
config
.
LeaderElectionConfiguration
Debugging
*
DebuggingOptions
Controllers
[]
string
}
...
...
cmd/controller-manager/app/serve.go
View file @
0140c82c
...
...
@@ -21,7 +21,6 @@ import (
"net/http"
goruntime
"runtime"
apiserverconfig
"k8s.io/apiserver/pkg/apis/config"
genericapifilters
"k8s.io/apiserver/pkg/endpoints/filters"
apirequest
"k8s.io/apiserver/pkg/endpoints/request"
apiserver
"k8s.io/apiserver/pkg/server"
...
...
@@ -29,6 +28,7 @@ import (
"k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/mux"
"k8s.io/apiserver/pkg/server/routes"
componentbaseconfig
"k8s.io/component-base/config"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/util/configz"
)
...
...
@@ -52,7 +52,7 @@ func BuildHandlerChain(apiHandler http.Handler, authorizationInfo *apiserver.Aut
}
// NewBaseHandler takes in CompletedConfig and returns a handler.
func
NewBaseHandler
(
c
*
apiserver
config
.
DebuggingConfiguration
,
checks
...
healthz
.
HealthzChecker
)
*
mux
.
PathRecorderMux
{
func
NewBaseHandler
(
c
*
componentbase
config
.
DebuggingConfiguration
,
checks
...
healthz
.
HealthzChecker
)
*
mux
.
PathRecorderMux
{
mux
:=
mux
.
NewPathRecorderMux
(
"controller-manager"
)
healthz
.
InstallHandler
(
mux
,
checks
...
)
if
c
.
EnableProfiling
{
...
...
cmd/kube-controller-manager/app/options/options_test.go
View file @
0140c82c
...
...
@@ -25,11 +25,10 @@ import (
"github.com/spf13/pflag"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
apiserverconfig
"k8s.io/apiserver/pkg/apis/config"
apiserveroptions
"k8s.io/apiserver/pkg/server/options"
componentbaseconfig
"k8s.io/component-base/config"
cmoptions
"k8s.io/kubernetes/cmd/controller-manager/app/options"
kubectrlmgrconfig
"k8s.io/kubernetes/pkg/controller/apis/config"
)
...
...
@@ -128,13 +127,13 @@ func TestAddFlags(t *testing.T) {
Port
:
10252
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address
:
"0.0.0.0"
,
// Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod
:
metav1
.
Duration
{
Duration
:
8
*
time
.
Hour
},
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
ContentType
:
"application/json"
,
QPS
:
50.0
,
Burst
:
100
,
},
ControllerStartInterval
:
metav1
.
Duration
{
Duration
:
2
*
time
.
Minute
},
LeaderElection
:
apiserver
config
.
LeaderElectionConfiguration
{
LeaderElection
:
componentbase
config
.
LeaderElectionConfiguration
{
ResourceLock
:
"configmap"
,
LeaderElect
:
false
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
...
...
cmd/kube-proxy/app/server.go
View file @
0140c82c
...
...
@@ -28,8 +28,7 @@ import (
"strings"
"time"
"k8s.io/api/core/v1"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
v1
"k8s.io/api/core/v1"
v1meta
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
...
...
@@ -48,6 +47,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
clientcmdapi
"k8s.io/client-go/tools/clientcmd/api"
"k8s.io/client-go/tools/record"
componentbaseconfig
"k8s.io/component-base/config"
"k8s.io/kube-proxy/config/v1alpha1"
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubelet/qos"
...
...
@@ -422,7 +422,7 @@ type ProxyServer struct {
// createClients creates a kube client and an event client from the given config and masterOverride.
// TODO remove masterOverride when CLI flags are removed.
func
createClients
(
config
apimachinery
config
.
ClientConnectionConfiguration
,
masterOverride
string
)
(
clientset
.
Interface
,
v1core
.
EventsGetter
,
error
)
{
func
createClients
(
config
componentbase
config
.
ClientConnectionConfiguration
,
masterOverride
string
)
(
clientset
.
Interface
,
v1core
.
EventsGetter
,
error
)
{
var
kubeConfig
*
rest
.
Config
var
err
error
...
...
cmd/kube-proxy/app/server_test.go
View file @
0140c82c
...
...
@@ -26,9 +26,9 @@ import (
"github.com/stretchr/testify/assert"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
componentbaseconfig
"k8s.io/component-base/config"
api
"k8s.io/kubernetes/pkg/apis/core"
kubeproxyconfig
"k8s.io/kubernetes/pkg/proxy/apis/config"
"k8s.io/kubernetes/pkg/util/configz"
...
...
@@ -289,7 +289,7 @@ nodePortAddresses:
}
expected
:=
&
kubeproxyconfig
.
KubeProxyConfiguration
{
BindAddress
:
expBindAddr
,
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
AcceptContentTypes
:
"abc"
,
Burst
:
100
,
ContentType
:
"content-type"
,
...
...
cmd/kube-scheduler/app/options/options.go
View file @
0140c82c
...
...
@@ -24,7 +24,6 @@ import (
"time"
corev1
"k8s.io/api/core/v1"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
apiserveroptions
"k8s.io/apiserver/pkg/server/options"
...
...
@@ -39,6 +38,7 @@ import (
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/client-go/tools/record"
componentbaseconfig
"k8s.io/component-base/config"
"k8s.io/klog"
kubeschedulerconfigv1alpha1
"k8s.io/kube-scheduler/config/v1alpha1"
schedulerappconfig
"k8s.io/kubernetes/cmd/kube-scheduler/app/config"
...
...
@@ -294,7 +294,7 @@ func makeLeaderElectionConfig(config kubeschedulerconfig.KubeSchedulerLeaderElec
// createClients creates a kube client and an event client from the given config and masterOverride.
// TODO remove masterOverride when CLI flags are removed.
func
createClients
(
config
apimachinery
config
.
ClientConnectionConfiguration
,
masterOverride
string
,
timeout
time
.
Duration
)
(
clientset
.
Interface
,
clientset
.
Interface
,
v1core
.
EventsGetter
,
error
)
{
func
createClients
(
config
componentbase
config
.
ClientConnectionConfiguration
,
masterOverride
string
,
timeout
time
.
Duration
)
(
clientset
.
Interface
,
clientset
.
Interface
,
v1core
.
EventsGetter
,
error
)
{
if
len
(
config
.
Kubeconfig
)
==
0
&&
len
(
masterOverride
)
==
0
{
klog
.
Warningf
(
"Neither --kubeconfig nor --master was specified. Using default API client. This might not work."
)
}
...
...
cmd/kube-scheduler/app/options/options_test.go
View file @
0140c82c
...
...
@@ -28,11 +28,10 @@ import (
"testing"
"time"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/diff"
apiserverconfig
"k8s.io/apiserver/pkg/apis/config"
apiserveroptions
"k8s.io/apiserver/pkg/server/options"
componentbaseconfig
"k8s.io/component-base/config"
kubeschedulerconfig
"k8s.io/kubernetes/pkg/scheduler/apis/config"
)
...
...
@@ -209,7 +208,7 @@ users:
MetricsBindAddress
:
"0.0.0.0:10251"
,
FailureDomains
:
"kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region"
,
LeaderElection
:
kubeschedulerconfig
.
KubeSchedulerLeaderElectionConfiguration
{
LeaderElectionConfiguration
:
apiserver
config
.
LeaderElectionConfiguration
{
LeaderElectionConfiguration
:
componentbase
config
.
LeaderElectionConfiguration
{
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
...
...
@@ -219,7 +218,7 @@ users:
LockObjectNamespace
:
"kube-system"
,
LockObjectName
:
"kube-scheduler"
,
},
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
Kubeconfig
:
configKubeconfig
,
QPS
:
50
,
Burst
:
100
,
...
...
@@ -289,7 +288,7 @@ users:
MetricsBindAddress
:
""
,
// defaults empty when not running from config file
FailureDomains
:
"kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region"
,
LeaderElection
:
kubeschedulerconfig
.
KubeSchedulerLeaderElectionConfiguration
{
LeaderElectionConfiguration
:
apiserver
config
.
LeaderElectionConfiguration
{
LeaderElectionConfiguration
:
componentbase
config
.
LeaderElectionConfiguration
{
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
15
*
time
.
Second
},
RenewDeadline
:
metav1
.
Duration
{
Duration
:
10
*
time
.
Second
},
...
...
@@ -299,7 +298,7 @@ users:
LockObjectNamespace
:
"kube-system"
,
LockObjectName
:
"kube-scheduler"
,
},
ClientConnection
:
apimachinery
config
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbase
config
.
ClientConnectionConfiguration
{
Kubeconfig
:
flagKubeconfig
,
QPS
:
50
,
Burst
:
100
,
...
...
pkg/client/leaderelectionconfig/config.go
View file @
0140c82c
...
...
@@ -20,16 +20,17 @@ import (
"time"
"github.com/spf13/pflag"
apiserverconfig
"k8s.io/apiserver/pkg/apis
/config"
componentbaseconfig
"k8s.io/component-base
/config"
)
const
(
// DefaultLeaseDuration defines a default duration of lease.
// TODO: This constant should move to the k8s.io/component-base/config package
DefaultLeaseDuration
=
15
*
time
.
Second
)
// BindFlags binds the LeaderElectionConfiguration struct fields to a flagset
func
BindFlags
(
l
*
apiserver
config
.
LeaderElectionConfiguration
,
fs
*
pflag
.
FlagSet
)
{
func
BindFlags
(
l
*
componentbase
config
.
LeaderElectionConfiguration
,
fs
*
pflag
.
FlagSet
)
{
fs
.
BoolVar
(
&
l
.
LeaderElect
,
"leader-elect"
,
l
.
LeaderElect
,
""
+
"Start a leader election client and gain leadership before "
+
"executing the main loop. Enable this when running replicated "
+
...
...
pkg/controller/apis/config/types.go
View file @
0140c82c
...
...
@@ -17,9 +17,8 @@ limitations under the License.
package
config
import
(
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfig
"k8s.io/apiserver/pkg/apis
/config"
componentbaseconfig
"k8s.io/component-base
/config"
)
// GroupResource describes an group resource.
...
...
@@ -112,11 +111,11 @@ type GenericControllerManagerConfiguration struct {
MinResyncPeriod
metav1
.
Duration
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection
apimachinery
config
.
ClientConnectionConfiguration
ClientConnection
componentbase
config
.
ClientConnectionConfiguration
// How long to wait between starting controller managers
ControllerStartInterval
metav1
.
Duration
// leaderElection defines the configuration of leader election client.
LeaderElection
apiserver
config
.
LeaderElectionConfiguration
LeaderElection
componentbase
config
.
LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
...
...
@@ -124,7 +123,7 @@ type GenericControllerManagerConfiguration struct {
// first item for a particular name wins
Controllers
[]
string
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging
apiserver
config
.
DebuggingConfiguration
Debugging
componentbase
config
.
DebuggingConfiguration
}
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
...
...
pkg/controller/apis/config/v1alpha1/defaults.go
View file @
0140c82c
...
...
@@ -19,10 +19,9 @@ package v1alpha1
import
(
"time"
apimachineryconfigv1alpha1
"k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime
"k8s.io/apimachinery/pkg/runtime"
apiserverconfigv1alpha1
"k8s.io/apiserver/pkg/apis
/config/v1alpha1"
componentbaseconfigv1alpha1
"k8s.io/component-base
/config/v1alpha1"
kubectrlmgrconfigv1alpha1
"k8s.io/kube-controller-manager/config/v1alpha1"
utilpointer
"k8s.io/utils/pointer"
)
...
...
@@ -52,7 +51,7 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph
obj
.
TTLAfterFinishedController
.
ConcurrentTTLSyncs
=
5
}
// These defaults override the recommended defaults from the
apimachinery
configv1alpha1 package that are applied automatically
// These defaults override the recommended defaults from the
componentbase
configv1alpha1 package that are applied automatically
// These client-connection defaults are specific to the kube-controller-manager
if
obj
.
Generic
.
ClientConnection
.
QPS
==
0.0
{
obj
.
Generic
.
ClientConnection
.
QPS
=
20.0
...
...
@@ -81,8 +80,8 @@ func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrcon
}
// Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
apimachinery
configv1alpha1
.
RecommendedDefaultClientConnectionConfiguration
(
&
obj
.
ClientConnection
)
apiserver
configv1alpha1
.
RecommendedDefaultLeaderElectionConfiguration
(
&
obj
.
LeaderElection
)
componentbase
configv1alpha1
.
RecommendedDefaultClientConnectionConfiguration
(
&
obj
.
ClientConnection
)
componentbase
configv1alpha1
.
RecommendedDefaultLeaderElectionConfiguration
(
&
obj
.
LeaderElection
)
}
func
SetDefaults_KubeCloudSharedConfiguration
(
obj
*
kubectrlmgrconfigv1alpha1
.
KubeCloudSharedConfiguration
)
{
...
...
pkg/proxy/apis/config/types.go
View file @
0140c82c
...
...
@@ -21,8 +21,8 @@ import (
"sort"
"strings"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
componentbaseconfig
"k8s.io/component-base/config"
)
// KubeProxyIPTablesConfiguration contains iptables-related configuration
...
...
@@ -108,7 +108,7 @@ type KubeProxyConfiguration struct {
HostnameOverride
string
// clientConnection specifies the kubeconfig file and client connection settings for the proxy
// server to use when communicating with the apiserver.
ClientConnection
apimachinery
config
.
ClientConnectionConfiguration
ClientConnection
componentbase
config
.
ClientConnectionConfiguration
// iptables contains iptables-related configuration options.
IPTables
KubeProxyIPTablesConfiguration
// ipvs contains ipvs-related configuration options.
...
...
pkg/proxy/apis/config/validation/validation.go
View file @
0140c82c
...
...
@@ -23,10 +23,10 @@ import (
"strconv"
"strings"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
utilnet
"k8s.io/apimachinery/pkg/util/net"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/apimachinery/pkg/util/validation/field"
componentbaseconfig
"k8s.io/component-base/config"
apivalidation
"k8s.io/kubernetes/pkg/apis/core/validation"
kubeproxyconfig
"k8s.io/kubernetes/pkg/proxy/apis/config"
)
...
...
@@ -187,7 +187,7 @@ func validateProxyModeWindows(mode kubeproxyconfig.ProxyMode, fldPath *field.Pat
return
field
.
ErrorList
{
field
.
Invalid
(
fldPath
.
Child
(
"ProxyMode"
),
string
(
mode
),
errMsg
)}
}
func
validateClientConnectionConfiguration
(
config
apimachinery
config
.
ClientConnectionConfiguration
,
fldPath
*
field
.
Path
)
field
.
ErrorList
{
func
validateClientConnectionConfiguration
(
config
componentbase
config
.
ClientConnectionConfiguration
,
fldPath
*
field
.
Path
)
field
.
ErrorList
{
allErrs
:=
field
.
ErrorList
{}
allErrs
=
append
(
allErrs
,
apivalidation
.
ValidateNonnegativeField
(
int64
(
config
.
Burst
),
fldPath
.
Child
(
"Burst"
))
...
)
return
allErrs
...
...
pkg/proxy/apis/config/validation/validation_test.go
View file @
0140c82c
...
...
@@ -23,9 +23,9 @@ import (
"testing"
"time"
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/validation/field"
componentbaseconfig
"k8s.io/component-base/config"
kubeproxyconfig
"k8s.io/kubernetes/pkg/proxy/apis/config"
"k8s.io/utils/pointer"
)
...
...
@@ -575,7 +575,7 @@ func TestValidateProxyMode(t *testing.T) {
func
TestValidateClientConnectionConfiguration
(
t
*
testing
.
T
)
{
newPath
:=
field
.
NewPath
(
"KubeProxyConfiguration"
)
successCases
:=
[]
apimachinery
config
.
ClientConnectionConfiguration
{
successCases
:=
[]
componentbase
config
.
ClientConnectionConfiguration
{
{
Burst
:
0
,
},
...
...
@@ -591,11 +591,11 @@ func TestValidateClientConnectionConfiguration(t *testing.T) {
}
errorCases
:=
[]
struct
{
ccc
apimachinery
config
.
ClientConnectionConfiguration
ccc
componentbase
config
.
ClientConnectionConfiguration
msg
string
}{
{
ccc
:
apimachinery
config
.
ClientConnectionConfiguration
{
Burst
:
-
5
},
ccc
:
componentbase
config
.
ClientConnectionConfiguration
{
Burst
:
-
5
},
msg
:
"must be greater than or equal to 0"
,
},
}
...
...
pkg/scheduler/apis/config/types.go
View file @
0140c82c
...
...
@@ -17,9 +17,8 @@ limitations under the License.
package
config
import
(
apimachineryconfig
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfig
"k8s.io/apiserver/pkg/apis
/config"
componentbaseconfig
"k8s.io/component-base
/config"
)
const
(
...
...
@@ -58,7 +57,7 @@ type KubeSchedulerConfiguration struct {
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection
apimachinery
config
.
ClientConnectionConfiguration
ClientConnection
componentbase
config
.
ClientConnectionConfiguration
// HealthzBindAddress is the IP address and port for the health check server to serve on,
// defaulting to 0.0.0.0:10251
HealthzBindAddress
string
...
...
@@ -67,8 +66,8 @@ type KubeSchedulerConfiguration struct {
MetricsBindAddress
string
// DebuggingConfiguration holds configuration for Debugging related features
// TODO: We might wanna make this a substruct like Debugging
apiserver
config.DebuggingConfiguration
apiserver
config
.
DebuggingConfiguration
// TODO: We might wanna make this a substruct like Debugging
componentbase
config.DebuggingConfiguration
componentbase
config
.
DebuggingConfiguration
// DisablePreemption disables the pod preemption feature.
DisablePreemption
bool
...
...
@@ -130,7 +129,7 @@ type SchedulerPolicyConfigMapSource struct {
// KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration
// to include scheduler specific configuration.
type
KubeSchedulerLeaderElectionConfiguration
struct
{
apiserver
config
.
LeaderElectionConfiguration
componentbase
config
.
LeaderElectionConfiguration
// LockObjectNamespace defines the namespace of the lock object
LockObjectNamespace
string
// LockObjectName defines the lock object name
...
...
pkg/scheduler/apis/config/v1alpha1/defaults.go
View file @
0140c82c
...
...
@@ -21,7 +21,7 @@ import (
"strconv"
"k8s.io/apimachinery/pkg/runtime"
apiserverconfigv1alpha1
"k8s.io/apiserver/pkg/apis
/config/v1alpha1"
componentbaseconfigv1alpha1
"k8s.io/component-base
/config/v1alpha1"
kubescedulerconfigv1alpha1
"k8s.io/kube-scheduler/config/v1alpha1"
// this package shouldn't really depend on other k8s.io/kubernetes code
...
...
@@ -97,7 +97,7 @@ func SetDefaults_KubeSchedulerConfiguration(obj *kubescedulerconfigv1alpha1.Kube
}
// Use the default LeaderElectionConfiguration options
apiserver
configv1alpha1
.
RecommendedDefaultLeaderElectionConfiguration
(
&
obj
.
LeaderElection
.
LeaderElectionConfiguration
)
componentbase
configv1alpha1
.
RecommendedDefaultLeaderElectionConfiguration
(
&
obj
.
LeaderElection
.
LeaderElectionConfiguration
)
if
obj
.
BindTimeoutSeconds
==
nil
{
defaultBindTimeoutSeconds
:=
int64
(
600
)
...
...
pkg/scheduler/apis/config/validation/validation.go
View file @
0140c82c
...
...
@@ -17,17 +17,16 @@ limitations under the License.
package
validation
import
(
apimachinery
"k8s.io/apimachinery/pkg/apis/config/validation"
"k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field"
apiserver
"k8s.io/apiserver/pkg/apis
/config/validation"
componentbasevalidation
"k8s.io/component-base
/config/validation"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
)
// ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct
func
ValidateKubeSchedulerConfiguration
(
cc
*
config
.
KubeSchedulerConfiguration
)
field
.
ErrorList
{
allErrs
:=
field
.
ErrorList
{}
allErrs
=
append
(
allErrs
,
apimachinery
.
ValidateClientConnectionConfiguration
(
&
cc
.
ClientConnection
,
field
.
NewPath
(
"clientConnection"
))
...
)
allErrs
=
append
(
allErrs
,
componentbasevalidation
.
ValidateClientConnectionConfiguration
(
&
cc
.
ClientConnection
,
field
.
NewPath
(
"clientConnection"
))
...
)
allErrs
=
append
(
allErrs
,
ValidateKubeSchedulerLeaderElectionConfiguration
(
&
cc
.
LeaderElection
,
field
.
NewPath
(
"leaderElection"
))
...
)
if
len
(
cc
.
SchedulerName
)
==
0
{
allErrs
=
append
(
allErrs
,
field
.
Required
(
field
.
NewPath
(
"schedulerName"
),
""
))
...
...
@@ -57,7 +56,7 @@ func ValidateKubeSchedulerLeaderElectionConfiguration(cc *config.KubeSchedulerLe
if
!
cc
.
LeaderElectionConfiguration
.
LeaderElect
{
return
allErrs
}
allErrs
=
append
(
allErrs
,
apiserver
.
ValidateLeaderElectionConfiguration
(
&
cc
.
LeaderElectionConfiguration
,
field
.
NewPath
(
"leaderElectionConfiguration"
))
...
)
allErrs
=
append
(
allErrs
,
componentbasevalidation
.
ValidateLeaderElectionConfiguration
(
&
cc
.
LeaderElectionConfiguration
,
field
.
NewPath
(
"leaderElectionConfiguration"
))
...
)
if
len
(
cc
.
LockObjectNamespace
)
==
0
{
allErrs
=
append
(
allErrs
,
field
.
Required
(
fldPath
.
Child
(
"lockObjectNamespace"
),
""
))
}
...
...
pkg/scheduler/apis/config/validation/validation_test.go
View file @
0140c82c
...
...
@@ -20,9 +20,8 @@ import (
"testing"
"time"
apimachinery
"k8s.io/apimachinery/pkg/apis/config"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
apiserver
"k8s.io/apiserver/pkg/apis
/config"
componentbaseconfig
"k8s.io/component-base
/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config"
)
...
...
@@ -33,7 +32,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) {
HealthzBindAddress
:
"0.0.0.0:10254"
,
MetricsBindAddress
:
"0.0.0.0:10254"
,
HardPodAffinitySymmetricWeight
:
80
,
ClientConnection
:
apimachinery
.
ClientConnectionConfiguration
{
ClientConnection
:
componentbaseconfig
.
ClientConnectionConfiguration
{
AcceptContentTypes
:
"application/json"
,
ContentType
:
"application/json"
,
QPS
:
10
,
...
...
@@ -50,7 +49,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) {
LeaderElection
:
config
.
KubeSchedulerLeaderElectionConfiguration
{
LockObjectNamespace
:
"name"
,
LockObjectName
:
"name"
,
LeaderElectionConfiguration
:
apiserver
.
LeaderElectionConfiguration
{
LeaderElectionConfiguration
:
componentbaseconfig
.
LeaderElectionConfiguration
{
ResourceLock
:
"configmap"
,
LeaderElect
:
true
,
LeaseDuration
:
metav1
.
Duration
{
Duration
:
30
*
time
.
Second
},
...
...
staging/src/k8s.io/kube-controller-manager/config/v1alpha1/types.go
View file @
0140c82c
...
...
@@ -17,9 +17,8 @@ limitations under the License.
package
v1alpha1
import
(
apimachineryconfigv1alpha1
"k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfigv1alpha1
"k8s.io/apiserver/pkg/apis
/config/v1alpha1"
componentbaseconfigv1alpha1
"k8s.io/component-base
/config/v1alpha1"
)
// PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins.
...
...
@@ -161,11 +160,11 @@ type GenericControllerManagerConfiguration struct {
MinResyncPeriod
metav1
.
Duration
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection
apimachinery
configv1alpha1
.
ClientConnectionConfiguration
ClientConnection
componentbase
configv1alpha1
.
ClientConnectionConfiguration
// How long to wait between starting controller managers
ControllerStartInterval
metav1
.
Duration
// leaderElection defines the configuration of leader election client.
LeaderElection
apiserver
configv1alpha1
.
LeaderElectionConfiguration
LeaderElection
componentbase
configv1alpha1
.
LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'"
...
...
@@ -173,7 +172,7 @@ type GenericControllerManagerConfiguration struct {
// first item for a particular name wins
Controllers
[]
string
// DebuggingConfiguration holds configuration for Debugging related features.
Debugging
apiserver
configv1alpha1
.
DebuggingConfiguration
Debugging
componentbase
configv1alpha1
.
DebuggingConfiguration
}
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager
...
...
staging/src/k8s.io/kube-proxy/config/v1alpha1/types.go
View file @
0140c82c
...
...
@@ -17,8 +17,8 @@ limitations under the License.
package
v1alpha1
import
(
apimachineryconfigv1alpha1
"k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
componentbaseconfigv1alpha1
"k8s.io/component-base/config/v1alpha1"
)
// KubeProxyIPTablesConfiguration contains iptables-related configuration
...
...
@@ -104,7 +104,7 @@ type KubeProxyConfiguration struct {
HostnameOverride
string
`json:"hostnameOverride"`
// clientConnection specifies the kubeconfig file and client connection settings for the proxy
// server to use when communicating with the apiserver.
ClientConnection
apimachinery
configv1alpha1
.
ClientConnectionConfiguration
`json:"clientConnection"`
ClientConnection
componentbase
configv1alpha1
.
ClientConnectionConfiguration
`json:"clientConnection"`
// iptables contains iptables-related configuration options.
IPTables
KubeProxyIPTablesConfiguration
`json:"iptables"`
// ipvs contains ipvs-related configuration options.
...
...
staging/src/k8s.io/kube-scheduler/config/v1alpha1/types.go
View file @
0140c82c
...
...
@@ -17,9 +17,8 @@ limitations under the License.
package
v1alpha1
import
(
apimachineryconfigv1alpha1
"k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfigv1alpha1
"k8s.io/apiserver/pkg/apis
/config/v1alpha1"
componentbaseconfigv1alpha1
"k8s.io/component-base
/config/v1alpha1"
)
const
(
...
...
@@ -54,7 +53,7 @@ type KubeSchedulerConfiguration struct {
// ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver.
ClientConnection
apimachinery
configv1alpha1
.
ClientConnectionConfiguration
`json:"clientConnection"`
ClientConnection
componentbase
configv1alpha1
.
ClientConnectionConfiguration
`json:"clientConnection"`
// HealthzBindAddress is the IP address and port for the health check server to serve on,
// defaulting to 0.0.0.0:10251
HealthzBindAddress
string
`json:"healthzBindAddress"`
...
...
@@ -63,8 +62,8 @@ type KubeSchedulerConfiguration struct {
MetricsBindAddress
string
`json:"metricsBindAddress"`
// DebuggingConfiguration holds configuration for Debugging related features
// TODO: We might wanna make this a substruct like Debugging
apiserverconfig
.DebuggingConfiguration
apiserver
configv1alpha1
.
DebuggingConfiguration
`json:",inline"`
// TODO: We might wanna make this a substruct like Debugging
componentbaseconfigv1alpha1
.DebuggingConfiguration
componentbase
configv1alpha1
.
DebuggingConfiguration
`json:",inline"`
// DisablePreemption disables the pod preemption feature.
DisablePreemption
bool
`json:"disablePreemption"`
...
...
@@ -126,7 +125,7 @@ type SchedulerPolicyConfigMapSource struct {
// KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration
// to include scheduler specific configuration.
type
KubeSchedulerLeaderElectionConfiguration
struct
{
apiserver
configv1alpha1
.
LeaderElectionConfiguration
`json:",inline"`
componentbase
configv1alpha1
.
LeaderElectionConfiguration
`json:",inline"`
// LockObjectNamespace defines the namespace of the lock object
LockObjectNamespace
string
`json:"lockObjectNamespace"`
// LockObjectName defines the lock object name
...
...
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