diff --git a/pkg/consts/qos.go b/pkg/consts/qos.go index 9204768..d1fc1c0 100644 --- a/pkg/consts/qos.go +++ b/pkg/consts/qos.go @@ -37,10 +37,6 @@ const ( PodAnnotationMemoryEnhancementNumaExclusive = "numa_exclusive" PodAnnotationMemoryEnhancementNumaExclusiveEnable = "true" - - PodAnnotationMicroTopologyInterPodAffinity = "katalyst.kubewharf.io/microtopology_affinity" - - PodAnnotationMicroTopologyInterPodAntiAffinity = "katalyst.kubewharf.io/microtopology_antiaffinity" ) // const variables for pod annotations about qos level enhancement in cpu @@ -65,3 +61,28 @@ const ( PodAnnotationNetworkEnhancementAffinityRestricted = "topology_affinity_restricted" PodAnnotationNetworkEnhancementAffinityRestrictedTrue = "true" ) + +// const variables for pod annotations about qos level enhancement for micro-topology level inter-pod affinity + +const ( + PodAnnotationMicroTopologyInterPodAffinity = "katalyst.kubewharf.io/microtopology_affinity" + PodAnnotationMicroTopologyInterPodAntiAffinity = "katalyst.kubewharf.io/microtopology_antiaffinity" + + PodAnnotationMicroTopologyRequiredAffinity = "required" + PodAnnotationMicroTopologyPreferredAffinity = "preferred" + + PodAnnotationMicroTopologyAffinityNUMA = "numa" + PodAnnotationMicroTopologyAffinitySocket = "socket" + + PodAnnotationMicroTopologyAffinityDefaultZone = "numa" +) + +// 解析后的inter-pod affinity annotations +type Selector struct { + MatchLabels map[string]string + Zone string +} +type MicroTopologyPodAffinityAnnotation struct { + Required []Selector + Preferred []Selector +}