-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(openhab): support shared PVCs and configurable subpaths #969
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
Open
drieks
wants to merge
1
commit into
helmforgedev:main
Choose a base branch
from
drieks:openhab
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Upgrading openHAB | ||
|
|
||
| ## Storage layout migration | ||
|
|
||
| This release adds an optional chart-managed shared PVC with `userdata`, `conf`, | ||
| and `addons` subpaths. The default remains the existing three chart-managed | ||
| PVCs, so a normal upgrade preserves the current storage layout. | ||
|
|
||
| ### Previous main-branch behavior | ||
|
|
||
| `persistence.userdata`, `persistence.conf`, and `persistence.addons` each | ||
| created their own PVC by default. Their independent `size`, `storageClass`, | ||
| and `accessMode` settings applied to those PVCs. An `existingClaim` replaced | ||
| the PVC for that individual directory. The chart allowed these three settings | ||
| to remain configured alongside `existingClaim`; in that case they had no | ||
| effect because the existing PVC took precedence. | ||
|
|
||
| ### Opt in to a shared PVC | ||
|
|
||
| There are two supported arrangements: | ||
|
|
||
| 1. Set `persistence.claim.enabled=true`. With no per-directory `existingClaim`, | ||
| the chart creates one `<fullname>-data` PVC using `persistence.claim`. It mounts the `userdata`, | ||
| `conf`, and `addons` subpaths at the corresponding openHAB directories. | ||
| 2. Set `existingClaim` for any one, two, or all three directories. The | ||
| remaining enabled directories use the chart-managed shared PVC. `subPath` | ||
| can be set only for an existing claim; chart-managed shared subpaths are | ||
| fixed. Per-directory `size`, `storageClass`, and `accessMode` values are | ||
| not used in shared-PVC mode. | ||
|
|
||
| ### Preserve the current three-PVC layout | ||
|
|
||
| This is the default behavior. Existing releases can be upgraded normally, | ||
| including with `--reuse-values`; their PVC names and roots remain unchanged. | ||
|
|
||
| ```yaml | ||
| persistence: | ||
| userdata: | ||
| size: 5Gi | ||
| storageClass: <existing-storage-class> | ||
| conf: | ||
| size: 1Gi | ||
| storageClass: <existing-storage-class> | ||
| addons: | ||
| size: 2Gi | ||
| storageClass: <existing-storage-class> | ||
| ``` | ||
|
|
||
| Use the actual existing settings, which can be inspected with: | ||
|
|
||
| ```bash | ||
| kubectl get pvc -n <namespace> | ||
| ``` | ||
|
|
||
| Then upgrade with those values (or use `--reuse-values`): | ||
|
|
||
| ```bash | ||
| helm upgrade <release> <chart> -n <namespace> -f openhab-storage-upgrade.yaml | ||
| ``` | ||
|
|
||
| ### Migrate into the new shared PVC | ||
|
|
||
| Back up the three existing PVCs first. Create or allow the chart to create a | ||
| shared PVC sized for all data, then copy the old PVC roots into `userdata`, | ||
| `conf`, and `addons` respectively using a temporary pod or your storage | ||
| provider's migration tool. Only after verifying the copies should the new | ||
| release mount that shared PVC with the default subpaths. Finally upgrade with | ||
| `persistence.claim.enabled=true`. | ||
|
|
||
| Do not delete the old PVCs until openHAB has started successfully and the data | ||
| has been verified. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not report configured sizes for existing PVCs.
The
persistence.claim.enabledcondition distinguishes shared mode from dedicated mode, but it does not distinguish generated PVCs from existing PVCs. As a result, Line 77 can displaypersistence.claim.sizefor a shared existing PVC, and Lines 86 and 95 can display per-directory sizes for dedicated existing PVCs. Those values may not describe the actual PVC capacity.Use the resolved claim source for the label and size. Show a size only when Helm creates the PVC. Use distinct wording for generated shared claims, shared existing claims, and dedicated existing claims. Add render coverage for all three cases.
Also applies to: 86-86, 95-95
🧰 Tools
🪛 LanguageTool
[style] ~77-~77: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...sistence.claim.enabled }}shared PVC {{ .Values.persistence.claim.size }}{{ else }}{{ ....
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~77-~77: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ....persistence.claim.size }}{{ else }}{{ .Values.persistence.userdata.size }} dedicated ...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🤖 Prompt for AI Agents