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

ktunnel expose does not allow for custom request/limits #118

Open
stekole opened this issue Oct 19, 2023 · 2 comments
Open

ktunnel expose does not allow for custom request/limits #118

stekole opened this issue Oct 19, 2023 · 2 comments

Comments

@stekole
Copy link

stekole commented Oct 19, 2023

When looking at requests and limits for the expose pod, it gives a non-int value and does not look to be configuable.

Using a kubectl describe pod podname gives the following values:

    Limits:
      cpu:     1
      memory:  1e9
    Requests:
      cpu:        500e-3
      memory:     100e6
    Environment:  <none>

I cannot see anywhere in the code for expose to change these values, however it exists for inject. #19

Is there anyway this could be used? It would be great to be able to change these values

Thank you

@jiehanzheng
Copy link

jiehanzheng commented Jan 4, 2024

The code is here:

ktunnel/pkg/k8s/common.go

Lines 127 to 130 in e05cea9

cpuRequest.SetMilli(int64(500))
cpuLimit.SetMilli(int64(1000))
memRequest.SetScaled(int64(100), resource.Mega)
memLimit.SetScaled(int64(1), resource.Giga)

#19/#20 did address the resource request and limits for inject but since it's written inside the newContainer routine, it applies to expose as well.

I'm not well-versed enough in Go to quickly make this configurable from the CLI, but I made this hardcoded change to reduce the CPU request:
jiehanzheng@2c5a30c

@mindovermiles262
Copy link
Contributor

@jiehanzheng have these request/limits been working OK for you? I'm facing the same issue here. I might take a crack at trying to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants