gardener / etcd-druid

An etcd operator to configure, provision, reconcile and monitor etcd clusters.
Apache License 2.0
70 stars 49 forks source link

Remove unneeded resources upon etcd-cluster scaling down to 0 #860

Open unmarshall opened 1 month ago

unmarshall commented 1 month ago

How to categorize this issue?

/area control-plane /kind enhancement

What would you like to be added: When an etcd cluster is scaled down to 0 then we do the following changes to the resources in the etcd cluster:

  1. All pods are deleted - this is expected.
  2. PVC's are preserved - this we now tackle via https://github.com/gardener/etcd-druid/issues/859.
  3. Member & Snapshot leases are preserved with now stale information - this is unexpected.
  4. Client and Peer service are preserved - this is unexpected.
  5. ServiceAccount, role and role-bindings are preserved - should we retain these?
  6. ConfigMap is updated to reflect the current state of the etcd cluster - while the update is expected, do we need the CM?
  7. PDB is updated and now has a minAvailable set to 0 - while the update is expected, do we need the PDB?

We should ensure that all resources that are not needed any longer should be removed as well once the etcd cluster is scaled down to 0. If and when the etcd cluster is scale up again, these resources will be created again.

Why is this needed: To bring harmony across all resource states that are created for a etcd cluster. Today we have mixed behavior.