Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2fac9b
chore(ci): add inlinecheck
gary-lgy Dec 10, 2024
574c6b0
add nic selection result pod annotation
luomingmeng Jan 16, 2025
4a00c19
add cpu total and cpu usage metric for kcmas
sun-yuliang Mar 21, 2025
006a74a
add memory bandwidth related metric
XudongLiuHarold May 21, 2025
3be93c7
fix(npd): fix resource name of npd to its plural form
Bourbon-Wang May 28, 2025
8b09775
feat(utils): add eviction utility functions for condition effects
luomingmeng Jun 6, 2025
663f8f8
fix(config): make EnabledStrategies field optional in StrategyGroupSt…
luomingmeng Jul 21, 2025
74d17d3
feat(consts): update cpu enhancement annotations and comments
luomingmeng Jul 30, 2025
8035e1a
feat(evictionplugin): add candidate pods and eviction records to API
luomingmeng Aug 5, 2025
4b8c5c5
feat(evictionplugin): add active pods to ThresholdMet request
luomingmeng Aug 6, 2025
d669ffd
add numa level cpu/memory related metric
yadzhang Sep 17, 2025
8ebb9a9
chore(*): add config for headroom
cheney-lin Oct 13, 2025
a21b699
add CustomMetricNodeMemoryTotal
sxy390 Oct 15, 2025
4d28b35
feat(*): support disable xps conf
JulyWindK Nov 6, 2025
12bfe96
feat(aqc): add numa level reclaim reserve config
lihonghao314 Sep 2, 2025
9f43f44
feat(*): add L3CacheGroup topology type
JulyWindK Jul 16, 2025
d26e9cc
feat(*): add numa sys cpu pressure eviction conf
JulyWindK Nov 5, 2025
96158e0
feat(*): support static configuration of normal throughput nics
JulyWindK Nov 24, 2025
05cbff7
chore(*): append memory eviction config
JulyWindK Nov 20, 2025
b69b3ab
feat(api): add dedicated QoS region type and mark dedicated-numa-excl…
luomingmeng Sep 24, 2025
5f6e7d7
feat: add annotation keys for cpu burst
JustinChengLZ Nov 6, 2025
e86badd
feat(cpu): add fine-grained resource config in AdminQoSConfiguration …
JustinChengLZ Nov 12, 2025
ee73c3b
feat(cpu): add a new cpu burst policy closed
JustinChengLZ Nov 21, 2025
5e2cb77
fix: change none policy to default
JustinChengLZ Dec 29, 2025
70d7194
fix(aqc): generate new aqc crd
JustinChengLZ Jan 8, 2026
bbf0869
chore(*): add qrm conf to aqc
JulyWindK Jan 8, 2026
df871f1
feat(types): add attributes field to ResourcePackage and ResourcePool
luomingmeng Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ jobs:
run: |
make fmt && git add pkg &&
git diff --cached --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
- name: Check inline fields
run: |
go run cmd/inlinecheck/main.go
106 changes: 106 additions & 0 deletions cmd/inlinecheck/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package main

import (
"fmt"
"os"
"reflect"
"strings"

autoscalingv1a1 "github.com/kubewharf/katalyst-api/pkg/apis/autoscaling/v1alpha1"
autoscalingv1a2 "github.com/kubewharf/katalyst-api/pkg/apis/autoscaling/v1alpha2"
configv1a1 "github.com/kubewharf/katalyst-api/pkg/apis/config/v1alpha1"
nodev1a1 "github.com/kubewharf/katalyst-api/pkg/apis/node/v1alpha1"
overcommitv1a1 "github.com/kubewharf/katalyst-api/pkg/apis/overcommit/v1alpha1"
recommendationv1a1 "github.com/kubewharf/katalyst-api/pkg/apis/recommendation/v1alpha1"
schedcfgv1b3 "github.com/kubewharf/katalyst-api/pkg/apis/scheduling/config/v1beta3"
tidev1a1 "github.com/kubewharf/katalyst-api/pkg/apis/tide/v1alpha1"
workloadv1a1 "github.com/kubewharf/katalyst-api/pkg/apis/workload/v1alpha1"

"k8s.io/apimachinery/pkg/runtime"
)

func main() {
scheme := runtime.NewScheme()
configv1a1.AddToScheme(scheme)
autoscalingv1a1.AddToScheme(scheme)
autoscalingv1a2.AddToScheme(scheme)
nodev1a1.AddToScheme(scheme)
overcommitv1a1.AddToScheme(scheme)
recommendationv1a1.AddToScheme(scheme)
schedcfgv1b3.AddToScheme(scheme)
tidev1a1.AddToScheme(scheme)
workloadv1a1.AddToScheme(scheme)

seenTypes := make(map[reflect.Type]struct{})
var errs []error
for _, typ := range scheme.AllKnownTypes() {
fmt.Printf("Checking %s.%s\n", typ.PkgPath(), typ.Name())
checkType(typ, typ.Name(), seenTypes, &errs)
}

for _, err := range errs {
fmt.Println(err)
}

if len(errs) > 0 {
os.Exit(1)
}
}

