An example of kubernetes scheduler extender
An example of kubernetes scheduler extender
This is an example of Kubernetes Scheduler Extender
$ git clone [email protected]:everpeace/k8s-scheduler-extender-example.git
$ cd k8s-scheduler-extender-example
$ git submodule update --init$ IMAGE=YOUR_ORG/YOUR_IMAGE:YOUR_TAG
$ docker build . -t "${IMAGE}"
$ docker push "${IMAGE}"my-scheduler in kube-system namespaceplease see ConfigMap in extender.yaml for scheduler policy json which includes scheduler extender config.
# bring up the kube-scheduler along with the extender image you've just built
$ sed 's/a\/b:c/'$(echo "${IMAGE}" | sed 's/\//\\\//')'/' extender.yaml | kubectl apply -f -For ease of observation, start streaming logs from the extender:
$ kubectl -n kube-system logs deploy/my-scheduler -c my-scheduler-extender-ctr -f
[ warn ] 2018/11/07 08:41:40 main.go:84: LOG_LEVEL="" is empty or invalid, fallling back to "INFO".
[ info ] 2018/11/07 08:41:40 main.go:98: Log level was set to INFO
[ info ] 2018/11/07 08:41:40 main.go:116: server starting on the port :80Open up an another termianl and proceed.
you will see test-pod will be scheduled by my-scheduler.
…Copyright 2018 Shingo Omura
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.No open issues yet, or sync has not completed.