mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	smtalign: add cpu-manager-policy-options flag in Kubelet
In this patch we enhance the kubelet configuration to support cpuManagerPolicyOptions. In order to introduce SMT-awareness in CPU Manager, we introduce a new flag in Kubelet to allow the user to specify an additional flag called `cpumanager-policy-options` to allow the user to modify the behaviour of static policy to strictly guarantee allocation of whole core. Co-authored-by: Francesco Romani <fromani@redhat.com> Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
This commit is contained in:
		
				
					committed by
					
						
						Francesco Romani
					
				
			
			
				
	
			
			
			
						parent
						
							4d78db54a5
						
					
				
				
					commit
					cc76a756e4
				
			@@ -492,6 +492,7 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
 | 
			
		||||
	fs.StringVar(&c.CgroupDriver, "cgroup-driver", c.CgroupDriver, "Driver that the kubelet uses to manipulate cgroups on the host.  Possible values: 'cgroupfs', 'systemd'")
 | 
			
		||||
	fs.StringVar(&c.CgroupRoot, "cgroup-root", c.CgroupRoot, "Optional root cgroup to use for pods. This is handled by the container runtime on a best effort basis. Default: '', which means use the container runtime default.")
 | 
			
		||||
	fs.StringVar(&c.CPUManagerPolicy, "cpu-manager-policy", c.CPUManagerPolicy, "CPU Manager policy to use. Possible values: 'none', 'static'.")
 | 
			
		||||
	fs.Var(cliflag.NewMapStringStringNoSplit(&c.CPUManagerPolicyOptions), "cpu-manager-policy-options", "A set of key=value CPU Manager policy options to use, to fine tune their behaviour. If not supplied, keep the default behaviour.")
 | 
			
		||||
	fs.DurationVar(&c.CPUManagerReconcilePeriod.Duration, "cpu-manager-reconcile-period", c.CPUManagerReconcilePeriod.Duration, "<Warning: Alpha feature> CPU Manager reconciliation period. Examples: '10s', or '1m'. If not supplied, defaults to 'NodeStatusUpdateFrequency'")
 | 
			
		||||
	fs.Var(cliflag.NewMapStringString(&c.QOSReserved), "qos-reserved", "<Warning: Alpha feature> A set of ResourceName=Percentage (e.g. memory=50%) pairs that describe how pod resource requests are reserved at the QoS level. Currently only memory is supported. Requires the QOSReserved feature gate to be enabled.")
 | 
			
		||||
	fs.StringVar(&c.TopologyManagerPolicy, "topology-manager-policy", c.TopologyManagerPolicy, "Topology Manager policy to use. Possible values: 'none', 'best-effort', 'restricted', 'single-numa-node'.")
 | 
			
		||||
 
 | 
			
		||||
@@ -70,6 +70,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
 | 
			
		||||
			obj.NodeStatusReportFrequency = metav1.Duration{Duration: time.Minute}
 | 
			
		||||
			obj.NodeLeaseDurationSeconds = 40
 | 
			
		||||
			obj.CPUManagerPolicy = "none"
 | 
			
		||||
			obj.CPUManagerPolicyOptions = make(map[string]string)
 | 
			
		||||
			obj.CPUManagerReconcilePeriod = obj.NodeStatusUpdateFrequency
 | 
			
		||||
			obj.NodeStatusMaxImages = 50
 | 
			
		||||
			obj.TopologyManagerPolicy = kubeletconfig.NoneTopologyManagerPolicy
 | 
			
		||||
 
 | 
			
		||||
@@ -150,6 +150,7 @@ var (
 | 
			
		||||
		"CPUCFSQuota",
 | 
			
		||||
		"CPUCFSQuotaPeriod.Duration",
 | 
			
		||||
		"CPUManagerPolicy",
 | 
			
		||||
		"CPUManagerPolicyOptions[*]",
 | 
			
		||||
		"CPUManagerReconcilePeriod.Duration",
 | 
			
		||||
		"TopologyManagerPolicy",
 | 
			
		||||
		"TopologyManagerScope",
 | 
			
		||||
 
 | 
			
		||||
@@ -221,6 +221,10 @@ type KubeletConfiguration struct {
 | 
			
		||||
	// CPUManagerPolicy is the name of the policy to use.
 | 
			
		||||
	// Requires the CPUManager feature gate to be enabled.
 | 
			
		||||
	CPUManagerPolicy string
 | 
			
		||||
	// CPUManagerPolicyOptions is a set of key=value which 	allows to set extra options
 | 
			
		||||
	// to fine tune the behaviour of the cpu manager policies.
 | 
			
		||||
	// Requires  both the "CPUManager" and "CPUManagerPolicyOptions" feature gates to be enabled.
 | 
			
		||||
	CPUManagerPolicyOptions map[string]string
 | 
			
		||||
	// CPU Manager reconciliation period.
 | 
			
		||||
	// Requires the CPUManager feature gate to be enabled.
 | 
			
		||||
	CPUManagerReconcilePeriod metav1.Duration
 | 
			
		||||
 
 | 
			
		||||
@@ -448,6 +448,14 @@ type KubeletConfiguration struct {
 | 
			
		||||
	// Default: "None"
 | 
			
		||||
	// +optional
 | 
			
		||||
	CPUManagerPolicy string `json:"cpuManagerPolicy,omitempty"`
 | 
			
		||||
	// cpuManagerPolicyOptions is a set of key=value which 	allows to set extra options
 | 
			
		||||
	// to fine tune the behaviour of the cpu manager policies.
 | 
			
		||||
	// Requires  both the "CPUManager" and "CPUManagerPolicyOptions" feature gates to be enabled.
 | 
			
		||||
	// Dynamic Kubelet Config (beta): This field should not be updated without a full node
 | 
			
		||||
	// reboot. It is safest to keep this value the same as the local config.
 | 
			
		||||
	// Default: nil
 | 
			
		||||
	// +optional
 | 
			
		||||
	CPUManagerPolicyOptions map[string]string `json:"cpuManagerPolicyOptions,omitempty"`
 | 
			
		||||
	// cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager.
 | 
			
		||||
	// Requires the CPUManager feature gate to be enabled.
 | 
			
		||||
	// Dynamic Kubelet Config (deprecated): If dynamically updating this field, consider that
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user