@@ -66,7 +66,7 @@ type kubeletConfig struct {
66
66
HairpinMode string `json:"hairpinMode"`
67
67
ProtectKernelDefaults bool `json:"protectKernelDefaults"`
68
68
ReadOnlyPort int `json:"readOnlyPort"`
69
- Logging logsapi. LoggingConfiguration `json:"logging"`
69
+ Logging loggingConfiguration `json:"logging"`
70
70
SerializeImagePulls bool `json:"serializeImagePulls"`
71
71
ServerTLSBootstrap bool `json:"serverTLSBootstrap"`
72
72
TLSCipherSuites []string `json:"tlsCipherSuites"`
@@ -79,6 +79,10 @@ type kubeletConfig struct {
79
79
RegisterWithTaints []v1.Taint `json:"registerWithTaints,omitempty"`
80
80
}
81
81
82
+ type loggingConfiguration struct {
83
+ Verbosity logsapi.VerbosityLevel `json:"verbosity"`
84
+ }
85
+
82
86
// Creates an internal kubelet configuration from the public facing bootstrap
83
87
// kubelet configuration with additional sane defaults.
84
88
func defaultKubeletSubConfig () kubeletConfig {
@@ -117,7 +121,7 @@ func defaultKubeletSubConfig() kubeletConfig {
117
121
HairpinMode : "hairpin-veth" ,
118
122
ProtectKernelDefaults : true ,
119
123
ReadOnlyPort : 0 ,
120
- Logging : logsapi. LoggingConfiguration {
124
+ Logging : loggingConfiguration {
121
125
Verbosity : 2 ,
122
126
},
123
127
SerializeImagePulls : false ,
@@ -317,20 +321,22 @@ func (k *kubelet) writeKubeletConfigToDir(cfg *api.NodeConfig, userKubeletConfig
317
321
return err
318
322
}
319
323
320
- dirPath := path .Join (kubeletConfigRoot , kubeletConfigDir )
321
- k .flags ["config-dir" ] = dirPath
322
-
323
- zap .L ().Info ("Enabling kubelet config drop-in dir.." )
324
- k .setEnv ("KUBELET_CONFIG_DROPIN_DIR_ALPHA" , "on" )
324
+ configPath := path .Join (kubeletConfigRoot , kubeletConfigFile )
325
+ k .flags ["config" ] = configPath
325
326
326
- filePath := path .Join (dirPath , "99-defaults.conf" )
327
- zap .L ().Info ("Writing kubelet config to drop-in file.." , zap .String ("path" , filePath ))
328
- if err := util .WriteFileWithDir (filePath , kubeletConfigBytes , kubeletConfigPerm ); err != nil {
327
+ zap .L ().Info ("Writing kubelet config to file.." , zap .String ("path" , configPath ))
328
+ if err := util .WriteFileWithDir (configPath , kubeletConfigBytes , kubeletConfigPerm ); err != nil {
329
329
return err
330
330
}
331
331
332
332
if userKubeletConfig != nil && len (userKubeletConfig ) > 0 {
333
- filePath = path .Join (dirPath , "00-overrides.conf" )
333
+ dirPath := path .Join (kubeletConfigRoot , kubeletConfigDir )
334
+ k .flags ["config-dir" ] = dirPath
335
+
336
+ zap .L ().Info ("Enabling kubelet config drop-in dir.." )
337
+ k .setEnv ("KUBELET_CONFIG_DROPIN_DIR_ALPHA" , "on" )
338
+
339
+ filePath := path .Join (dirPath , "00-overrides.conf" )
334
340
zap .L ().Info ("Writing user kubelet config to drop-in file.." , zap .String ("path" , filePath ))
335
341
if err := util .WriteFileWithDir (filePath , userKubeletConfig , kubeletConfigPerm ); err != nil {
336
342
return err
0 commit comments