-
-
Couldn't load subscription status.
- Fork 869
Make ephemeral storage defaults configurable via env vars #1407
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
Conversation
… `POD_EPHEMERAL_STORAGE_SIZE_REQUEST`
|
WalkthroughThe changes introduce two new constants, Changes
Possibly related PRs
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
apps/kubernetes-provider/src/index.ts (1)
37-38: LGTM! Consider using uppercase for constant names.The addition of these constants aligns well with the PR objectives to support customized storage sizes for Kubernetes pods. Using environment variables with default values is a good practice for configuration.
Consider using uppercase for constant names to follow JavaScript/TypeScript naming conventions for constants:
-const POD_EPHEMERAL_STORAGE_SIZE_LIMIT = process.env.POD_EPHEMERAL_STORAGE_SIZE_LIMIT || "10Gi"; -const POD_EPHEMERAL_STORAGE_SIZE_REQUEST = process.env.POD_EPHEMERAL_STORAGE_SIZE_REQUEST || "2Gi"; +const POD_EPHEMERAL_STORAGE_SIZE_LIMIT = process.env.POD_EPHEMERAL_STORAGE_SIZE_LIMIT || "10Gi"; +const POD_EPHEMERAL_STORAGE_SIZE_REQUEST = process.env.POD_EPHEMERAL_STORAGE_SIZE_REQUEST || "2Gi";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (1)
- apps/kubernetes-provider/src/index.ts (4 hunks)
🧰 Additional context used
🔇 Additional comments (4)
apps/kubernetes-provider/src/index.ts (4)
114-114: LGTM! Ephemeral storage limit correctly updated.The change correctly implements the use of the new
POD_EPHEMERAL_STORAGE_SIZE_LIMITconstant for the ephemeral storage limit in the job's container specification. This allows for customization of the storage limit as per the PR objectives.
344-347: LGTM! Ephemeral storage limits and requests correctly updated.The changes correctly implement the use of both new constants
POD_EPHEMERAL_STORAGE_SIZE_LIMITandPOD_EPHEMERAL_STORAGE_SIZE_REQUESTfor ephemeral storage limits and requests in the prePullDeployment method. This allows for customization of both the storage limit and request as per the PR objectives. The use of different values for limits and requests is a good practice in Kubernetes resource management.
405-405: LGTM! Default resource requests and limits correctly updated.The changes in the
defaultResourceRequestsanddefaultResourceLimitsgetters correctly implement the use ofPOD_EPHEMERAL_STORAGE_SIZE_REQUESTandPOD_EPHEMERAL_STORAGE_SIZE_LIMITrespectively. This ensures that the new constants are used consistently throughout the codebase. The separation of requests and limits is maintained, which is a good practice in Kubernetes resource management.Also applies to: 411-411
37-38: Summary: Excellent implementation of customizable ephemeral storage settingsThe changes introduce two new environment variables,
POD_EPHEMERAL_STORAGE_SIZE_LIMITandPOD_EPHEMERAL_STORAGE_SIZE_REQUEST, which allow for customization of ephemeral storage settings in Kubernetes pods. These constants are consistently used throughout the codebase, including in theindexmethod,prePullDeploymentmethod, and the default resource getters.Key points:
- The implementation aligns perfectly with the PR objectives.
- The use of environment variables with default values provides flexibility and ease of configuration.
- The separation of limits and requests is maintained, following Kubernetes best practices.
- The changes are consistent across different parts of the codebase.
These modifications will greatly enhance the flexibility of storage management in self-hosted Kubernetes instances, as intended by the PR.
Also applies to: 114-114, 344-347, 405-405, 411-411
commit: |
|
I guess this would be something for @nicktrn :) |
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- apps/kubernetes-provider/src/index.ts (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
apps/kubernetes-provider/src/index.ts (2)
408-408: Consistent usage of resource limits and requestsEnsure that both
#defaultResourceRequestsand#defaultResourceLimitsinclude all necessary resource types for consistency. Currently,cpuandmemoryare specified in other parts of the code. Verify that theephemeral-storagesettings are harmonized withcpuandmemoryto prevent unintended resource allocations.Consider reviewing the resource specifications to confirm they align with expected defaults.
402-402: Ensure resource quantity strings comply with Kubernetes formatWhen specifying resource quantities for
ephemeral-storage, it's important that the strings used are valid Kubernetes resource quantity formats. Since the values come from environment variables, consider validating them to ensure they are acceptable by Kubernetes. Invalid formats may cause runtime errors when creating pods.To verify that the resource quantity strings are valid, you can run the following script:
POD_EPHEMERAL_STORAGE_SIZE_LIMIT and POD_EPHEMERAL_STORAGE_SIZE_REQUEST
Added support for the env vars
POD_EPHEMERAL_STORAGE_SIZE_LIMITandPOD_EPHEMERAL_STORAGE_SIZE_REQUEST✅ Checklist
Changelog
Added support for customized storage sizes on selfhosted kubernetes instances.
💯
Summary by CodeRabbit