mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-19 00:31:00 +00:00
Set executor cpu resources to an integer to avoid rounding errors
This avoid that we either waste cpu resources due to rounding or that we report to much to the kubelet such that the e2e tests think they can schedule more than resources are available. This fixes https://github.com/mesosphere/kubernetes-mesos/issues/437
This commit is contained in:
parent
ae7830b4be
commit
1435077820
@ -145,6 +145,7 @@ scheduler:
|
||||
--mesos-master=mesosmaster1:5050
|
||||
--cluster-dns=10.10.10.10
|
||||
--cluster-domain=cluster.local
|
||||
--mesos-executor-cpus=1.0
|
||||
--v=4
|
||||
environment:
|
||||
- MESOS_DOCKER_ETCD_TIMEOUT
|
||||
|
@ -979,6 +979,7 @@ func nodeInfo(si *mesos.SlaveInfo, ei *mesos.ExecutorInfo) NodeInfo {
|
||||
case "cpus":
|
||||
// We intentionally take the floor of executorCPU because cores are integers
|
||||
// and we would loose a complete cpu here if the value is <1.
|
||||
// TODO(sttts): switch to float64 when "Machine Allocables" are implemented
|
||||
ni.Cores = int(r.GetScalar().GetValue() - float64(int(executorCPU)))
|
||||
case "mem":
|
||||
ni.Mem = int64(r.GetScalar().GetValue()-executorMem) * 1024 * 1024
|
||||
|
Loading…
Reference in New Issue
Block a user