Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

rook-ceph: Allow user to provide sub-component resources #1483

Merged
merged 3 commits into from
Jun 18, 2021

Conversation

surajssd
Copy link
Member

@surajssd surajssd commented Jun 4, 2021

This PR adds a new parameter resources for sub-components' cpu and
memory requests and limits.

Fixes #1476

@surajssd surajssd force-pushed the surajssd/rook-add-resources branch from ea5ab94 to bbb162a Compare June 4, 2021 14:23
@surajssd surajssd force-pushed the surajssd/rook-add-resources branch from 05e2196 to a1cd8dc Compare June 10, 2021 13:19
@surajssd surajssd requested review from ipochi and iaguis June 14, 2021 06:52
Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there reasonable examples out on in the world that provide resource limits/requests for the Rook osd, monitor, prepare etc jobs ? I am merely asking whats the need for this feature ? Has there been instances where the resources in question are consuming lots of cpu and memory ?

If so, might we also suggest sane values to use in the configuration reference document or the the existing how to guide for configuring rook/rook-ceph (

@@ -103,6 +104,29 @@ func MatchJSONPathInt64Value(t *testing.T, yamlConfig string, jsonPath string, e
}
}

// MatchJSONPathJSONValue is a helper function for component unit tests. It compares the JSON values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any new util functions that need not be visible should be part of the internal package

example this file : internal/util_test.go

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this pkg/components/internal/testutil/jsonpath.go has all the relevant code that deals with finding values at JSON path, converting into appropriate concrete data types and comparing values.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it will be needed in various _test.go files, I don't fully understand what are you suggesting?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm suggesting to use the internal package for utility functions such as the one below

https://github.com/kinvolk/lokomotive/blob/master/internal/util_test.go

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the file that you are linking is a test code of the internal package. And internal package is consumed by anyone and everyone meanwhile the testutil is only consumed by tests. I still don't understand what is the rationale behind putting the test helper code away from the similar code?

@surajssd
Copy link
Member Author

Are there reasonable examples out on in the world that provide resource limits/requests for the Rook osd, monitor, prepare etc jobs ? I am merely asking whats the need for this feature ? Has there been instances where the resources in question are consuming lots of cpu and memory ?

Yes, the linked issue describes the problem: #1476.

If so, might we also suggest sane values to use in the configuration reference document or the the existing how to guide for configuring rook/rook-ceph

Yes,this is a good idea to point folks to https://rook.io/docs/rook/v1.6/ceph-cluster-crd.html#cluster-wide-resources-configuration-settings. But instead of doing it via how-to-guide, I think pointing folks from the config ref makes it more accessible. How-to-guide by the nature of it could hide the details.

surajssd added 3 commits June 17, 2021 12:59
Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
This commit adds a new function which compares JSON value at a JSON
path. For e.g.

```
spec:
  resources:
    osd: {"requests":{"cpu":"5","memory":"5Gi"},"limits":{"cpu":"5","memory":"5Gi"}}
```

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
This commit adds a new parameter `resources` for sub-components' cpu and
memory requests and limits.

Signed-off-by: Suraj Deshmukh <suraj@kinvolk.io>
@surajssd surajssd force-pushed the surajssd/rook-add-resources branch from a1cd8dc to aafdcca Compare June 17, 2021 07:35
@surajssd surajssd requested a review from ipochi June 17, 2021 11:31
@surajssd
Copy link
Member Author

@ipochi I have addressed your concerns regarding documentation, PTAL.

Copy link
Member

@ipochi ipochi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@surajssd surajssd merged commit 421f9ae into master Jun 18, 2021
@surajssd surajssd deleted the surajssd/rook-add-resources branch June 18, 2021 06:41
@invidian invidian added area/components Items related to components kind/enhancement New feature or request labels Jul 16, 2021
@invidian invidian added this to the v0.9.0 milestone Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/components Items related to components kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rook: Ceph OSDs consume up to 12 GB memory
3 participants