Skip to content

Commit

Permalink
add inter-pod affinity & anti-affinity
Browse files Browse the repository at this point in the history
  • Loading branch information
yanxiaoqi932 committed Nov 7, 2023
1 parent 8573a6f commit 9233b1d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions pkg/consts/qos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

0 comments on commit 9233b1d

Please sign in to comment.