• Stars
    star
    174
  • Rank 214,682 (Top 5 %)
  • Language
    Shell
  • Created almost 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Kubernetes scheduler written in less than 100 lines of bash 😬 πŸ˜†

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 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:

More Repositories

1

awesome-tuis

List of projects that provide terminal user interfaces
6,494
star
2

awesome-tmux

A list of awesome resources for tmux
6,123
star
3

mastering-zsh

Advanced topics to take advantage of zsh πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»
1,220
star
4

static-mastodon

Mastodon server with static files. Search for user `@[email protected]`
71
star
5

rpi-wordpress

Easy way to run wordpress on a Raspberry Pi with Docker 🐳
Shell
45
star
6

ergodox-ez-tent-kit

A custom tent kit for the ergodox ez ⌨️
35
star
7

k

Experimental wrapper for kubectl
Go
24
star
8

k8s-random-deploys

Deploy example workloads with random requests and limits
Shell
23
star
9

rothgar

Public info for media and public speaking
22
star
10

game-streaming-on-kubernetes

Streaming games from a Kubernetes cluster with Sunshine
22
star
11

ansible-workstation

ansible playbook for setting up a Fedora desktop or laptop
Shell
22
star
12

track-your-resume-in-git

An example repo to track your resume and application history using git
Just
20
star
13

docker-hubot

Docker container for running hubot in a container.
Shell
17
star
14

name-badge

Code for ATTiny85 on name badges
C++
16
star
15

local-llm-messenger

Local LLM Messenger (lollmm) is a way to send iMessages to the AI that runs in your computer.
Python
15
star
16

ansible-tomcat

Deploy Java and Tomcat with Ansible
Shell
14
star
17

bashchain

A blockchain written in bash
Shell
11
star
18

zsh-emoji-aliases

Slack style shell aliases for emoji ❀️
Shell
11
star
19

paperclub

History of recorded twitter spaces discussing whitepapers
8
star
20

docker-tvheadend

Docker container for Tvheadend service and additional drivers/apps
PHP
8
star
21

spacey

Twitter spaces search CLI client
Go
7
star
22

grafana-seed

Seed grafana with datasources and dashboards easily
Shell
7
star
23

advanced-aws-cli-examples

A collection of advanced AWS CLI commands and queries
7
star
24

ansible-satellite-transition

Move nodes from one satellite/katello server to another
7
star
25

worthless

Repo metrics do not make your code valuable. Please ⭐ and 🍴
7
star
26

ansible-rsyslog

Configure rsyslog client and server
6
star
27

rpi-inadyn

Raspberry Pi container for running inadyn
5
star
28

docker-wemo

docker container for ouimeaux
3
star
29

docker-john

John the Ripper in a container
3
star
30

awesome-podcasts

List of notable technology-ish podcasts
2
star
31

code-server

Shell
2
star
32

msit570

Homework assignments for msit570 class
PHP
1
star
33

netdata-wiki

clone of netdata wiki for local changes
1
star
34

ansible-yum-security-updates

Automatically apply security updates to EPEL servers
1
star
35

pizza-as-code

Example ways to order pizza using infrastructure as code tools.
1
star
36

pbox

[WIP] Run a GUI application isolated in a VM
1
star
37

ec2-devbox

Create a development ec2 instance in AWS
HCL
1
star
38

spdash

System provisioning dashboard
Python
1
star
39

homebrew-tap

Personal formula for homebrew
Ruby
1
star
40

TTYbook

[WIP] Everything you need for text based productivity
1
star
41

docker-microbot

small container with simple webpage for clustering demo
Shell
1
star