Merge pull request #84835 from denkensk/enable-profiling-default-in-scheduler
Enable profiling by default in the scheduler
This commit is contained in:
		@@ -260,6 +260,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				MetricsBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       true,
 | 
			
		||||
@@ -343,6 +347,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "", // defaults empty when not running from config file
 | 
			
		||||
				MetricsBindAddress:             "", // defaults empty when not running from config file
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       true,
 | 
			
		||||
@@ -404,6 +412,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "", // defaults empty when not running from config file
 | 
			
		||||
				MetricsBindAddress:             "", // defaults empty when not running from config file
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       true,
 | 
			
		||||
@@ -440,6 +452,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				MetricsBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       true,
 | 
			
		||||
@@ -518,6 +534,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				MetricsBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       true,
 | 
			
		||||
@@ -557,6 +577,10 @@ pluginConfig:
 | 
			
		||||
				HardPodAffinitySymmetricWeight: 1,
 | 
			
		||||
				HealthzBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				MetricsBindAddress:             "0.0.0.0:10251",
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           true,
 | 
			
		||||
					EnableContentionProfiling: true,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       false,
 | 
			
		||||
 
 | 
			
		||||
@@ -156,4 +156,16 @@ func SetDefaults_KubeSchedulerConfiguration(obj *kubeschedulerconfigv1alpha1.Kub
 | 
			
		||||
		val := int64(10)
 | 
			
		||||
		obj.PodMaxBackoffSeconds = &val
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Enable profiling by default in the scheduler
 | 
			
		||||
	if obj.EnableProfiling == nil {
 | 
			
		||||
		enableProfiling := true
 | 
			
		||||
		obj.EnableProfiling = &enableProfiling
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// Enable contention profiling by default if profiling is enabled
 | 
			
		||||
	if *obj.EnableProfiling && obj.EnableContentionProfiling == nil {
 | 
			
		||||
		enableContentionProfiling := true
 | 
			
		||||
		obj.EnableContentionProfiling = &enableContentionProfiling
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,7 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func TestSchedulerDefaults(t *testing.T) {
 | 
			
		||||
	enable := true
 | 
			
		||||
	tests := []struct {
 | 
			
		||||
		name     string
 | 
			
		||||
		config   *kubeschedulerconfigv1alpha1.KubeSchedulerConfiguration
 | 
			
		||||
@@ -42,6 +43,10 @@ func TestSchedulerDefaults(t *testing.T) {
 | 
			
		||||
				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1),
 | 
			
		||||
				HealthzBindAddress:             pointer.StringPtr("0.0.0.0:10251"),
 | 
			
		||||
				MetricsBindAddress:             pointer.StringPtr("0.0.0.0:10251"),
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           &enable,
 | 
			
		||||
					EnableContentionProfiling: &enable,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfigv1alpha1.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       pointer.BoolPtr(true),
 | 
			
		||||
@@ -80,6 +85,10 @@ func TestSchedulerDefaults(t *testing.T) {
 | 
			
		||||
				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1),
 | 
			
		||||
				HealthzBindAddress:             pointer.StringPtr("1.2.3.4:10251"),
 | 
			
		||||
				MetricsBindAddress:             pointer.StringPtr("1.2.3.4:10251"),
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           &enable,
 | 
			
		||||
					EnableContentionProfiling: &enable,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfigv1alpha1.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       pointer.BoolPtr(true),
 | 
			
		||||
@@ -118,6 +127,10 @@ func TestSchedulerDefaults(t *testing.T) {
 | 
			
		||||
				HardPodAffinitySymmetricWeight: pointer.Int32Ptr(1),
 | 
			
		||||
				HealthzBindAddress:             pointer.StringPtr("0.0.0.0:12345"),
 | 
			
		||||
				MetricsBindAddress:             pointer.StringPtr("0.0.0.0:12345"),
 | 
			
		||||
				DebuggingConfiguration: componentbaseconfig.DebuggingConfiguration{
 | 
			
		||||
					EnableProfiling:           &enable,
 | 
			
		||||
					EnableContentionProfiling: &enable,
 | 
			
		||||
				},
 | 
			
		||||
				LeaderElection: kubeschedulerconfigv1alpha1.KubeSchedulerLeaderElectionConfiguration{
 | 
			
		||||
					LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
 | 
			
		||||
						LeaderElect:       pointer.BoolPtr(true),
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user