kubesim icon indicating copy to clipboard operation
kubesim copied to clipboard

Use more generic interface to mock node resources

Open Jeffwan opened this issue 3 years ago • 4 comments

Currently, it only passes cpu and memory resources into cadvisor.Interface which is not enough to mock real world cases. https://github.com/volcano-sh/kubesim/blob/f4bd53f0b81c06f72466d981c5aabf11e044b8d1/pkg/mock/kubelet/cadvisor/testing/cadvisor_fake.go#L59-L60

We should extend this to a more generic way to better simulate production nodes

Jeffwan avatar Mar 13 '21 07:03 Jeffwan

/assign

Jeffwan avatar Mar 13 '21 07:03 Jeffwan

I will file an improvement PR later

Jeffwan avatar Mar 13 '21 07:03 Jeffwan

Thanks Jeffwan. The fack struct should be refactored to a generic way to support more types of resources.

william-wang avatar Mar 19 '21 01:03 william-wang

em. The most elegant way is to extend https://github.com/kubernetes/kubernetes/blob/5ab4b580de915cffd901c7a1304aca5fdcca88e7/pkg/kubelet/cm/container_manager_stub.go#L89-L91

However, this is a dependency that we can not easily bring back to kubesim. I filed an upstream PR https://github.com/kubernetes/kubernetes/pull/100267

Once it's merged, we can backport to kubesim and use it with node templates

Jeffwan avatar Mar 25 '21 17:03 Jeffwan