Skip to content

linstor: add basic snapshot functionality - #651

Merged
Timofei Larkin (lllamnyp) merged 1 commit into
mainfrom
linstor-snapshots
Feb 27, 2025
Merged

linstor: add basic snapshot functionality#651
Timofei Larkin (lllamnyp) merged 1 commit into
mainfrom
linstor-snapshots

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Feb 26, 2025

Copy link
Copy Markdown
Member

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • New Features
    • Enhanced deployment orchestration by updating dependency management to include an additional snapshot handling component.
    • Introduced an automated background service that routinely cleans up snapshots marked for deletion.
    • Added a default snapshot configuration to streamline volume snapshot operations.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@dosubot dosubot Bot added the size/M This PR changes 30-99 lines, ignoring generated files label Feb 26, 2025
@coderabbitai

coderabbitai Bot commented Feb 26, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This pull request updates the linstor release configurations by adding a new dependency (snapshot-controller) in two bundle files. It further introduces new Kubernetes resources for automated snapshot cleanup via a plunger mechanism—a ConfigMap containing a shell script and its corresponding Deployment—and adds a VolumeSnapshotClass for linstor snapshots. These changes affect dependency ordering and integrate automated snapshot deletion into the system.

Changes

File(s) Change Summary
packages/core/platform/bundles/distro-full.yaml
packages/core/platform/bundles/paas-full.yaml
Updated the dependsOn field for the linstor release to include snapshot-controller.
packages/system/linstor/templates/plunger/configmap.yaml
packages/system/linstor/templates/plunger/plunger.yaml
Added new plunger components: a ConfigMap with an indefinitely running shell script for snapshot cleanup and a Deployment for running the plunger application.
packages/system/linstor/templates/volumesnapshotclass.yaml Introduced a new VolumeSnapshotClass (linstor-snapshots) with the default deletion policy and specified driver.

Sequence Diagram(s)

sequenceDiagram
    participant Deployment
    participant PlungerContainer
    participant PlungerScript
    participant LinstorAPI

    Deployment->>PlungerContainer: Launch linstor-plunger pod
    PlungerContainer->>PlungerScript: Execute /scripts/plunger.sh
    PlungerScript->>LinstorAPI: Retrieve resource list (filter DELETE flag)
    LinstorAPI-->>PlungerScript: Return list of deletable snapshots
    PlungerScript->>LinstorAPI: Execute 'linstor snapshot delete' for each snapshot
Loading

Possibly related PRs

  • Update LINSTOR v1.29.2 #494: Involves modifications to the linstor configuration dependency management, aligning with the dependency updates in this PR.

Suggested labels

enhancement, size:L

Poem

I’m a rabbit in the code, hopping with delight,
Adding controllers and scripts to set things right.
Dependencies now lined up in a neat parade,
With plunger and snapshots dancing in the shade.
Carrot-crunching through YAML, I celebrate each byte!
Happy hops in our world of code, shining bright!


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dosubot dosubot Bot added the kind/feature Categorizes issue or PR as related to a new feature label Feb 26, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/system/linstor/templates/plunger/configmap.yaml (1)

11-11: Remove Trailing Whitespace
Line 11 appears to have trailing spaces. Please remove them to comply with YAML linting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 11-11: trailing spaces

(trailing-spaces)

packages/system/linstor/templates/plunger/plunger.yaml (1)

1-53: New Deployment for linstor-plunger Added
The Deployment configuration for linstor-plunger is well-structured. It correctly mounts the required volumes (client TLS, linstor configuration, and the plunger script) and employs a checksum annotation to trigger pod restarts on ConfigMap updates. Moreover, the specified tolerations and service account look appropriate for isolating this functionality.

Suggestion: Consider evaluating whether a more minimal container image might suffice for running just the plunger script, thereby reducing the attack surface.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 86bb640 and 9ae6b2b.

📒 Files selected for processing (5)
  • packages/core/platform/bundles/distro-full.yaml (1 hunks)
  • packages/core/platform/bundles/paas-full.yaml (1 hunks)
  • packages/system/linstor/templates/plunger/configmap.yaml (1 hunks)
  • packages/system/linstor/templates/plunger/plunger.yaml (1 hunks)
  • packages/system/linstor/templates/volumesnapshotclass.yaml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/system/linstor/templates/volumesnapshotclass.yaml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
packages/system/linstor/templates/plunger/configmap.yaml

[error] 11-11: trailing spaces

(trailing-spaces)

🔇 Additional comments (4)
packages/system/linstor/templates/plunger/configmap.yaml (1)

1-16: New ConfigMap for Plunger Script Added
This ConfigMap introduces the basic snapshot cleanup script that uses the linstor CLI combined with jq to identify resources marked for deletion. Ensure that its behavior is validated in your test environment.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 11-11: trailing spaces

(trailing-spaces)

packages/core/platform/bundles/paas-full.yaml (2)

203-209: Update linstor Dependency
The linstor release now lists [piraeus-operator,cilium,kubeovn,cert-manager,snapshot-controller] as dependencies. This update ensures that the snapshot-controller is deployed beforehand, aligning with the new snapshot functionality.


210-214: Verify snapshot-controller Dependencies
The snapshot-controller release depends on [cilium,kubeovn,cert-manager-issuers]. Please verify that this dependency ordering is intentional and that all required resources will be available at runtime.

packages/core/platform/bundles/distro-full.yaml (1)

172-178: Update linstor Dependency in Distro Bundle
The dependency list for the linstor release now includes snapshot-controller alongside [piraeus-operator,cilium,cert-manager]. This update is consistent with the changes made in the PaaS bundle. Please ensure that the ordering is validated across deployment environments.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Feb 27, 2025
@lllamnyp
Timofei Larkin (lllamnyp) deleted the linstor-snapshots branch February 27, 2025 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature lgtm This PR has been approved by a maintainer size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants