Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set memory and cpu limit for kind create cluster #1422

Closed
soheilade opened this issue Mar 18, 2020 · 7 comments
Closed

set memory and cpu limit for kind create cluster #1422

soheilade opened this issue Mar 18, 2020 · 7 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@soheilade
Copy link

soheilade commented Mar 18, 2020

hi, I created a kind cluster, while describing the node, I see the following limit for default
Allocated resources:

(Total limits may be over 100 percent, i.e., overcommitted.)
 Resource           Requests    Limits
 --------           --------    ------
 cpu                850m (21%)  100m (2%)
 memory             190Mi (1%)  390Mi (2%)
 ephemeral-storage  0 (0%)      0 (0%)

however, I need to modify the amount of memory and cpu, any idea?
P.s. I am looking for something like this in minikube : minikube --memory 8192 --cpus 2 start

@soheilade soheilade added the kind/support Categorizes issue or PR as a support question. label Mar 18, 2020
@aojea
Copy link
Contributor

aojea commented Mar 18, 2020

Those are the allocated resources, if you scroll up in the output of the node description you can find the real limits that are the ones that you have on your host. The node inherits the host limits. This snippet is from my local machine that has 8 CPUs and 32G of RAM:

Addresses:
  InternalIP:  172.17.0.2
  Hostname:    kind-control-plane
Capacity:
  cpu:                8
  ephemeral-storage:  932095312Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             32918956Ki
  pods:               110
Allocatable:
  cpu:                8
  ephemeral-storage:  932095312Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             32918956Ki
  pods:               110

I guess that the minikube ones are because that's the memory and CPU assigned to the VM. You can create a VM with the memory and RAM predefined and run KIND inside if you want to limit its resources the same way

@soheilade
Copy link
Author

great, thanks alot :)

@bestofman
Copy link

Those are the allocated resources, if you scroll up in the output of the node description you can find the real limits that are the ones that you have on your host. The node inherits the host limits. This snippet is from my local machine that has 8 CPUs and 32G of RAM:

Addresses:
  InternalIP:  172.17.0.2
  Hostname:    kind-control-plane
Capacity:
  cpu:                8
  ephemeral-storage:  932095312Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             32918956Ki
  pods:               110
Allocatable:
  cpu:                8
  ephemeral-storage:  932095312Ki
  hugepages-1Gi:      0
  hugepages-2Mi:      0
  memory:             32918956Ki
  pods:               110

I guess that the minikube ones are because that's the memory and CPU assigned to the VM. You can create a VM with the memory and RAM predefined and run KIND inside if you want to limit its resources the same way

So what is the equivalent command for minikube --memory 8192 --cpus 2 start or a config.yaml file while creating a cluster to specify more memory and cpu numbers?

I have tried to deploy Cassandra on my Kind cluster but it is stuck on STATUS: pending and I think it's because of the lack of the execution of the command I mentioned above.

@stmcginnis
Copy link
Contributor

stmcginnis commented Dec 30, 2022

There is no equivalent as that's not how kind works.

You can create a VM with the memory and RAM predefined and run KIND inside if you want to limit its resources the same way

@mujiannan
Copy link

docker update --cpus=16 -m 30g --memory-swap -1 kind-control-plane
kind-control-plane

I can limit the container. But this didn't change the display on k8s-dashboard, and I don't know what will happen if the cluster reach my limit on its container.
I'm sure it won't break the host machine.

@franpog859
Copy link

There is no equivalent as that's not how kind works.

You can create a VM with the memory and RAM predefined and run KIND inside if you want to limit its resources the same way

Do you have any workaround for that?

@BenTheElder
Copy link
Member

#1963, no really great options yet. There's some early discussions of revisiting being able to tell Kubelet/cadvisor a different CPU/memory limit but nothing we can act on yet. Even that would only be a partial answer.

If you need functioning resource limits, you should use a VM or machine based solution for now unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

7 participants