Menu

#1438 [k8s] add expanding persistent volumes in tenant clusters

open
nobody
None
2025-09-20
2025-09-20
Anonymous
No

Originally created by: klinch0

What this PR does

Release note

- add expanding persistent volumes in tenant clusters

Summary by CodeRabbit

  • New Features
  • Enabled PersistentVolumeClaim expansion in the KubeVirt CSI StorageClass.
  • Added CSI resizer sidecar to the controller for online volume resizing.
  • Introduced cluster-scoped RBAC to allow required access to PersistentVolumes.

  • Chores

  • Updated Kubernetes app chart to 0.29.2 and set app version to 1.32.6.
  • Upgraded KubeVirt CSI driver image to 0.37.0.
  • Refreshed versions map entries for the new release.
  • Simplified CoreDNS configuration to use the default image repository.

Discussion

  • Anonymous

    Anonymous - 2025-09-20

    Originally posted by: coderabbitai[bot]

    [!NOTE]

    Other AI code review bot(s) detected

    CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

    Walkthrough

    Increments Kubernetes app chart to 0.29.2 with appVersion 1.32.6, updates kubevirt-csi-driver image, adds csi-resizer sidecar to the controller, introduces cluster-scoped RBAC for PV access, enables StorageClass volume expansion, adjusts CoreDNS values (removes image repository), and updates versions_map entries.

    Changes

    Cohort / File(s) Summary of Changes
    Chart metadata update
    packages/apps/kubernetes/Chart.yaml
    Bumps chart version 0.29.1 → 0.29.2; adds appVersion: 1.32.6.
    KubeVirt CSI image references
    packages/apps/kubernetes/images/kubevirt-csi-driver.tag, packages/system/kubevirt-csi-node/values.yaml
    Switches kubevirt-csi-driver image to kklinch0/kubevirt-csi-driver:0.37.0 with new digest in both app image tag file and system values.
    CSI controller sidecar
    packages/apps/kubernetes/templates/csi/deploy.yaml
    Adds csi-resizer container (registry.k8s.io/sig-storage/csi-resizer:v1.13.1) with args, mounts, resources, and hardened securityContext; reuses existing volumes.
    Cluster-scoped RBAC for kcsi
    packages/apps/kubernetes/templates/csi/infra-cluster-service-account.yaml
    Adds ClusterRole (get on persistentvolumes) and ClusterRoleBinding to kcsi ServiceAccount.
    StorageClass expansion
    packages/system/kubevirt-csi-node/templates/deploy.yaml
    Adds allowVolumeExpansion: true to StorageClass.
    CoreDNS values tweak
    packages/system/coredns/values.yaml
    Removes coredns.image.repository field; replicaCount unchanged.
    Versions map update
    packages/apps/versions_map
    Pins 0.29.1 to commit 53fbe7c2 and adds 0.29.2 with HEAD.

    Sequence Diagram(s)

    sequenceDiagram
      autonumber
      actor Admin as Admin
      participant KAPI as Kubernetes API Server
      participant Resizer as csi-resizer (sidecar)
      participant Ctrl as kcsi-controller (CSI)
      participant CSI as KubeVirt CSI Driver
    
      Admin->>KAPI: Patch PVC with larger size
      KAPI-->>Resizer: PVC/PV size change event (watch)
      Resizer->>Ctrl: gRPC over /csi/csi.sock: ControllerExpandVolume
      Ctrl->>CSI: Perform volume expansion
      CSI-->>Ctrl: Expansion result (success/failure)
      Ctrl-->>Resizer: gRPC response
      Resizer->>KAPI: Update PV/PVC status and capacity
      note over Resizer,KAPI: Requires ClusterRole get on persistentvolumes
    

    Estimated code review effort

    🎯 3 (Moderate) | ⏱️ ~20 minutes

    • [[#1334]](https://github.com/cozystack/cozystack/issues/1334) — Also updates kubevirt-csi-driver image/tag in the same image/tag files.
    • [[#1434]](https://github.com/cozystack/cozystack/issues/1434) — Adjusts kubevirt-csi-driver references across app and system values similarly.
    • [[#1401]](https://github.com/cozystack/cozystack/issues/1401) — Modifies kubevirt-csi-driver image digests in matching paths.

    Suggested labels

    ok-to-test

    Suggested reviewers

    • kvaps
    • lllamnyp

    Poem

    I hop through charts with tidy cheer,
    A resizer joins the pods this year.
    With PV rights and growth in hand,
    Our volumes stretch across the land.
    CoreDNS sheds a line—so neat!
    New tags, new hops—release complete. 🐇✨

    Pre-merge checks and finishing touches

    ✅ Passed checks (3 passed) | Check name | Status | Explanation | | :----------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title Check | ✅ Passed | The title "[k8s] add expanding persistent volumes in tenant clusters" is concise and accurately captures the PR's primary intent — enabling expandable persistent volumes in tenant clusters — and aligns with the changeset which adds allowVolumeExpansion to the StorageClass, a csi-resizer sidecar, and supporting cluster-scoped RBAC. It is specific enough for a reviewer scanning history and avoids vague wording. | | Docstring Coverage | ✅ Passed | No functions found in the changes. Docstring coverage check skipped. |
    ✨ Finishing touches
    🧪 Generate unit tests - [ ] Create PR with unit tests - [ ] Post copyable unit tests in a comment - [ ] Commit unit tests in branch `feature/expanding-persistent-volumes-in-tenant-clusters`

    Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

    ❤️ 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)

    Comment @coderabbitai help to get the list of available commands and usage tips.

     
  • Anonymous

    Anonymous - 2025-09-20

    Originally posted by: gemini-code-assist[bot]

    Summary of Changes

    Hello @klinch0, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

    This pull request significantly enhances the storage capabilities within tenant Kubernetes clusters by enabling persistent volume expansion. It achieves this by integrating the Kubernetes CSI resizer component into the KubeVirt CSI driver deployment, updating the underlying CSI driver image, and configuring the StorageClass to support volume resizing. These changes provide greater flexibility for users to adjust their storage resources dynamically without manual intervention.

    Highlights

    • Persistent Volume Expansion: Enabled the expansion of persistent volumes in tenant Kubernetes clusters by adding the "allowVolumeExpansion: true" flag to the KubeVirt CSI StorageClass definition.
    • CSI Resizer Integration: Introduced the "csi-resizer" sidecar container to the KubeVirt CSI provisioner deployment, along with necessary ClusterRole and ClusterRoleBinding permissions, to manage volume resizing operations.
    • KubeVirt CSI Driver Update: Upgraded the KubeVirt CSI driver image to version "0.37.0" across relevant configurations, ensuring compatibility and leveraging the latest features for storage management.
    • Configuration Schema Refinement: Updated "values.schema.json" to explicitly define default values for various Kubernetes addons and control plane components, improving configuration clarity and consistency.
    Using Gemini Code Assist
    The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either `/gemini ` or `@gemini-code-assist `. Below is a summary of the supported commands on the current page. Feature | Command | Description --- | --- | --- Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a `.gemini/` folder in the base of the repository. Detailed instructions can be found [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up [here](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG). You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).

    1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution

     

Log in to post a comment.