[2.7.0] Running storage-add for a singular storage leaves the operator unit agent (not unit) in the error state

Bug #1855179 reported by Dmitrii Shcherbakov
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
Low
Unassigned

Bug Description

Added this section to a dummy k8s charm:

storage:
  database:
    type: filesystem
    location: /srv/mysql
  backup:
    type: filesystem
    location: /srv/backup

juju deploy ./<charm-dir> --storage 'database=tmpfs,100M backup=tmpfs,100M'

juju run --unit dummy/0 'storage-add backup=2'

juju status
Model Controller Cloud/Region Version SLA Timestamp
controller microk8s-localhost microk8s/localhost 2.7.0 unsupported 23:25:58+03:00

App Version Status Scale Charm Store Rev OS Address Notes
dummy dummy:7.3 active 0/1 dummy local 0 kubernetes 10.152.183.123

Unit Workload Agent Address Ports Message
dummy/0 active failed 10.1.75.101 80/TCP

application-dummy: 23:23:10 ERROR juju.worker.uniter.context cannot add storage: adding storage backup for unit-dummy-0: adding "backup" storage to dummy/0: cannot attach, storage is singular
application-dummy: 23:23:10 ERROR juju.worker.uniter resolver loop error: executing operation "run action 5": running action "juju-run": cannot add storage: adding storage backup for unit-dummy-0: adding "backup" storage to dummy/0: cannot attach, storage is singular

Resolving a unit does not work because it's not in the error state:

juju resolved dummy/0
ERROR unit "dummy/0" is not in an error state

The same thing happens when you run storage-add with an invalid argument:

application-test: 23:35:47 ERROR juju.worker.uniter.context cannot add storage: adding storage count for unit-test-0: storage "count" not found
application-test: 23:35:47 ERROR juju.worker.uniter resolver loop error: executing operation "run action 8": running action "juju-run": cannot add storage: adding storage count for unit-test-0: storage "count" not found

juju status
Model Controller Cloud/Region Version SLA Timestamp
controller microk8s-localhost microk8s/localhost 2.7.0 unsupported 23:36:14+03:00

App Version Status Scale Charm Store Rev OS Address Notes
test wordpress:php7.3 active 0/1 wordpress local 2 kubernetes 10.152.183.54

Unit Workload Agent Address Ports Message
test/0 active failed 10.1.75.103 80/TCP

description: updated
Revision history for this message
Ian Booth (wallyworld) wrote :

Dynamically adding storage does not work on k8s models. The k8s deployment model is such that we use a statefulset, and all pods must be homogeneous. There's a common k8s pod spec template that is given to the k8s statefulset controller and that k8s controller retains responsibility for scaling the k8s replicaset to the required number of pods.

Adding storage is explicitly disallowed by the juju CLI but it seems we don't do that properly for the hook commands.

We don't yet have a way to add storage at the application level to be rolled out across all pods. It's not on the roadmap this cycle.

Changed in juju:
status: New → Triaged
importance: Undecided → Medium
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: Medium → Low
tags: added: expirebugs-bot
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.