Can't deploy k8s application with detached storage

Bug #1818533 reported by Stuart Bishop
8
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

'juju deploy --help' clearly states:

--attach-storage (= )
    Existing storage to attach to the deployed unit (not available on kubernetes models)

We need to lose this restriction so we can do redeploys without losing state. Destroying an application does appear to detach the storage, but there appears to be no way to make use of it.

Stuart Bishop (stub)
Changed in juju:
importance: Undecided → Wishlist
Revision history for this message
Ian Booth (wallyworld) wrote :

The issue is that idiomatically k8s pods requiring storage are managed by a stateful set, which requires that each pod be homogeneous - the pod template defining storage requirements is configured up front and typically a PVC backed by a storage class providing dynamically provisioned storage is used. k8s applications will have their own strategies for dealing with importing data from existing volumes; it's currently a bit wild west. We're looking at the possibility of patching existing pods to dynamically attach existing storage but need to consider how this interacts with the stateful set and how it manages rolling updates etc which may override and individual pod customisation done outside of the stateful set.

Changed in juju:
status: New → Triaged
Revision history for this message
Canonical Juju QA Bot (juju-qa-bot) wrote :

This bug has not been updated in 2 years, so we're marking it Low importance. If you believe this is incorrect, please update the importance.

Changed in juju:
importance: Wishlist → Low
tags: added: expirebugs-bot
Revision history for this message
Alex Lutay (taurus) wrote :

> ... marking it Low importance. If you believe this is incorrect...

The issue still affects Data Platform. Can you please restore/increase a priority?
We need a way to re-deploy DB (statefull) charms reusing data on the persistent volume.

> juju deploy postgresql-k8s --attach-storage database=...

Tnx!

Revision history for this message
Pedro Guimarães (pguimaraes) wrote :

hi @taurus, --attach-storage is not possible in k8s because statefulsets do not identify individual persistent volumes. However, in juju 3.1.6, I can consistently remove a unit and, at re-add, the new unit picks the same ID and the existing PVC:

https://pastebin.ubuntu.com/p/X26XwtVsFz/

So, it is slightly different than VM charms, but should be possible to reuse the same PVC.

Revision history for this message
Alex Lutay (taurus) wrote :

Discussed with Pedro in MM:

* yes, re-scaling-up after scaling-down will reuse old storage/PVC => ALL OK here.

* this issue is about impossibility to re-deploy entire K8s charm application reusing the old data/PVC.

The K8s limitations are clear, but end-users still need ability to deploy on K8s with old DB/data (Juju supports it on VM) => the ticket is still topical. Tnx!

tags: added: canonical-data-platform-eng
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.