Documentation
¶
Index ¶
Constants ¶
const ( CgroupV1 = "v1" CgroupV2 = "v2" )
const variables indicate cgroup versions
const ( NodeAnnotationCPUOvercommitRatioKey = "katalyst.kubewharf.io/cpu_overcommit_ratio" NodeAnnotationMemoryOvercommitRatioKey = "katalyst.kubewharf.io/memory_overcommit_ratio" NodeAnnotationRealtimeCPUOvercommitRatioKey = "katalyst.kubewharf.io/realtime_cpu_overcommit_ratio" NodeAnnotationRealtimeMemoryOvercommitRatioKey = "katalyst.kubewharf.io/realtime_memory_overcommit_ratio" NodeAnnotationOriginalCapacityCPUKey = "katalyst.kubewharf.io/original_capacity_cpu" NodeAnnotationOriginalCapacityMemoryKey = "katalyst.kubewharf.io/original_capacity_memory" NodeAnnotationOriginalAllocatableCPUKey = "katalyst.kubewharf.io/original_allocatable_cpu" NodeAnnotationOriginalAllocatableMemoryKey = "katalyst.kubewharf.io/original_allocatable_memory" NodeAnnotationOvercommitCapacityCPUKey = "katalyst.kubewharf.io/overcommit_capacity_cpu" NodeAnnotationOvercommitAllocatableCPUKey = "katalyst.kubewharf.io/overcommit_allocatable_cpu" NodeAnnotationOvercommitCapacityMemoryKey = "katalyst.kubewharf.io/overcommit_capacity_memory" NodeAnnotationOvercommitAllocatableMemoryKey = "katalyst.kubewharf.io/overcommit_allocatable_memory" )
const variables for node annotations about overcommit ratio
const ( NodeOvercommitSelectorKey = "katalyst.kubewharf.io/overcommit_node_pool" DefaultNodeCPUOvercommitRatio = "1" DefaultNodeMemoryOvercommitRatio = "1" )
const variables for matching up with node labels about overcommit
const ( // KCNRAnnotationGuaranteedCPUs sum of pod guaranteed cpus in node KCNRAnnotationGuaranteedCPUs = "katalyst.kubewharf.io/guaranteed_cpus" KCNRAnnotationCPUManager = "katalyst.kubewharf.io/overcommit_cpu_manager" KCNRAnnotationMemoryManager = "katalyst.kubewharf.io/overcommit_memory_manager" CPUManagerOff KCNRAnnotationCPUManagerPolicy = "none" CPUManagerPolicyNone KCNRAnnotationCPUManagerPolicy = "none" MemoryManagerOff KCNRAnnotationMemoryManagerPolicy = "None" MemoryManagerPolicyNone KCNRAnnotationMemoryManagerPolicy = "None" )
const ( PodAnnotationInplaceUpdateResourcesKey = "pod.kubernetes.io/resizeResources" PodAnnotationInplaceUpdateResizePolicyKey = "pod.kubernetes.io/resizePolicy" PodAnnotationInplaceUpdateResizePolicyRestart = "Restart" PodAnnotationInplaceUpdateResizingKey = "pod.kubernetes.io/inplace-update-resizing" PodAnnotationAggregatedRequestsKey = "pod.kubernetes.io/pod-aggregated-requests" )
const variables for pod annotations about vpa in-place resource update.
const ( // PodAnnotationCPUWeightDemandCoresKey is a const variable for pod annotation about cpu cores demand to calculate cpu weight. PodAnnotationCPUWeightDemandCoresKey = "katalyst.kubewharf.io/cpu_weight_demand_cores" // PodAnnotationCPUWeightBurstRatioKey is a const variable for pod annotation about cpu burst ratio to calculate cpu weight. PodAnnotationCPUWeightBurstRatioKey = "katalyst.kubewharf.io/cpu_weight_burst_ratio" )
const ( PodAnnotationQoSLevelKey = "katalyst.kubewharf.io/qos_level" PodAnnotationQoSLevelReclaimedCores = string(QoSLevelReclaimedCores) PodAnnotationQoSLevelDedicatedCores = string(QoSLevelDedicatedCores) PodAnnotationQoSLevelSystemCores = string(QoSLevelSystemCores) )
const variables for pod annotations about qos level
const ( PodAnnotationMemoryEnhancementKey = "katalyst.kubewharf.io/memory_enhancement" // PodAnnotationMemoryEnhancementRssOverUseThreshold provides a mechanism to enable // the ability of overcommit for memory, and we will relay on this enhancement to ensure // memory protection if rss usage exceeds requests (based on this given ratio) PodAnnotationMemoryEnhancementRssOverUseThreshold = "rss_overuse_threshold" // PodAnnotationMemoryEnhancementNumaBinding provides a mechanism to enable numa-binding // for workload to provide more ultimate running performances. // // With PodAnnotationMemoryEnhancementNumaBinding but without PodAnnotationMemoryEnhancementNumaExclusive, // we have several constraints below: // 1. different workloads may still share the same numa // - these workloads may still have contentions on memory bandwidth // 2. the request for pod can be settled in a single numa node // - this to avoid complicated cross numa memory capacity/bandwidth control // // todo: this enhancement is only supported for dedicated-cores now, // the community if to support shared-cores in the short future. PodAnnotationMemoryEnhancementNumaBinding = "numa_binding" PodAnnotationMemoryEnhancementNumaBindingEnable = "true" // PodAnnotationMemoryEnhancementNumaExclusive provides a mechanism to enable numa-exclusive // for A SINGLE Pod to avoid contention on memory bandwidth and so on. // // - this enhancement is only supported for dedicated-cores, for now and foreseeable future PodAnnotationMemoryEnhancementNumaExclusive = "numa_exclusive" PodAnnotationMemoryEnhancementNumaExclusiveEnable = "true" // PodAnnotationMemoryEnhancementOOMPriority provides a mechanism to specify // the OOM priority for pods. Higher priority values indicate a higher likelihood // of surviving OOM events. // // For different QoS levels, the acceptable value ranges are as follows: // - reclaimed_cores: [-100, 0) // - shared_cores: [0, 100) // - dedicated_cores: [100, 200) // - system_cores: [200, 300) // Additionally, there are two predefined values for any pod: // - -300: Indicates that the OOM priority is ignored, and the pod does not // participate in priority comparison. // - 300: Indicates that the OOM priority is set to the highest level, the pod // will never be terminated due to OOM events from the perspective of OOM enhancement PodAnnotationMemoryEnhancementOOMPriority = "oom_priority" )
const variables for pod annotations about qos level enhancement in memory
const ( PodAnnotationCPUEnhancementKey = "katalyst.kubewharf.io/cpu_enhancement" // PodAnnotationCPUEnhancementCPUSet provides a mechanism separate cpuset into // several orthogonal pools to avoid cpu contentions for different types of workloads, // i.e. spark batch, flink streaming, web service may fall into three pools. // and, each individual pod should be put into only one pool. // // - this enhancement is only supported for shared-cores, for now and foreseeable future // - all pods will be settled in `default` pool if not specified PodAnnotationCPUEnhancementCPUSet = "cpuset_pool" // PodAnnotationCPUEnhancementNUMAShare enables NUMA sharing for pods. // It supports different cpuset_pool or qos_level pods that require NUMA binding // to share or not share NUMA resources. // // - This enhancement is supported for shared-cores and dedicated-cores. // - By default, all pods can share the same NUMA if not specified. // PodAnnotationCPUEnhancementSuppressionToleranceRate provides a mechanism to ensure // the quality for reclaimed resources. since reclaimed resources will always change // dynamically according to running states of none-reclaimed services, it may reach to // a point that the resource contention is still be tolerable for none-reclaimed services, // but the reclaimed services runs too slow and would rather be killed and rescheduled. // in this case, the workload can use this enhancement to trigger eviction. // // - this enhancement is only supported for reclaimed-cores, for now and foreseeable future PodAnnotationCPUEnhancementSuppressionToleranceRate = "suppression_tolerance_rate" // PodAnnotationCPUEnhancementCPUBurstPolicy is the policy for setting the cpu burst value. // There are 3 possible values for this: default, static, dynamic. // // - Default: There is no change to cpu burst value // - Closed: cpu burst value is always set to 0 // - Static: cpu burst value is set to a constant value // - Dynamic: cpu burst value is only enabled when pod cpu utilisation is lower than the threshold set PodAnnotationCPUEnhancementCPUBurstPolicy = "cpu_burst_policy" PodAnnotationCPUEnhancementCPUBurstPolicyDefault = "default" PodAnnotationCPUEnhancementCPUBurstPolicyClosed = "closed" PodAnnotationCPUEnhancementCPUBurstPolicyStatic = "static" PodAnnotationCPUEnhancementCPUBurstPolicyDynamic = "dynamic" // PodAnnotationCPUEnhancementCPUBurstThreshold is the value such that when pod cpu utilisation becomes lower than // the threshold, cpu burst is dynamically enabled. Only enabled when cpu burst policy is dynamic PodAnnotationCPUEnhancementCPUBurstThreshold = "cpu_burst_threshold" // PodAnnotationCPUEnhancementCPUBurstPercent determines the cpu burst value to be set. // For cgroup v1, the cpu burst value is calculated using cpu.cfs_quota_us * (cpu_burst_percent / 100) // For cgroup v2, the cpu burst value is calculated using cpu.max * (cpu_burst_percent / 100) PodAnnotationCPUEnhancementCPUBurstPercent = "cpu_burst_percent" // PodAnnotationCPUEnhancementAlignBySocket is a strong constraint that determines if the cpu cores allocated // should be within the fewest number of sockets possible. For example, if a socket has 16 cores, // and a pod requests 15 cores, it must be allocated within one socket. // If a socket has 16 cores, and a pod requests 17 cores, it must be allocated within two sockets. // If set to true, the above conditions must be met. PodAnnotationCPUEnhancementAlignBySocket = "align_by_socket" PodAnnotationCPUEnhancementAlignBySocketEnable = "true" // PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma determines if the cpu cores allocated should be distributed // evenly across NUMA nodes. PodAnnotationCPUEnhancementDistributeEvenlyAcrossNuma = "distribute_evenly_across_numa" PodAnnotationCPUEnhancementDistributeEvenlyAcrossNumaEnable = "true" // PodAnnotationCPUEnhancementFullPCPUsPairing is a strong constraint that restricts the core allocation to // full physical cores only. This means the cpu cores allocated must come from different physical cores, // and only one of the threads in each core is allocated, while the remaining threads are idle. // If set to true, the above conditions must be met. PodAnnotationCPUEnhancementFullPCPUsPairing = "full_pcpus_pairing" PodAnnotationCPUEnhancementFullPCPUsPairingEnable = "true" // PodAnnotationCPUEnhancementNumaNumber is a strong constraint that restricts the hints to be of a certain NUMA count. PodAnnotationCPUEnhancementNumaNumber = "katalyst.kubewharf.io/numa_number" // PodAnnotationCPUEnhancementNumaIDs is a strong constraint that restricts the hints to be within specific NUMA IDs. // PodAnnotationCPUEnhancementNumaIDs is of a priority than PodAnnotationCPUEnhancementNumaNumber. PodAnnotationCPUEnhancementNumaIDs = "katalyst.kubewharf.io/numa_ids" )
const variables for pod annotations about qos level enhancement in cpu
const ( PodAnnotationNetworkEnhancementKey = "katalyst.kubewharf.io/network_enhancement" // PodAnnotationNetworkEnhancementNamespaceType provides a mechanism to select nic in different namespaces // - PodAnnotationNetworkEnhancementNamespaceTypeHost // - only select nic device in host namespace // - admit failed if not possible // - PodAnnotationNetworkEnhancementNamespaceTypeHostPrefer // - prefer tp select nic device in non-host namespace // - also accept nic device in non-host namespace if not possible // - PodAnnotationNetworkEnhancementNamespaceTypeNotHost // - only select nic device in non-host namespace // - admit failed if not possible // - PodAnnotationNetworkEnhancementNamespaceTypeNotHostPrefer // - only select nic device in non-host namespace // - also accept nic device in host namespace if not possible PodAnnotationNetworkEnhancementNamespaceType = "namespace_type" PodAnnotationNetworkEnhancementNamespaceTypeHost = "host_ns" PodAnnotationNetworkEnhancementNamespaceTypeHostPrefer = "host_ns_preferred" PodAnnotationNetworkEnhancementNamespaceTypeNotHost = "anti_host_ns" PodAnnotationNetworkEnhancementNamespaceTypeNotHostPrefer = "anti_host_ns_preferred" // PodAnnotationNetworkEnhancementAffinityRestricted sets as true to indicate // we must ensure the numa affinity for nic devices, and we should admit failed if not possible PodAnnotationNetworkEnhancementAffinityRestricted = "topology_affinity_restricted" PodAnnotationNetworkEnhancementAffinityRestrictedTrue = "true" )
const variables for pod annotations about qos level enhancement in network
const ( // BalancedAllocation strategy favors nodes with balanced resource usage rate BalancedAllocation kubeschedulerconfig.ScoringStrategyType = "BalancedAllocation" // LeastNUMANodes strategy favors nodes which requires least amount of NUMA nodes to satisfy resource requests for given pod LeastNUMANodes kubeschedulerconfig.ScoringStrategyType = "LeastNUMANodes" )
const variables for node resource topology scoring strategy
const ( ReclaimedResourceMilliCPU v1.ResourceName = "resource.katalyst.kubewharf.io/reclaimed_millicpu" ReclaimedResourceMemory v1.ResourceName = "resource.katalyst.kubewharf.io/reclaimed_memory" )
const variables for resource names of reclaimed resource
const ( ResourceNetBandwidth v1.ResourceName = "resource.katalyst.kubewharf.io/net_bandwidth" ResourceMemoryBandwidth v1.ResourceName = "resource.katalyst.kubewharf.io/memory_bandwidth" ResourceMilliGPU v1.ResourceName = "resource.katalyst.kubewharf.io/milligpu" ResourceGPUMemory v1.ResourceName = "resource.katalyst.kubewharf.io/gpu_memory" ResourceSriovNic v1.ResourceName = "resource.katalyst.kubewharf.io/sriov_nic" )
const variables for resource names of guaranteed resource
const ( // ResourceAnnotationKeyResourceIdentifier nominated the key to override the default name // field in pod-resource-server (for qrm-related protocols); if the name field can't be // guaranteed to be unique in some cases, we can relay on this annotation to get unique keys // (to replace with the default name) ResourceAnnotationKeyResourceIdentifier = "katalyst.kubewharf.io/resource_identifier" // ResourceAnnotationKeyNICNetNSName nominated the key indicating net namespace name of the NIC ResourceAnnotationKeyNICNetNSName = "katalyst.kubewharf.io/netns_name" )
const variables for resource attributes of resources
const ( // WorkloadAnnotationSPDEnableKey provides a mechanism for white list when enabling spd, // if it's set as false, we should not maintain spd CR or calculate service profiling automatically. WorkloadAnnotationSPDEnableKey = "spd.katalyst.kubewharf.io/enable" WorkloadAnnotationSPDEnabled = "true" )
const variables for workload annotations about spd.
const ( // SPDAnnotationBaselineSentinelKey and SPDAnnotationExtendedBaselineSentinelKey is // updated by the SPD controller. It represents the sentinel pod among all pods managed // by this SPD. Agents or controllers can use this key to determine if a pod falls within // the baseline by comparing it with the pod's createTime and podName. SPDAnnotationBaselineSentinelKey = "spd.katalyst.kubewharf.io/baselineSentinel" SPDAnnotationExtendedBaselineSentinelKey = "spd.katalyst.kubewharf.io/extendedBaselineSentinel" // SPDAnnotationKeyCustomCompareKey holds annotation for spd baseline compare key SPDAnnotationKeyCustomCompareKey = "spd.katalyst.kubewharf.io/customCompareKey" SPDBaselinePercentMax = 100 SPDBaselinePercentMin = 0 )
const variables for spd.
const ( SPDAggMetricNameMultiDimCpuUsagePeak = "cpu_usage_peak" SPDAggMetricNameMultiDimCpuSimd = "cpu_simd" SPDAggMetricNameMultiDimCpuScalar = "cpu_scalar" SPDAggMetricNameMultiDimCpuBranch = "cpu_branch" SPDAggMetricNameMultiDimMbwUsagePerLimitPeak = "mbw_usage_peak" SPDAggMetricNameMultiDimMemBw = "mem_bw" SPDAggMetricNameMultiDimMemLat = "mem_lat" SPDAggMetricNameMultiDimMemL3Pki = "mem_l3pki" SPDAggMetricNameMultiDimDiskBw = "disk_bw" SPDAggMetricNameMultiDimNetBw = "net_bw" SPDAggMetricNameMultiDimPower = "power" )
The fields below are multi-dim fields, mainly used to represent fine-grained resource portraits of some head services.
const ( // WorkloadAnnotationVPAEnabledKey disables for workload means that // we won't apply the recommended resources for pod belonging to this workload; // However, we may still do this calculation logic and update to status if vpa // CR is created for this workload WorkloadAnnotationVPAEnabledKey = "vpa.katalyst.kubewharf.io/enable" WorkloadAnnotationVPAEnabled = "true" WorkloadAnnotationVPANameKey = "vpa.katalyst.kubewharf.io/name" // WorkloadAnnotationVPASelectorKey is pod label selector for non-native workload WorkloadAnnotationVPASelectorKey = "vpa.katalyst.kubewharf.io/selector" )
const variables for workload annotations about vpa.
const ( VPAAnnotationVPARecNameKey = "vpa.katalyst.kubewharf.io/recName" VPAAnnotationWorkloadRetentionPolicyKey = "vpa.katalyst.kubewharf.io/retentionPolicy" VPAAnnotationWorkloadRetentionPolicyRetain = "retain" VPAAnnotationWorkloadRetentionPolicyDelete = "delete" )
const variables for workload annotations about vpaRec.
const ( // PodAnnotationContainerCPUIdleRateKey is a const variable for pod annotation about per-container cpu idle rate. // // The annotation value is expected to be a JSON object encoded from ContainerCPUIdleRateConfig. // Each per-container value is a percentage in the inclusive range [0, 100]. // // For example: // { // "testContainer": 50 // } PodAnnotationContainerCPUIdleRateKey = "katalyst.kubewharf.io/container_cpu_idle_rate" )
const (
PodAnnotationGPUSelectionResultKey = "katalyst.kubewharf.io/gpu_selection_result"
)
PodAnnotationGPUSelectionResultKey is a const variable for pod annotation about a gpu selection result.
const (
PodAnnotationNICSelectionResultKey = "katalyst.kubewharf.io/nic_selection_result"
)
PodAnnotationNICSelectionResultKey is a const variable for pod annotation about a nic selection result.
const (
PodAnnotationNUMABindResultKey = "katalyst.kubewharf.io/numa_bind_result"
)
PodAnnotationNUMABindResultKey is a const variable for pod annotation about numa bind result.
const (
PodAnnotationNetClassKey = "katalyst.kubewharf.io/net_class_id"
)
PodAnnotationNetClassKey is a const variable for pod annotation about net class.
const (
// PodAnnotationPodEvictScoreKey is a const variable for pod annotation about enable get eviction score from pod
PodAnnotationPodEvictScoreKey = "katalyst.kubewharf.io/pod_evict_score"
)
const (
PodAnnotationResourcePackageKey = "katalyst.kubewharf.io/resource_package"
)
PodAnnotationResourcePackageKey is a const variable for pod annotation about resource package name
const (
// PodAnnotationResourcePoolKey is a const variable for pod annotation about resource pool name
PodAnnotationResourcePoolKey = "katalyst.kubewharf.io/resource_pool"
)
const ( // PodAnnotationSPDNameKey is used to maintain corresponding spdName in pod // annotation to make metaServer to target its spd more conveniently. PodAnnotationSPDNameKey = "spd.katalyst.kubewharf.io/name" )
const (
// PodAnnotationSoftEvictNotificationKey is a const variable for pod annotation about enable eviction notification
PodAnnotationSoftEvictNotificationKey = "katalyst.kubewharf.io/pod_soft_evict_notify"
)
const (
PodAnnotationSriovVFResultKey = "katalyst.kubewharf.io/sriov_vf_result"
)
PodAnnotationSriovVFResultKey is a const variable for pod annotation about sriov vf result.
const (
ResourcePower v1.ResourceName = "resource.katalyst.kubewharf.io/power"
)
const variables for resource names of heterogeneous resource
const (
// SPDAggMetricNameMemoryBandwidth is per core memory bandwidth
SPDAggMetricNameMemoryBandwidth = "memory_bandwidth"
)
metric names for aggregate metric
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerCPUIdleRateConfig ¶ added in v0.5.16
ContainerCPUIdleRateConfig defines the annotation value schema for PodAnnotationContainerCPUIdleRateKey.
The key is the container name, and the value is the target CPU idle rate percentage for that container in the inclusive range [0, 100].
For example:
{
"testContainer": 50
}
type KCNRAnnotationCPUManagerPolicy ¶ added in v0.5.0
type KCNRAnnotationCPUManagerPolicy string
type KCNRAnnotationMemoryManagerPolicy ¶ added in v0.5.0
type KCNRAnnotationMemoryManagerPolicy string
type QRMPhase ¶ added in v0.4.0
type QRMPhase int
QRMPhase is the phase of each rpc call in qrm plugin
type ResourcePluginPolicyName ¶ added in v0.4.0
type ResourcePluginPolicyName string
ResourcePluginPolicyName is a string type for QosResourceManager plugin policy
const ( // ResourcePluginPolicyNameDynamic is the name of the dynamic policy. ResourcePluginPolicyNameDynamic ResourcePluginPolicyName = "dynamic" // ResourcePluginPolicyNameNative is the name of the native policy. ResourcePluginPolicyNameNative ResourcePluginPolicyName = "native" // ResourcePluginPolicyNameStatic is the name of the static policy. ResourcePluginPolicyNameStatic ResourcePluginPolicyName = "static" )
const variables for QRM plugin policy name