Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement changes to plan to use soft delete flag to remove records #356

Open
Tracked by #293
maleck13 opened this issue Jan 27, 2025 · 0 comments
Open
Tracked by #293
Assignees

Comments

@maleck13
Copy link
Contributor

maleck13 commented Jan 27, 2025

Why

Currently we can blindly remove endpoints without any real safety check to ensure that we wont deliver an NXDomain. So we currently avoid situations where that might happen (see below)

What

There are several scenarios in which an endpoint should be removed from the DNS response but we do not do it currently.

  • Gateway is not in a programmed state
  • There are no endpoints behind the backend service
  • The HTTP based health checks are failing

We need a common piece of logic that will allow us to "remove if not the last one".

How

The following labels will be added to the DNS Operator plan considerations:

  • soft_delete
  • stop_soft_delete

A soft_delete label indicates that this record should not be present in the zone, unless removing it would also result in the removal of a record with a stop_soft_delete label.

The stop_soft_delete label would be applied for example to GEO CNAMEs by the kuadrant-operator.

The root host is assumed to have a stop_soft_delete label, even if it is not present.

During the processing of the plan in the dns operator, we need to propagate the soft_delete labels through the DNS tree using the following logic.

  • If a node has the soft_delete label, add this label to all of it's children.
  • If a node has the soft_delete label, check it's parent:
    • If all the parents children have soft_delete label, add it to the parent recursively
  • If the soft_delete label would be added to a node with the stop_soft_delete label, do not add it, and remove the label from all of this nodes children and parents recursively.
  • If the soft_delete label would be added to the root host of the record, remove it from the entire record.

Once propagation by the above rules is completed, if any soft_delete labels remain, they are processed as if they are delete requests.

@maleck13 maleck13 moved this to Todo in Kuadrant Jan 27, 2025
@philbrookes philbrookes moved this from Todo to In Progress in Kuadrant Jan 27, 2025
@maleck13 maleck13 changed the title Safely remove an existing record Safely remove an existing bad record Jan 28, 2025
@maleck13 maleck13 changed the title Safely remove an existing bad record Safely remove a published unhealthy records Jan 28, 2025
@maleck13 maleck13 changed the title Safely remove a published unhealthy records Safely remove published unhealthy records Jan 28, 2025
@philbrookes philbrookes changed the title Safely remove published unhealthy records Add soft delete flag to allow plan to cautiously remove records Jan 28, 2025
@maleck13 maleck13 moved this from In Progress to Ready For Review in Kuadrant Feb 10, 2025
@philbrookes philbrookes moved this from Ready For Review to In Progress in Kuadrant Feb 11, 2025
@maleck13 maleck13 moved this from In Progress to Ready For Review in Kuadrant Feb 11, 2025
@maleck13 maleck13 moved this from Ready For Review to In Progress in Kuadrant Feb 12, 2025
@maleck13 maleck13 changed the title Add soft delete flag to allow plan to cautiously remove records Implement changes to plan to use soft delete flag to remove records Feb 13, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 13, 2025
update tree with propagate logic and tests
@maleck13 maleck13 moved this from In Progress to Ready For Review in Kuadrant Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready For Review
Development

No branches or pull requests

2 participants