add default for loggingconfiguration struct

This commit is contained in:
amash
2020-06-30 16:21:13 +04:30
parent 3ab25f1876
commit b92b04e7cd
6 changed files with 26 additions and 5 deletions

View File

@@ -100,6 +100,9 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
obj.ConfigMapAndSecretChangeDetectionStrategy = "Watch"
obj.AllowedUnsafeSysctls = []string{}
obj.VolumePluginDir = kubeletconfigv1beta1.DefaultVolumePluginDir
if obj.Logging.Format == "" {
obj.Logging.Format = "text"
}
},
}
}

View File

@@ -49,7 +49,8 @@ iptablesMasqueradeBit: 14
kind: KubeletConfiguration
kubeAPIBurst: 10
kubeAPIQPS: 5
logging: {}
logging:
format: text
makeIPTablesUtilChains: true
maxOpenFiles: 1000000
maxPods: 110

View File

@@ -49,7 +49,8 @@ iptablesMasqueradeBit: 14
kind: KubeletConfiguration
kubeAPIBurst: 10
kubeAPIQPS: 5
logging: {}
logging:
format: text
makeIPTablesUtilChains: true
maxOpenFiles: 1000000
maxPods: 110

View File

@@ -21,6 +21,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime "k8s.io/apimachinery/pkg/runtime"
componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
kubeletconfigv1beta1 "k8s.io/kubelet/config/v1beta1"
// TODO: Cut references to k8s.io/kubernetes, eventually there should be none from this package
"k8s.io/kubernetes/pkg/kubelet/qos"
@@ -233,4 +234,6 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura
if obj.VolumePluginDir == "" {
obj.VolumePluginDir = DefaultVolumePluginDir
}
// Use the Default LoggingConfiguration option
componentbaseconfigv1alpha1.RecommendedLoggingConfiguration(&obj.Logging)
}