LightBitsLabs / los-csi

Lightbits LightOS CSI Plugin
Other
0 stars 2 forks source link

Add toleration to CSI controller and node pods so that these could be deployed to K8 tainted nodes. #54

Closed rahman-lb closed 1 month ago

rahman-lb commented 1 month ago

In real production environment, it is very likely that K8 nodes are grouped for certain workload, such as high compute or high IO intensive workload, these nodes are tainted to repel pods that are not ideal for those K8 nodes. Tainted Nodes accept pods that has the toleration for those nodes.

This change will add toleration to CSI pods for deployment to the desired set of nodes.

Summary by CodeRabbit

coderabbitai[bot] commented 1 month ago
Walkthrough ## Walkthrough The changes introduce new toleration configurations for the CSI controller and node pods in a Helm chart. Specifically, new sections for `lbControllerTolerations` and `lbNodeTolerations` are added to the `values.yaml` file. Corresponding conditional blocks for tolerations are also incorporated into the `lb-csi-controller.yaml` and `lb-csi-node.yaml` templates, allowing for dynamic specification of tolerations based on user-defined values. ## Changes | Files | Change Summary | |------------------------------------------|--------------------------------------------------------------------------------------------------------| | `deploy/helm/lb-csi/templates/lb-csi-controller.yaml`, `deploy/helm/lb-csi/templates/lb-csi-node.yaml` | Added conditional `tolerations` sections under `spec`, allowing dynamic configuration based on Helm values. | | `deploy/helm/lb-csi/values.yaml` | Introduced new sections for `lbControllerTolerations` and `lbNodeTolerations` with key-value pairs for tolerations. |

Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 6e18860fadfc1c60a5e8b19ec169f539b293ebda and e1b5d4f51935f2b3cc57d1bd0099be34c7db6e4a.
Files selected for processing (3) * deploy/helm/lb-csi/templates/lb-csi-controller.yaml (1 hunks) * deploy/helm/lb-csi/templates/lb-csi-node.yaml (1 hunks) * deploy/helm/lb-csi/values.yaml (1 hunks)
Additional context used
yamllint
deploy/helm/lb-csi/values.yaml
[error] 23-23: trailing spaces (trailing-spaces) --- [error] 24-24: trailing spaces (trailing-spaces) --- [error] 29-29: trailing spaces (trailing-spaces) --- [error] 31-31: trailing spaces (trailing-spaces) --- [error] 32-32: trailing spaces (trailing-spaces) --- [error] 37-37: no new line character at the end of file (new-line-at-end-of-file) --- [error] 37-37: trailing spaces (trailing-spaces)
deploy/helm/lb-csi/templates/lb-csi-node.yaml
[error] 211-211: no new line character at the end of file (new-line-at-end-of-file)
Additional comments not posted (2)
deploy/helm/lb-csi/templates/lb-csi-controller.yaml (1)
`139-145`: **LGTM! But verify the Helm values.** The conditional block for tolerations is correctly implemented. Ensure that the Helm values for `lbControllerTolerations` are correctly defined and used. The code changes are approved. Run the following script to verify the Helm values:
Verification successful --- **Helm values for `lbControllerTolerations` are correctly defined.** The `lbControllerTolerations` section in `values.yaml` includes all necessary sub-keys (`key`, `operator`, `value`, `effect`) with appropriate values, confirming that the conditional block in the template file is correctly implemented. No further action is required.
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the Helm values for `lbControllerTolerations`. # Test: Search for the Helm values. Expect: Only occurrences of correctly defined values. rg --type yaml $'lbControllerTolerations' ``` Length of output: 638 --- Script: ```shell #!/bin/bash # Description: Check the structure and values of `lbControllerTolerations` in `values.yaml`. # Test: Display the `lbControllerTolerations` section in `values.yaml`. rg --type yaml -A 5 'lbControllerTolerations:' deploy/helm/lb-csi/values.yaml ``` Length of output: 207
deploy/helm/lb-csi/templates/lb-csi-node.yaml (1)
`205-211`: **LGTM! But verify the Helm values and add a new line at the end of the file.** The conditional block for tolerations is correctly implemented. Ensure that the Helm values for `lbNodeTolerations` are correctly defined and used. Also, add a new line at the end of the file. The code changes are approved. Run the following script to verify the Helm values: Apply this diff to add a new line at the end of the file: ```diff + ```
Verification successful --- **Helm values for `lbNodeTolerations` are correctly defined.** Ensure to add a new line at the end of the file `deploy/helm/lb-csi/templates/lb-csi-node.yaml` to maintain file formatting standards.
Scripts executed The following scripts were executed for the analysis: Script: ```shell #!/bin/bash # Description: Verify the Helm values for `lbNodeTolerations`. # Test: Search for the Helm values. Expect: Only occurrences of correctly defined values. rg --type yaml $'lbNodeTolerations' ``` Length of output: 566 --- Script: ```shell #!/bin/bash # Description: Verify the sub-keys for `lbNodeTolerations` in values.yaml. # Test: Search for the sub-keys under `lbNodeTolerations`. Expect: Definitions for `key`, `operator`, `value`, `effect`. rg --type yaml -A 4 'lbNodeTolerations:' deploy/helm/lb-csi/values.yaml ``` Length of output: 194
Tools
yamllint
[error] 211-211: no new line character at the end of file (new-line-at-end-of-file)
--- 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?
Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): > :bangbang: **IMPORTANT** > Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged. - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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 as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
8 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

rahman-lb commented 1 month ago

@majst01 any comments ?

majst01 commented 1 month ago

Nice addition, we where lucky and none of our customer ran into this kind of issue so far. But i will take care of adding these tolerations to our operator which deploys the lb-csi-node daemonset as well.