Skip to content

Enable configurable storageClass and size for H2 PVC#18

Merged
kthoms merged 3 commits into
mainfrom
copilot/enable-storageclass-size-pvc
Mar 3, 2026
Merged

Enable configurable storageClass and size for H2 PVC#18
kthoms merged 3 commits into
mainfrom
copilot/enable-storageclass-size-pvc

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

  • Explore repository structure and understand current PVC configuration
  • Add persistence.storageClass and persistence.size fields to values.yaml
  • Update persistentvolumeclaim.yaml template to use the new values
  • Update values.schema.json to include the new persistence fields
  • Make persistence.size conditional in the PVC template (consistent with storageClass)
  • Reduce default PVC size from 1Gi to 256Mi (more appropriate for H2 demo/test usage)
  • Make persistence comments db-agnostic (remove H2-specific references)
Original prompt

This section details on the original issue you should resolve

<issue_title>Enable setting storageClass and size for PVC</issue_title>
<issue_description>Storage class and size for PVC should be configurable via values.yaml.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kthoms <265597+kthoms@users.noreply.github.com>
Copilot AI changed the title [WIP] Make storage class and size configurable for PVC Enable configurable storageClass and size for H2 PVC Mar 2, 2026
Comment thread charts/operaton/templates/persistentvolumeclaim.yaml
Comment thread charts/operaton/values.yaml Outdated
# If empty, no storageClassName is set (cluster default is used).
storageClass: ""
# Size of the H2 database PVC.
size: 1Gi
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot Although it was the previous default, isn't 1Gi too much for the default? Especially when using h2?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reduced the default to 256Mi in ad622b7, which is more appropriate for H2 in demo/test scenarios.

Comment thread charts/operaton/values.yaml Outdated
extraContainers: []

persistence:
# Storage class for the H2 database PVC.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot Aren't the persistence settings also valid for other DB kinds than h2? Then the comment should be db agnostic.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in ad622b7 — comments now say "Storage class for the PVC" and "Size of the PVC" without referencing H2 specifically.

Co-authored-by: kthoms <265597+kthoms@users.noreply.github.com>
@kthoms kthoms marked this pull request as ready for review March 3, 2026 10:50
Copilot AI review requested due to automatic review settings March 3, 2026 10:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Helm chart configurability for the H2 PersistentVolumeClaim (PVC) by introducing new persistence.storageClass and persistence.size values, wiring them into the PVC template, and validating them via the chart’s JSON schema.

Changes:

  • Added persistence.storageClass and persistence.size to values.yaml (defaulting size to 256Mi).
  • Updated the H2 PVC template to optionally set storageClassName (including "-""" behavior) and to source storage size from values.
  • Extended values.schema.json to include the new persistence object and require it at the chart root.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
charts/operaton/values.yaml Introduces persistence values and sets a smaller default size.
charts/operaton/values.schema.json Adds schema definitions/requirements for persistence.storageClass and persistence.size.
charts/operaton/templates/persistentvolumeclaim.yaml Uses the new persistence values when rendering the H2 PVC.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +20 to +22
{{- if .Values.persistence.size }}
storage: {{ .Values.persistence.size }}
{{- end }}
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

resources.requests.storage is currently rendered only when persistence.size is truthy. A PVC without a storage request is invalid and will be rejected by the Kubernetes API if a user sets persistence.size: "" (or otherwise makes it empty). Prefer always rendering storage (using default/chart default) or failing the render with required when persistence.size is empty, rather than silently omitting it.

Suggested change
{{- if .Values.persistence.size }}
storage: {{ .Values.persistence.size }}
{{- end }}
storage: {{ required "persistence.size is required and cannot be empty" .Values.persistence.size }}

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +44
persistence:
# Storage class for the PVC.
# If set to "-", storageClassName will be set to "", disabling dynamic provisioning.
# If empty, no storageClassName is set (cluster default is used).
storageClass: ""
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

These persistence.* values are defined at the chart root, but they only affect the H2 PersistentVolumeClaim (this PVC template is gated by operaton.h2DatabaseIsUsed). Consider clarifying that in the comments so users running an external DB don’t assume these settings have an effect.

Copilot uses AI. Check for mistakes.
@kthoms kthoms merged commit de8f3ca into main Mar 3, 2026
9 checks passed
@kthoms kthoms deleted the copilot/enable-storageclass-size-pvc branch March 3, 2026 11:00
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.

Enable setting storageClass and size for PVC

3 participants