mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-26 12:46:06 +00:00
Add support for disabling /logs endpoint in kubelet
This commit is contained in:
@@ -103,6 +103,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
|
||||
if obj.Logging.Format == "" {
|
||||
obj.Logging.Format = "text"
|
||||
}
|
||||
obj.EnableSystemLogHandler = true
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@@ -166,6 +166,7 @@ var (
|
||||
"EnableControllerAttachDetach",
|
||||
"EnableDebuggingHandlers",
|
||||
"EnableServer",
|
||||
"EnableSystemLogHandler",
|
||||
"EnforceNodeAllocatable[*]",
|
||||
"EventBurst",
|
||||
"EventRecordQPS",
|
||||
|
@@ -25,6 +25,7 @@ cpuManagerReconcilePeriod: 10s
|
||||
enableControllerAttachDetach: true
|
||||
enableDebuggingHandlers: true
|
||||
enableServer: true
|
||||
enableSystemLogHandler: true
|
||||
enforceNodeAllocatable:
|
||||
- pods
|
||||
eventBurst: 10
|
||||
|
@@ -25,6 +25,7 @@ cpuManagerReconcilePeriod: 10s
|
||||
enableControllerAttachDetach: true
|
||||
enableDebuggingHandlers: true
|
||||
enableServer: true
|
||||
enableSystemLogHandler: true
|
||||
enforceNodeAllocatable:
|
||||
- pods
|
||||
eventBurst: 10
|
||||
|
@@ -361,6 +361,8 @@ type KubeletConfiguration struct {
|
||||
// Logging specifies the options of logging.
|
||||
// Refer [Logs Options](https://github.com/kubernetes/component-base/blob/master/logs/options.go) for more information.
|
||||
Logging componentbaseconfig.LoggingConfiguration
|
||||
// EnableSystemLogHandler enables /logs handler.
|
||||
EnableSystemLogHandler bool
|
||||
}
|
||||
|
||||
// KubeletAuthorizationMode denotes the authorization mode for the kubelet
|
||||
|
@@ -236,4 +236,7 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura
|
||||
}
|
||||
// Use the Default LoggingConfiguration option
|
||||
componentbaseconfigv1alpha1.RecommendedLoggingConfiguration(&obj.Logging)
|
||||
if obj.EnableSystemLogHandler == nil {
|
||||
obj.EnableSystemLogHandler = utilpointer.BoolPtr(true)
|
||||
}
|
||||
}
|
||||
|
@@ -346,6 +346,9 @@ func autoConvert_v1beta1_KubeletConfiguration_To_config_KubeletConfiguration(in
|
||||
if err := v1alpha1.Convert_v1alpha1_LoggingConfiguration_To_config_LoggingConfiguration(&in.Logging, &out.Logging, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := v1.Convert_Pointer_bool_To_bool(&in.EnableSystemLogHandler, &out.EnableSystemLogHandler, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -493,6 +496,9 @@ func autoConvert_config_KubeletConfiguration_To_v1beta1_KubeletConfiguration(in
|
||||
if err := v1alpha1.Convert_config_LoggingConfiguration_To_v1alpha1_LoggingConfiguration(&in.Logging, &out.Logging, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := v1.Convert_bool_To_Pointer_bool(&in.EnableSystemLogHandler, &out.EnableSystemLogHandler, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user