Erlang honors cgroup CPU quota from Erlang 23. But when less than 1 CPU is used, schedulers_online will be cores number(see below k8s 0-5).
$ docker run --rm -it --cpu-period 100000 --cpu-quota 100000 erlang:23 bash
root@3f793576001a:/# erl
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:4:1] [ds:4:1:10] [async-threads:1] [hipe]
Eshell V11.0.2 (abort with ^G)
1> erlang:system_info(schedulers_online).
1
$ alias k=kubectl
$ k apply -f .
# Erlang 22
$ k exec -it erlang-22-cpu-demo-0-5 -- bash
root@erlang-22-cpu-demo-0-5:/# erl
Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V10.7.2.1 (abort with ^G)
1> erlang:system_info(schedulers_online).
2
k exec -it erlang-22-cpu-demo-1 -- bash
root@erlang-22-cpu-demo-1:/# erl
Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V10.7.2.1 (abort with ^G)
1> erlang:system_info(schedulers_online).
2
$ k exec -it erlang-22-cpu-demo-2 -- bash
root@erlang-22-cpu-demo-2:/# erl
Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V10.7.2.1 (abort with ^G)
1> erlang:system_info(schedulers_online).
2
# Erlang 23
$ k exec -it erlang-23-cpu-demo-0-5 -- bash
root@erlang-23-cpu-demo-0-5:/# erl
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V11.0.2 (abort with ^G)
1> erlang:system_info(schedulers_online).
2
k exec -it erlang-23-cpu-demo-1 -- bash
root@erlang-23-cpu-demo-1:/# erl
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:2:1] [ds:2:1:10] [async-threads:1] [hipe]
Eshell V11.0.2 (abort with ^G)
1> erlang:system_info(schedulers_online).
1
k exec -it erlang-23-cpu-demo-2 -- bash
root@erlang-23-cpu-demo-2:/# erl
Erlang/OTP 23 [erts-11.0.2] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]
Eshell V11.0.2 (abort with ^G)
1> erlang:system_info(schedulers_online).
2