Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rothgar/bashscheduler
Kubernetes scheduler written in less than 100 lines of bash :grimacing: :laughing:
https://github.com/rothgar/bashscheduler
kubernetes
Last synced: 3 months ago
JSON representation
Kubernetes scheduler written in less than 100 lines of bash :grimacing: :laughing:
- Host: GitHub
- URL: https://github.com/rothgar/bashscheduler
- Owner: rothgar
- Created: 2016-07-28T19:49:16.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2023-02-10T04:40:47.000Z (almost 2 years ago)
- Last Synced: 2024-06-10T02:35:57.046Z (7 months ago)
- Topics: kubernetes
- Language: Shell
- Homepage:
- Size: 120 KB
- Stars: 183
- Watchers: 5
- Forks: 18
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![](img/banner.png)
Kubernetes bash scheduler
============### This is a really bad idea
I made it because it was helpful for me to learn :bowtie:
I hope you learn something too.## How to run it
Please don't ever use this on a production kubernetes cluster!!!
Run it against a local [kind](https://kind.sigs.k8s.io/) cluster.
```
kind create cluster
```Create pods that use the custom scheduler.
```
kubectl apply -f https://raw.githubusercontent.com/rothgar/bashScheduler/main/nginx.deploy.yaml
```You should see nginx pods with Pending status
```
NAME READY STATUS RESTARTS AGE
nginx-56dcc974bc-8ss4m 0/1 Pending 0 49m
nginx-56dcc974bc-94ltw 0/1 Pending 0 49m
nginx-56dcc974bc-tnz6s 0/1 Pending 0 49m
```Then proxy your localhost to the kubernetes api server
```
kubectl proxy
Starting to serve on 127.0.0.1:8001
```Now in a new terminal run
```
curl -sL https://raw.githubusercontent.com/rothgar/bashScheduler/main/scheduler.sh | bash
```You should see similar output to
```
Assigned nginx-56dcc974bc-8ss4m to kind-control-plane
Assigned nginx-56dcc974bc-94ltw to kind-control-plane
Assigned nginx-56dcc974bc-tnz6s to kind-control-plane
```Look at the code and see what it's doing.
Uncomment `set -x` to see all the commands run.Have fun :shipit: