Skip to content

Commit

Permalink
chore(deployment): adjust resource requests (#617)
Browse files Browse the repository at this point in the history
* fix(deployment): tinker with default container resource requests
* update doc
  • Loading branch information
andrewazores authored Sep 15, 2023
1 parent 924cc4c commit 893189e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,21 @@ If the sidecar's resource requests are not specified, they are set with the foll

| Request | Quantity |
|---------|----------|
| Reports Container CPU | 128m |
| Reports Container Memory | 256Mi |
| Reports Container CPU | 200m |
| Reports Container Memory | 384Mi |


### Resource Requirements
By default, the operator deploys Cryostat with pre-configured resource requests:

| Request | Quantity |
|---------|----------|
| Cryostat container CPU | 100m |
| Cryostat container Memory | 384Mi |
| JFR Data Source container CPU | 100m |
| JFR Data Source container Memory | 512Mi |
| Cryostat container CPU | 500m |
| Cryostat container Memory | 256Mi |
| JFR Data Source container CPU | 200m |
| JFR Data Source container Memory | 384Mi |
| Grafana container CPU | 100m |
| Grafana container Memory | 256Mi |
| Grafana container Memory | 120Mi |

Using the Cryostat custom resource, you can define resources requests and/or limits for each of the three containers in Cryostat's main pod:
- the `core` container running the Cryostat backend and web application. If setting a memory limit for this container, we recommend at least 768MiB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ type TLSConfig struct {
}

const (
defaultCoreCpuRequest string = "100m"
defaultCoreMemoryRequest string = "384Mi"
defaultJfrDatasourceCpuRequest string = "100m"
defaultJfrDatasourceMemoryRequest string = "512Mi"
defaultCoreCpuRequest string = "500m"
defaultCoreMemoryRequest string = "256Mi"
defaultJfrDatasourceCpuRequest string = "200m"
defaultJfrDatasourceMemoryRequest string = "384Mi"
defaultGrafanaCpuRequest string = "100m"
defaultGrafanaMemoryRequest string = "256Mi"
defaultReportCpuRequest string = "128m"
defaultReportMemoryRequest string = "256Mi"
defaultGrafanaMemoryRequest string = "120Mi"
defaultReportCpuRequest string = "200m"
defaultReportMemoryRequest string = "384Mi"
)

func NewDeploymentForCR(cr *model.CryostatInstance, specs *ServiceSpecs, imageTags *ImageTags,
Expand Down
14 changes: 7 additions & 7 deletions internal/test/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -2655,8 +2655,8 @@ func (r *TestResources) NewApiServerWithApplicationURL() *configv1.APIServer {
func newCoreContainerDefaultResource() *corev1.ResourceRequirements {
return &corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("100m"),
corev1.ResourceMemory: resource.MustParse("384Mi"),
corev1.ResourceCPU: resource.MustParse("500m"),
corev1.ResourceMemory: resource.MustParse("256Mi"),
},
}
}
Expand All @@ -2683,8 +2683,8 @@ func (r *TestResources) NewCoreContainerResource(cr *model.CryostatInstance) *co
func newDatasourceContainerDefaultResource() *corev1.ResourceRequirements {
return &corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("100m"),
corev1.ResourceMemory: resource.MustParse("512Mi"),
corev1.ResourceCPU: resource.MustParse("200m"),
corev1.ResourceMemory: resource.MustParse("384Mi"),
},
}
}
Expand Down Expand Up @@ -2712,7 +2712,7 @@ func newGrafanaContainerDefaultResource() *corev1.ResourceRequirements {
return &corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("100m"),
corev1.ResourceMemory: resource.MustParse("256Mi"),
corev1.ResourceMemory: resource.MustParse("120Mi"),
},
}
}
Expand All @@ -2739,8 +2739,8 @@ func (r *TestResources) NewGrafanaContainerResource(cr *model.CryostatInstance)
func newReportContainerDefaultResource() *corev1.ResourceRequirements {
return &corev1.ResourceRequirements{
Requests: corev1.ResourceList{
corev1.ResourceCPU: resource.MustParse("128m"),
corev1.ResourceMemory: resource.MustParse("256Mi"),
corev1.ResourceCPU: resource.MustParse("200m"),
corev1.ResourceMemory: resource.MustParse("384Mi"),
},
}
}
Expand Down

0 comments on commit 893189e

Please sign in to comment.