/kube-arch-scheduler

An architecture-aware Kubernetes scheduler plugin

Primary LanguageGoApache License 2.0Apache-2.0

Kubernetes Architecture Scheduler Plugin

An image architecture aware Kubernetes scheduler plugin

kube-arch-scheduler is a kubernetes scheduler filter plugin that will filter nodes by the compatibility of the container image architectures (platforms) present in a Pod. It can also assign weight to each architecture, so that pods can prefer sitting on a specific one.

Deploy - Helm

helm repo add kube-arch-scheduler https://elementtech.github.io/kube-arch-scheduler/
helm repo update
helm install -n kube-system kube-arch-scheduler/kube-arch-scheduler

Core Values:

# While enabled, this will add the scheduler to the default scheduler plugins,
# this will make it affect all pods in the cluster.
addToDefaultScheduler: true

# If addToDefaultScheduler if false, this will be the name of the scheduler,
# and it will only affect pods with: [schedulerName: kube-arch-scheduler].
nonDefaultSchedulerName: kube-arch-scheduler

# This is relevant if your Kubernetes pod does not have permissions to your private registries.
# dockerconfig.json is a base64 encoded docker config file, it will be used
# to pull the image manifests. The pod needs to have the secret mounted at
# /root/.docker/config.json. This is only needed if you are using a private
# registry. If you are using a public registry, you can leave this empty.
dockerConfigSecretName: ""

# The weight of each architecture,
# if a pod can sit on both, it will prefer the one with the higher weight.
# The default weight of undefined architectures is 0, meaning none will have
# any particular preference.
weight:
  amd64: 0
  arm64: 0
  arm: 0
  ppc64le: 0
  s390x: 0
  riscv64: 0

Development

Use this command to run the scheduler locally while connected to your Kubernetes cluster's context:

go run main.go --authentication-kubeconfig ~/.kube/config --authorization-kubeconfig ~/.kube/config --config=./example/scheduler-config.yaml --v=2

You can use the example deployment in order to test the scheduler on a live pod:

kubectl deploy -f example/busybox.yaml

Support

Buy Me A Coffee