k8s storage not attached until after pod is spun up
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
storage-attached hooks do not run for k8s charms until after pod-spec-set has been called and the pod is spun up. Until then, juju storage shows 'pending' with no further feedback.
This means that charms cannot wait until required storage is available before spinning up the pod, such as this failing example:
@hook("
def pgdata_
reactive.
status.
@when_not(
def require_pgdata():
status.
@when_not(
@when('
def config_container():
status.
caas_
The storage section of my metadata.yaml:
storage:
pgdata:
type: filesystem
description: >
Database data files (ie. $PGDATA). Stores all of your data and
indexes. Mainly random access reads and writes.
minimum-size: 5M
location: /srv/pgdata
multiple:
range: "1"
Spinning up the pod before required resources are not available takes care, as we need to ensure clients cannot actually use it and risk losing data when the pod is reset into the final state.
Its an interesting chicken-and-egg problem where we don't know what pods you're going to start until you tell us, but you need to know how to configure those pods before you start them.
What storage information would be useful to help you get started with a pod that would consume storage?