|
1 | | -// This is meant to be inlined using the "include" directive in other pages. |
2 | | -// WARNING: do not add headers here as they can break the structure of pages |
3 | | -// that include this file. |
4 | | -Stackable operators handle resource requests in a slightly different manner than Kubernetes. |
5 | | -Resource requests are defined on xref:concepts:stacklet.adoc#roles[role] or xref:concepts:stacklet.adoc#role-groups[role group] level. |
6 | | -On a role level this means that by default, all workers will use the same resource requests and limits. |
7 | | -This can be further specified on role group level (which takes priority to the role level) to apply different resources. |
8 | | - |
9 | | -This is an example on how to specify CPU and memory resources using the Stackable https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/[Custom Resources{external-link-icon}^]: |
10 | | - |
11 | | -[source, yaml] |
12 | | ----- |
13 | | ---- |
14 | | -apiVersion: example.stackable.tech/v1alpha1 |
15 | | -kind: ExampleCluster |
16 | | -metadata: |
17 | | - name: example |
18 | | -spec: |
19 | | - workers: # role-level |
20 | | - config: |
21 | | - resources: |
22 | | - cpu: |
23 | | - min: 300m |
24 | | - max: 600m |
25 | | - memory: |
26 | | - limit: 3Gi |
27 | | - roleGroups: # role-group-level |
28 | | - resources-from-role: # role-group 1 |
29 | | - replicas: 1 |
30 | | - resources-from-role-group: # role-group 2 |
31 | | - replicas: 1 |
32 | | - config: |
33 | | - resources: |
34 | | - cpu: |
35 | | - min: 400m |
36 | | - max: 800m |
37 | | - memory: |
38 | | - limit: 4Gi |
39 | | ----- |
40 | | - |
41 | | -In this case, the role group `resources-from-role` will inherit the resources specified on the role level, resulting in a maximum of `3Gi` memory and `600m` CPU resources. |
42 | | - |
43 | | -The role group `resources-from-role-group` has a maximum of `4Gi` memory and `800m` CPU resources (which overrides the role CPU resources). |
44 | | - |
45 | | -IMPORTANT: For Java products the actual used heap memory is lower than the specified memory limit due to other processes in the Container requiring memory to run as well. |
46 | | -Currently, 80% of the specified memory limit is passed to the JVM. |
47 | | - |
48 | | -For memory, only a limit can be specified, which will be set as memory request and limit in the container. |
49 | | -This is to always guarantee a container the full amount memory during Kubernetes scheduling. |
| 1 | +include::partial$stackable_resource_requests.adoc[] |
0 commit comments