func parseTag(tag string) (name string) {
if idx := strings.Index(tag, ","); idx != -1 {
return tag[:idx]
} else {
return tag
}
}

// typ must be a struct type
func checkType(typ reflect.Type, path string, seenTypes map[reflect.Type]struct{}, errs *[]error) {
if _, ok := seenTypes[typ]; ok {
return
}

for i := 0; i < typ.NumField(); i++ {
field := typ.Field(i)
if !field.IsExported() {
continue
}
fieldTyp := field.Type
origFieldTyp := fieldTyp

if fieldTyp.Kind() == reflect.Ptr ||
fieldTyp.Kind() == reflect.Slice ||
fieldTyp.Kind() == reflect.Array ||
fieldTyp.Kind() == reflect.Map {
fieldTyp = fieldTyp.Elem()
}
if fieldTyp.Kind() != reflect.Struct {
continue
}

var newPath string
switch origFieldTyp.Kind() {
case reflect.Struct, reflect.Ptr:
newPath = fmt.Sprintf("%s.%s", path, field.Name)
case reflect.Array, reflect.Slice:
newPath = fmt.Sprintf("%s.%s[0]", path, field.Name)
case reflect.Map:
newPath = fmt.Sprintf("%s.%s[*]", path, field.Name)
default:
continue
}

tag := field.Tag.Get("json")
name := parseTag(tag)
if name == "" && !field.Anonymous {
*errs = append(
*errs,
fmt.Errorf("field %s has no json tag and is not embedded, will cause unpredictable deserialization", newPath),
)
}
checkType(fieldTyp, newPath, seenTypes, errs)
}

seenTypes[typ] = struct{}{}
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,58 @@ spec:
minimum: 0
type: number
type: object
numaSysCPUPressureEvictionConfig:
description: NumaSysCPUPressureEvictionConfig holds configurations
for NUMA-level system CPU pressure eviction.
properties:
enableEviction:
description: EnableEviction indicates whether to enable
NUMA-level system CPU pressure eviction.
type: boolean
gracePeriod:
description: |-
GracePeriod is the grace period (in seconds) after a pod starts before it can be considered for eviction
due to NUMA system CPU pressure. 0 means no grace period.
format: int64
type: integer
metricRingSize:
description: MetricRingSize is the size of the metric
ring buffer for calculating NUMA system CPU pressure.
type: integer
numaCPUUsageHardThreshold:
description: NumaCPUUsageHardThreshold is the hard
threshold for NUMA system CPU pressure.
type: number
numaCPUUsageSoftThreshold:
description: NumaCPUUsageSoftThreshold is the soft
threshold for NUMA system CPU pressure.
type: number
numaSysOverTotalUsageEvictionThreshold:
description: NUMASysOverTotalUsageEvictionThreshold
is the eviction threshold for NUMA system CPU pressure
over total system CPU pressure.
type: number
numaSysOverTotalUsageHardThreshold:
description: NUMASysOverTotalUsageHardThreshold is
the hard threshold for NUMA system CPU pressure
over total system CPU pressure.
type: number
numaSysOverTotalUsageSoftThreshold:
description: NUMASysOverTotalUsageSoftThreshold is
the soft threshold for NUMA system CPU pressure
over total system CPU pressure.
type: number
syncPeriod:
description: SyncPeriod is the sync period (in seconds)
for updating NUMA system CPU pressure metrics.
format: int64
type: integer
thresholdMetPercentage:
description: |-
ThresholdMetPercentage is the percentage of time the NUMA's system CPU pressure
must be above the threshold for an eviction to be triggered.
type: number
type: object
type: object
cpuSystemPressureEvictionConfig:
description: CPUSystemPressureEvictionConfig is the config
Expand Down Expand Up @@ -384,6 +436,14 @@ spec:
description: EnableSystemLevelEviction is whether to enable
system-level eviction
type: boolean
evictNonReclaimedAnnotationSelector:
description: EvictNonReclaimedAnnotationSelector is a
non-reclaimed pod eviction anno selector
type: string
evictNonReclaimedLabelSelector:
description: EvictNonReclaimedLabelSelector is a non-reclaimed
pod eviction label selector
type: string
gracePeriod:
description: GracePeriod is the grace period of memory
pressure eviction
Expand All @@ -405,12 +465,24 @@ spec:
type: string
minItems: 1
type: array
numaFreeBelowWatermarkTimesReclaimedThreshold:
description: |-
NumaFreeBelowWatermarkTimesReclaimedThreshold is the threshold for the number of
times NUMA's free memory of the reclaimed instance falls below the watermark
minimum: 0
type: integer
numaFreeBelowWatermarkTimesThreshold:
description: |-
NumaFreeBelowWatermarkTimesThreshold is the threshold for the number of
times NUMA's free memory falls below the watermark
minimum: 0
type: integer
numaFreeConstraintFastEvictionWaitCycle:
description: NumaFreeConstraintFastEvictionWaitCycle is
the wait cycle for fast eviction when numa memory is
extremely tight
minimum: 0
type: integer
numaVictimMinimumUtilizationThreshold:
description: |-
NumaVictimMinimumUtilizationThreshold is the victim's minimum memory usage on a NUMA node, if a pod
Expand Down Expand Up @@ -641,6 +713,42 @@ spec:
type: number
type: object
type: object
fineGrainedResourceConfig:
description: FineGrainedResourceConfig is a configuration for
more fine-grained resource control
properties:
cpuBurstConfig:
description: CPUBurstConfig has cpu burst related configurations
properties:
defaultCPUBurstPercent:
description: DefaultCPUBurstPercent is the default cpu
burst percent to be set for pods with dedicated cores.
format: int64
maximum: 100
minimum: 0
type: integer
enableDedicatedCoresDefaultCPUBurst:
description: |-
EnableDedicatedCoresDefaultCPUBurst indicates whether cpu burst should be enabled by default for pods with dedicated cores.
If set to true, it means that cpu burst should be enabled by default for pods with dedicated cores (cpu burst value is calculated and set).
If set to false, it means that cpu burst should be disabled for pods with dedicated cores (cpu burst value is set to 0).
If set to nil, it means that no operation is done on the cpu burst value.
type: boolean
type: object
type: object
qrmPluginConfig:
description: QRMPluginConfig is a configuration for qrm plugin
properties:
cpuPluginConfig:
description: CPUPluginConfig is the config for cpu plugin
properties:
preferUseExistNUMAHintResult:
description: |-
PreferUseExistNUMAHintResult prefer to use existing numa hint results
The calculation results may originate from upstream components and be recorded in the pod annotation
type: boolean
type: object
type: object
reclaimedResourceConfig:
description: ReclaimedResourceConfig is a configuration for reclaim
resource
Expand Down Expand Up @@ -676,6 +784,18 @@ spec:
maximum: 1
minimum: 0
type: number
nonReclaimUtilizationHigh:
description: NonReclaimUtilizationHigh is the high
CPU utilization threshold
maximum: 1
minimum: 0
type: number
nonReclaimUtilizationLow:
description: NonReclaimUtilizationLow is the low CPU
utilization threshold
maximum: 1
minimum: 0
type: number
targetReclaimedCoreUtilization:
description: |-
TargetReclaimedCoreUtilization is the target reclaimed core utilization to be used for
Expand Down Expand Up @@ -776,6 +896,30 @@ spec:
MinReclaimedResourceForReport.
For example, {"cpu": 4, "memory": 5Gi}.
type: object
numaMinReclaimedResourceForAllocate:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: |-
NumaMinReclaimedResourceForAllocate is a resource reserved at numa level for reclaimed_cores pods,these resources will not be used
by shared_cores pods.
For example, {"cpu": 2, "memory": 0Gi}.
type: object
numaMinReclaimedResourceRatioForAllocate:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: |-
NumaMinReclaimedResourceRatioForAllocate is a resource reserved ratio at numa level for reclaimed_cores pods,these resources will not be used
by shared_cores pods.
For example, {"cpu": 0.1, "memory": 0.2}.
type: object
reservedResourceForAllocate:
additionalProperties:
anyOf:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ spec:
maximum: 100
minimum: 0
type: integer
disableXPS:
description: DisableXPS indicates whether to disable the XPS function.
type: boolean
enableRPS:
description: |-
EnableRPS indicates whether to enable the RPS function.
Expand Down Expand Up @@ -266,6 +269,12 @@ spec:
NICAffinityPolicy represents the NICs's irqs affinity sockets policy.
One of CompleteMap, OverallBalance, PhysicalTopo.
type: string
normalThroughputNics:
description: NormalThroughputNics describes static configured
normal throughput Nics.
items:
type: string
type: array
reniceKsoftirqd:
description: ReniceKsoftirqd indicates whether to renice ksoftirqd
process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,6 @@ spec:
this config.
format: int32
type: integer
required:
- enabledStrategies
type: object
type: object
served: true
Expand Down
Loading