mirror of https://github.com/k3s-io/k3s
Move the kubelet's external types to k8s.io/kubelet
parent
0707b1274f
commit
15760506c2
|
@ -57,6 +57,9 @@ API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentT
|
|||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,Type
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,IntVal
|
||||
API rule violation: names_match,k8s.io/apimachinery/pkg/util/intstr,IntOrString,StrVal
|
||||
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,ResolverConfig
|
||||
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,IPTablesMasqueradeBit
|
||||
API rule violation: names_match,k8s.io/kubelet/config/v1beta1,KubeletConfiguration,IPTablesDropBit
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,AttachDetachControllerConfiguration,DisableAttachDetachReconcilerSync
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,AttachDetachControllerConfiguration,ReconcilerSyncLoopPeriod
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,CSRSigningControllerConfiguration,ClusterSigningCertFile
|
||||
|
@ -167,8 +170,5 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
|
|||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,VolumeConfiguration,EnableDynamicProvisioning
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,VolumeConfiguration,PersistentVolumeRecyclerConfiguration
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1,VolumeConfiguration,FlexVolumePluginDir
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1,KubeletConfiguration,ResolverConfig
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1,KubeletConfiguration,IPTablesMasqueradeBit
|
||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1,KubeletConfiguration,IPTablesDropBit
|
||||
API rule violation: names_match,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,MetricValue,WindowSeconds
|
||||
API rule violation: names_match,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,ExternalMetricValue,WindowSeconds
|
||||
|
|
|
@ -24,7 +24,6 @@ import (
|
|||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
|
||||
kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
|
||||
"k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1"
|
||||
utilpointer "k8s.io/utils/pointer"
|
||||
)
|
||||
|
||||
|
@ -51,7 +50,7 @@ func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
|
|||
}
|
||||
|
||||
// Run the rest of the kube-proxy defaulting code
|
||||
v1alpha1.SetDefaults_KubeProxyConfiguration(externalproxycfg)
|
||||
Scheme.Default(externalproxycfg)
|
||||
|
||||
if internalcfg.ComponentConfigs.KubeProxy == nil {
|
||||
internalcfg.ComponentConfigs.KubeProxy = &kubeproxyconfig.KubeProxyConfiguration{}
|
||||
|
@ -109,7 +108,7 @@ func DefaultKubeletConfiguration(internalcfg *kubeadmapi.ClusterConfiguration) {
|
|||
externalkubeletcfg.HealthzBindAddress = "127.0.0.1"
|
||||
externalkubeletcfg.HealthzPort = utilpointer.Int32Ptr(constants.KubeletHealthzPort)
|
||||
|
||||
kubeletconfigv1beta1.SetDefaults_KubeletConfiguration(externalkubeletcfg)
|
||||
Scheme.Default(externalkubeletcfg)
|
||||
|
||||
if internalcfg.ComponentConfigs.Kubelet == nil {
|
||||
internalcfg.ComponentConfigs.Kubelet = &kubeletconfig.KubeletConfiguration{}
|
||||
|
|
|
@ -704,6 +704,7 @@ staging/src/k8s.io/kube-aggregator/pkg/controllers/status
|
|||
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice
|
||||
staging/src/k8s.io/kube-aggregator/pkg/registry/apiservice/etcd
|
||||
staging/src/k8s.io/kube-proxy/config/v1alpha1
|
||||
staging/src/k8s.io/kubelet/config/v1beta1
|
||||
staging/src/k8s.io/metrics/pkg/apis/custom_metrics
|
||||
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta1
|
||||
staging/src/k8s.io/metrics/pkg/apis/custom_metrics/v1beta2
|
||||
|
|
|
@ -15,5 +15,6 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// TODO: This file should also enable openapi-gen like the other packages
|
||||
|
||||
package config // import "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
|
|
|
@ -23,8 +23,9 @@ import (
|
|||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
"k8s.io/kubelet/config/v1beta1"
|
||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
kubeletconfigv1beta1 "k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/kubelet/qos"
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
"k8s.io/kubernetes/pkg/master/ports"
|
||||
|
@ -88,11 +89,11 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||
}
|
||||
obj.EvictionPressureTransitionPeriod = metav1.Duration{Duration: 5 * time.Minute}
|
||||
obj.MakeIPTablesUtilChains = true
|
||||
obj.IPTablesMasqueradeBit = v1beta1.DefaultIPTablesMasqueradeBit
|
||||
obj.IPTablesDropBit = v1beta1.DefaultIPTablesDropBit
|
||||
obj.IPTablesMasqueradeBit = kubeletconfigv1beta1.DefaultIPTablesMasqueradeBit
|
||||
obj.IPTablesDropBit = kubeletconfigv1beta1.DefaultIPTablesDropBit
|
||||
obj.CgroupsPerQOS = true
|
||||
obj.CgroupDriver = "cgroupfs"
|
||||
obj.EnforceNodeAllocatable = v1beta1.DefaultNodeAllocatableEnforcement
|
||||
obj.EnforceNodeAllocatable = kubeletconfigv1beta1.DefaultNodeAllocatableEnforcement
|
||||
obj.StaticPodURLHeader = make(map[string][]string)
|
||||
obj.ContainerLogMaxFiles = 5
|
||||
obj.ContainerLogMaxSize = "10Mi"
|
||||
|
|
|
@ -20,7 +20,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
"k8s.io/kubelet/config/v1beta1"
|
||||
kubeletconfigv1beta1 "k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1"
|
||||
)
|
||||
|
||||
// Utility functions for the Kubelet's kubeletconfig API group
|
||||
|
@ -32,7 +32,7 @@ func NewSchemeAndCodecs() (*runtime.Scheme, *serializer.CodecFactory, error) {
|
|||
if err := kubeletconfig.AddToScheme(scheme); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if err := v1beta1.AddToScheme(scheme); err != nil {
|
||||
if err := kubeletconfigv1beta1.AddToScheme(scheme); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
codecs := serializer.NewCodecFactory(scheme)
|
||||
|
|
|
@ -20,7 +20,9 @@ import (
|
|||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
|
||||
kruntime "k8s.io/apimachinery/pkg/runtime"
|
||||
// TODO: Cut references to k8s.io/kubernetes, eventually there should be none from this package
|
||||
"k8s.io/kubernetes/pkg/features"
|
||||
"k8s.io/kubernetes/pkg/kubelet/qos"
|
||||
kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
|
||||
|
@ -29,12 +31,14 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
// TODO: Move these constants to k8s.io/kubelet/config/v1beta1 instead?
|
||||
DefaultIPTablesMasqueradeBit = 14
|
||||
DefaultIPTablesDropBit = 15
|
||||
)
|
||||
|
||||
var (
|
||||
zeroDuration = metav1.Duration{}
|
||||
// TODO: Move these constants to k8s.io/kubelet/config/v1beta1 instead?
|
||||
// Refer to [Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node/node-allocatable.md) doc for more information.
|
||||
DefaultNodeAllocatableEnforcement = []string{"pods"}
|
||||
)
|
||||
|
@ -43,7 +47,7 @@ func addDefaultingFuncs(scheme *kruntime.Scheme) error {
|
|||
return RegisterDefaults(scheme)
|
||||
}
|
||||
|
||||
func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
||||
func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfiguration) {
|
||||
if obj.SyncFrequency == zeroDuration {
|
||||
obj.SyncFrequency = metav1.Duration{Duration: 1 * time.Minute}
|
||||
}
|
||||
|
@ -69,7 +73,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||
obj.Authentication.Webhook.CacheTTL = metav1.Duration{Duration: 2 * time.Minute}
|
||||
}
|
||||
if obj.Authorization.Mode == "" {
|
||||
obj.Authorization.Mode = KubeletAuthorizationModeWebhook
|
||||
obj.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
|
||||
}
|
||||
if obj.Authorization.Webhook.CacheAuthorizedTTL == zeroDuration {
|
||||
obj.Authorization.Webhook.CacheAuthorizedTTL = metav1.Duration{Duration: 5 * time.Minute}
|
||||
|
@ -140,7 +144,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||
obj.RuntimeRequestTimeout = metav1.Duration{Duration: 2 * time.Minute}
|
||||
}
|
||||
if obj.HairpinMode == "" {
|
||||
obj.HairpinMode = PromiscuousBridge
|
||||
obj.HairpinMode = kubeletconfigv1beta1.PromiscuousBridge
|
||||
}
|
||||
if obj.MaxPods == 0 {
|
||||
obj.MaxPods = 110
|
||||
|
@ -206,7 +210,7 @@ func SetDefaults_KubeletConfiguration(obj *KubeletConfiguration) {
|
|||
obj.ContainerLogMaxFiles = utilpointer.Int32Ptr(5)
|
||||
}
|
||||
if obj.ConfigMapAndSecretChangeDetectionStrategy == "" {
|
||||
obj.ConfigMapAndSecretChangeDetectionStrategy = WatchChangeDetectionStrategy
|
||||
obj.ConfigMapAndSecretChangeDetectionStrategy = kubeletconfigv1beta1.WatchChangeDetectionStrategy
|
||||
}
|
||||
if obj.EnforceNodeAllocatable == nil {
|
||||
obj.EnforceNodeAllocatable = DefaultNodeAllocatableEnforcement
|
||||
|
|
|
@ -16,7 +16,9 @@ limitations under the License.
|
|||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/kubelet/apis/config
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:conversion-gen-external-types=k8s.io/kubelet/config/v1beta1
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
// +k8s:defaulter-gen-input=../../../../../vendor/k8s.io/kubelet/config/v1beta1
|
||||
// +groupName=kubelet.config.k8s.io
|
||||
|
||||
package v1beta1 // import "k8s.io/kubelet/config/v1beta1"
|
||||
package v1beta1 // import "k8s.io/kubernetes/pkg/kubelet/apis/config/v1beta1"
|
||||
|
|
|
@ -17,8 +17,8 @@ limitations under the License.
|
|||
package v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
|
@ -28,10 +28,7 @@ const GroupName = "kubelet.config.k8s.io"
|
|||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
|
||||
|
||||
var (
|
||||
// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
|
||||
// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
|
||||
SchemeBuilder runtime.SchemeBuilder
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
localSchemeBuilder = &kubeletconfigv1beta1.SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
|
@ -39,13 +36,5 @@ func init() {
|
|||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addKnownTypes, addDefaultingFuncs)
|
||||
}
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&KubeletConfiguration{},
|
||||
&SerializedNodeConfigSource{},
|
||||
)
|
||||
return nil
|
||||
localSchemeBuilder.Register(addDefaultingFuncs)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright 2018 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.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package
|
||||
// +k8s:openapi-gen=true
|
||||
// +groupName=kubelet.config.k8s.io
|
||||
|
||||
package v1beta1 // import "k8s.io/kubelet/config/v1beta1"
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Copyright 2018 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 v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "kubelet.config.k8s.io"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
localSchemeBuilder = &SchemeBuilder
|
||||
AddToScheme = localSchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func init() {
|
||||
// We only register manually written functions here. The registration of the
|
||||
// generated functions takes place in the generated files. The separation
|
||||
// makes the code compile even when the generated files are missing.
|
||||
localSchemeBuilder.Register(addKnownTypes)
|
||||
}
|
||||
|
||||
// Adds the list of known types to the given scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&KubeletConfiguration{},
|
||||
&SerializedNodeConfigSource{},
|
||||
)
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
../../staging/src/k8s.io/kubelet
|
Loading…
Reference in New Issue