Migrate node-red storage to Longhorn#2549
Conversation
…igration Agent-Logs-Url: https://github.com/jeffborg/home-network/sessions/c2386f62-1b0a-47e5-afe9-9726ed108803 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
jeffborg
left a comment
There was a problem hiding this comment.
We don't need the snapshot job longhorn does this Automatically for all
…atically Agent-Logs-Url: https://github.com/jeffborg/home-network/sessions/fd927bc8-349c-43d3-883c-8a4b718ffdba Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Removed |
| persistence: | ||
| data: | ||
| enabled: true | ||
| existingClaim: node-red-data-longhorn |
There was a problem hiding this comment.
This will cause the existing nfs pvc to be destroyed
There was a problem hiding this comment.
Good catch. When existingClaim is set, Helm removes the old PVC from its managed resource set and will delete it on the next helm upgrade. Fixed in 5f4f426 by adding pvc-nfs.yaml — a Kustomize-managed declaration of the node-red-data PVC with helm.sh/resource-policy: keep, which prevents Helm from deleting it during the upgrade. Flux's kustomize-controller will apply this annotation before Helm reconciles.
…licy annotation Agent-Logs-Url: https://github.com/jeffborg/home-network/sessions/0277f8b5-6402-46c9-b374-9513f3f3f751 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
jeffborg
left a comment
There was a problem hiding this comment.
Copy across from the other unmerged pr the helm diff tool. I'm not sure this is going to work without seeing the rendered output
… PRs Agent-Logs-Url: https://github.com/jeffborg/home-network/sessions/33f03560-8d62-4480-bb72-f845453baf84 Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Added in d9027b9. The workflow (copied from PR #2532) is now live on this PR — it triggers on any |
…art expectation Agent-Logs-Url: https://github.com/jeffborg/home-network/sessions/b8e306a7-274e-433f-865e-8c9cd07d62ac Co-authored-by: jeffborg <1595430+jeffborg@users.noreply.github.com>
Fixed in fd30db2. The k8s-at-home common chart library expects |
Node-red's PVC had no explicit storage class (falling back to the cluster default / NFS-backed). This migrates it to Longhorn, consistent with
esphome,home-assistant-dad, and other home-automation workloads.Changes
pvc.yaml(new): declaresnode-red-data-longhorn— 1Gi,storageClass: longhorn,ReadWriteOncepvc-nfs.yaml(new): explicitly manages the legacynode-red-dataNFS PVC withhelm.sh/resource-policy: keep, preventing Helm from deleting it during the upgrade whenexistingClaimis sethelmrelease.yaml:nodeSelector: storage: longhorn— pins pod to Longhorn-capable nodespersistence.data.existingClaim: node-red-data-longhorn— uses pre-created Longhorn PVCadditionalVolumes— exposes oldnode-red-dataNFS PVC to the init container without mounting it in the main containerinitContainers: data-migration— one-shotbusybox:1.36.1container thatcp -as from old NFS volume to new Longhorn volume; idempotent (skips if destination is non-empty)kustomization.yaml: addspvc.yamlandpvc-nfs.yamlto resources;snapshots.yamlremoved as Longhorn handles snapshots automatically for all volumes.github/workflows/render-helm-templates.yaml(new): renders both the base-branch and PR-branch versions of any changedhelmrelease*.yamland posts a unified diff to the GitHub Step Summary, so the resulting Kubernetes manifests can be reviewed before mergingMigration flow
Once the migration is confirmed successful the init container,
additionalVolumesentry, and the oldnode-red-dataPVC (along withpvc-nfs.yaml) can be cleaned up.