Skip to content

Handle stale information/clean up stale resources #72

@lfrancke

Description

@lfrancke

Currently our operators will not act on removed information from the CR in some/most/all cases.

One example:
HBase operator has three roles (master, regionServer, restServer). If I create a HBase server CR with a restServer component and then remove it later (entirely, not setting replicas to 0) our operator will not clean up the STS that belongs to this role.

Proposed solution

Since operator-rs 0.24.0 there is a ClusterResource struct which is used to find and track Kubernetes resources belonging to a Cluster object. An example of its usage can be found in the Superset Operator: https://github.com/stackabletech/superset-operator/blob/main/rust/operator-binary/src/superset_controller.rs#L241

Acceptance criteria

  • This is done when all stale Kubernetes resources are cleaned up. A resource becomes stale when it's not part of the current cluster definition anymore.
  • The AirflowDB resource is excluded from this recycling process.
  • Also referenced ConfigMaps and PersistenVolumeClaims are not deleted.
  • There is at least one test.
  • Documentation on operator implementation is updated with information regarding handling of stale resources.
  • Upgrade to the latest operator-rs version (0.25 at the moment)

NOTE: This is part of an epic (stackabletech/issues#203) and might not apply to this operator. If that is the case please comment on this issue and just close it. This issue was created as part of a special bulk creation operation.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions