https://github.com/coryodaniel/k8s-elixir-schedulers
This is an example app used to illustrate how online schedulers are configured post OTP23 running in kubernetes.
https://github.com/coryodaniel/k8s-elixir-schedulers
Last synced: over 1 year ago
JSON representation
This is an example app used to illustrate how online schedulers are configured post OTP23 running in kubernetes.
- Host: GitHub
- URL: https://github.com/coryodaniel/k8s-elixir-schedulers
- Owner: coryodaniel
- Created: 2021-09-21T18:12:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-21T18:12:54.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T05:34:46.337Z (over 1 year ago)
- Language: Elixir
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Erlang Schedulers on Kubernetes
This is an example app used to illustrate how online schedulers are configured post OTP23 running in kubernetes. It expects at least 4 CPUs. If you don't have 4 CPUs available, change the `resources.limits.cpu` in `./k8s/pod.yaml`.
The application calculates primes, starting a task for each scheduler.
_This example is configured for running on docker for desktop using the local registry._
## Setup
1. Install docker-for-desktop 🙃
2. Run `make all`
## Running example
You'll need two terminals
1. Run `make top` in your first terminal. This will show you the current CPU usage of the container.
2. In a second terminal run `make shell`. This will open up a bash shell in the container.
3. Run `iex -S mix` in the container.
4. Run `K8sScheduler.run()`. If it returns too quickly, try: `K8sScheduler.run(1_000_000)`
5. Run Step #4 a number of times to saturate the available CPUs.
What you should see is the number of online schedulers is set to the `resources.limits.cpu`. As the CPUs are saturated, you should see mCPU amount rising in the first terminal.