K8s charm: How to know if the containers deployed correctly


#1

After layer.caas_base.pod_spec_set() returns, the pods aren’t immediately ready yet. Is there a way for the Charm to figure out when the pods are ready?


#2

Right now, the best we have is for the charm run the goal-state hook command which will report on the unit status which is derived from the pod state and what the charm has reported. If the pod state is Running and the charm has set status as Active, Juju will report the unit as Active. If the pod state is not yet running, Juju will report the unit status as Waiting (even if the charm has set status as Active). If the charm has explicitly set the status as Blocked, that will be reported.

There’s work planned for next cycle to provide a mechanism for better surfacing of workload pod status to the charm.