Skip to content
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

Issue 495: Validate Pravega manifest settings before deployment #584

Conversation

nishant-yt
Copy link
Collaborator

Signed-off-by: Nishant Gupta [email protected]

Change log description

While deploying Pravega , Segment Store settings should adhere to the following rules:
POD_MEM_LIMIT > JVM Heap (-Xmx) + JVM Direct Memory (-XX:MaxDirectMemorySize)
JVM Direct Memory > JVM Heap
JVM Direct memory > Segment Store read cache size (pravegaservice.cache.size.max)

Here we are validating the above scenarios before deployment by the operator happens instead of manually relying on the user to set them right.

Purpose of the change

Fixes #495

What the code does

The code makes sure the following checks are performed by the operator before deploying Pravega:
POD_MEM_LIMIT > JVM Heap + JVM Direct Memory
JVM Direct Memory > JVM Heap
JVM Direct memory > Segment Store read cache size

How to verify it

Try setting different values for .spec.pravega.segmentStoreResources.requests.memory , -Xmx , -XX:MaxDirectMemorySize and pravegaservice.cache.size.max and the operator should return error in case the above mentioned rules are not met.

Comment on lines +1210 to +1218
totalMemoryQuantity := p.Spec.Pravega.SegmentStoreResources.Requests[corev1.ResourceMemory]
if (resource.Quantity{}) == totalMemoryQuantity {
return fmt.Errorf("Missing required value for field .spec.pravega.segmentStoreResources.requests.memory")
}

cacheSizeString := p.Spec.Pravega.Options["pravegaservice.cache.size.max"]
if cacheSizeString == "" {
return fmt.Errorf("Missing required value for option pravegaservice.cache.size.max")
}

Choose a reason for hiding this comment

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

I'm not sure we need to make these two values required.
If they are to be required, they need to be made required in the CRD and the requirement needs to be documented.

@nishant-yt nishant-yt requested a review from RaulGracia October 20, 2021 13:35
@codecov-commenter
Copy link

codecov-commenter commented Oct 20, 2021

Codecov Report

Merging #584 (d9dac1d) into master (7af939a) will decrease coverage by 0.71%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #584      +/-   ##
==========================================
- Coverage   74.17%   73.46%   -0.72%     
==========================================
  Files          16       16              
  Lines        4229     4270      +41     
==========================================
  Hits         3137     3137              
- Misses        962     1003      +41     
  Partials      130      130              
Impacted Files Coverage Δ
pkg/apis/pravega/v1beta1/pravegacluster_types.go 25.46% <0.00%> (-1.27%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7af939a...d9dac1d. Read the comment docs.

@nishant-yt nishant-yt closed this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate Pravega manifest settings before deployment.
3 participants