Skip to content

[K8s] Bind services creation/removal to app lifecycle #157

@sinclert-canonical

Description

@sinclert-canonical

This issue describes a possible improvement discussed in this PR thread, where we realized we are binding the creation / removal of Kubernetes primary and replica services with the client application lifecycles (i.e. with the logic inside mysql_provider.py module).

Ideally, we would bind these operations to the lifecycle of the MySQL application itself, reducing the number of scenarios when multiple client applications relate / unrelate.

Disclaimer

Kubernetes has a mechanism to bind an entity (i.e. a service) to the lifetime of another entity (i.e. statefulset or pod). It is critical that, if this mechanism is used, the binding happens to the statefulset, and not a pod. We cannot guaranteed that a pod called mysql-k8s/0 will always exists (i.e. scaling to 0 and back to N units, as unit identifiers do not get reused).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature, UI change, or workload upgrade

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions