Skip to content

A k8s custom scheduler that distributes pods as evenly as possible based on pod numbers

Notifications You must be signed in to change notification settings

LHB6540/NumberOffsetScheduler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is a custom scheduler for k8s. Its purpose is to allow statefulset pods to be deployed on optional nodes in a rolling manner according to their numbers, and to avoid pods with consecutive numbers from appearing on the same node. This is very useful for scenarios where business loads gradually reach pods according to pod numbers, such as game services corresponding to pod numbers.

deploy

The corresponding version products have been published to Docker Hub. You only need to execute the following command in the cluster to complete the deployment.

kubectl apply -f deploy/number-offset-scheduler.yaml

development

The core logic is the scoring logic in pkg/scheduler.go. If you need to further modify the existing logic, you can execute

git clone <repo>
# add your code
go mod tidy
docker build -t number-offset-scheduler:latest  -f Dockerfile .

Compatibility

Scheduler Configuration is now stable in version 1.25. Tests have been run on versions 1.25 and 1.31.

Reference Documents

About

A k8s custom scheduler that distributes pods as evenly as possible based on pod numbers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages