-
Notifications
You must be signed in to change notification settings - Fork 771
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
Support for cpu_shares #267
Comments
It would be great to have support for mem_limit which should translate to a pod's spec like - spec:
containers:
- image: nginx
imagePullPolicy: Always
name: nginx
resources:
limits:
memory: 200Mi
terminationMessagePath: /dev/termination-log
volumeMounts: @kadel imo, mem_limit can be mapped directly, not sure about cpu_shares. |
@containscafeine 👍 |
I'll start working on this. I'll assign myself to this issue! |
Assigning to @containscafeine instead. |
Sigh, okay, so taking a look at the web:
image: tuna/docker-counter23
ports:
- "5000:5000"
links:
- redis
mem_limit: 500m i.e., has a non integer value, then, ERRO[0000] Could not parse config for project tmp : strconv.ParseInt: parsing "500m": invalid syntax
FATA[0000] Failed to load compose file: strconv.ParseInt: parsing "500m": invalid syntax Tracking this down further, this is a libcompose issue and ERRO[0000] Failed to unmarshall: strconv.ParseInt: parsing "500m": invalid syntax
web:
image: tuna/docker-counter23
links:
- redis
mem_limit: 500m
ports:
- 5000:5000
ERRO[0000] Could not parse config for project tmp : strconv.ParseInt: parsing "500m": invalid syntax
FATA[0000] Failed to read project: strconv.ParseInt: parsing "500m": invalid syntax However, trying So, for this to work fine, libcompose version has to be bumped, which is being tracked at #374 |
@containscafeine can you test it with #356? |
@cdrage just tried this with #356, and mem_limit fails. This is fixed in the latest release of |
This commit adds mem_limit support. Taking the value from docker-compose.yaml and converting it to it's associative value in Kubernetes artifacts. Closes (half) of kubernetes#267
This commit adds mem_limit support. Taking the value from docker-compose.yaml and converting it to it's associative value in Kubernetes artifacts. Closes (half) of kubernetes#267
This commit adds mem_limit support. Taking the value from docker-compose.yaml and converting it to it's associative value in Kubernetes artifacts. Closes (half) of kubernetes#267
@surajnarwade cpu_shares is still an issue. So let's leave this open. |
@cdrage oh my bad, got it |
@cdrage |
@cdrage @surajnarwade we can officially declare that we don't support
TLDR: this is not easy to map to k8s cpu resources. more info about cpu shares: https://docs.docker.com/engine/admin/resource_constraints/#cpu |
So the PR that closes this issue should remove all the code which tries to read this info from docker compose file and adds it to |
@surajssd Adding this to unsupportedkeys sounds like the best viable option considering the complexity of implementing cpu_shares. I agree. |
Resolves kubernetes#272 and kubernetes#267 As there is no direct mapping of `cpushares` and `cpuset` to kubernetes, it should not be read and should be moved to unsupported keys.
Resolves kubernetes#272 and kubernetes#267 As there is no direct mapping of `cpushares` and `cpuset` to kubernetes, it should not be read and should be moved to unsupported keys.
Resolves kubernetes#272 and kubernetes#267 As there is no direct mapping of `cpushares` and `cpuset` to kubernetes, it should not be read and should be moved to unsupported keys.
we can close this now |
Hope not to be pedantic here, but I think for |
@gitlawr , but there is no direct mapping for |
@surajnarwade For example,setting cpu resource such as:
Then the container will be run with CpuShares==102(which is 0.1*1024) and CpuQuota=50000(which is half of CpuPeriod given CpuPeriod= 100000). Is it kind of direct mapping I think? |
It would be nice to have resources limits for cpu_shares and mem_limits.
The text was updated successfully, but these errors were encountered: