-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Describe how to set qp resources #5617
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,48 @@ spec: | |
cpu: 1 | ||
``` | ||
|
||
## Additional resources | ||
## Configure Queue Proxy resources | ||
|
||
In order to set the Queue Proxy resource requests and limits you can either | ||
set them globally in the [deployment config map](../configuration/deployment.md) or you can set them at the service level using the corresponding annotations targeting cpu, memory and ephemeral-storage resource types. The above example becomes: | ||
|
||
```yaml | ||
apiVersion: serving.knative.dev/v1 | ||
kind: Service | ||
metadata: | ||
name: example-service | ||
namespace: default | ||
annotations: | ||
queue.sidecar.serving.knative.dev/cpu-resource-request: "1" | ||
queue.sidecar.serving.knative.dev/cpu-resource-limit: "2" | ||
queue.sidecar.serving.knative.dev/memory-resource-request: "1Gi" | ||
queue.sidecar.serving.knative.dev/memory-resource-limit: "2Gi" | ||
queue.sidecar.serving.knative.dev/ephemeral-storage-resource-request: "400Mi" | ||
queue.sidecar.serving.knative.dev/ephemeral-storage-resource-limit: "450Mi" | ||
spec: | ||
template: | ||
spec: | ||
... | ||
``` | ||
|
||
Alternatively, you could use a special annotation `queue.sidecar.serving.knative.dev/resource-percentage` that calculates the Queue Proxy resources as a percentage of the application's container. | ||
In this case there are min, max boundaries applied to the cpu and memory resource requirements: | ||
|
||
|
||
| Resource Requirements | Min | Max | | ||
|-------------------------------------------|---------|---------| | ||
| Cpu Request | 25m | 100m | | ||
| Cpu Limit | 40m | 500m | | ||
| Memory Request | 50Mi | 200Mi | | ||
| Memory Limit | 200Mi | 500Mi | | ||
|
||
|
||
!!! note | ||
If the user simultaneously sets a percentage annotation and a specific resource value via the corresponding resource annotation then the latter takes precedence. | ||
|
||
!!! warning | ||
The `queue.sidecar.serving.knative.dev/resource-percentage` annotation is now deprecated and will be removed in future versions. | ||
|
||
### Additional resources | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if that belongs to that level. I moved it on down to align with the change. |
||
|
||
* For more information requests and limits for Kubernetes resources, see [Managing Resources for Containers](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to mention about ephemeral-storage's boundaries (I guess no boundaries?) here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no boundaries afaik.