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

Add rabbitmq.com/disable-default-topology-spread-constraints annotation #1694

Conversation

DanielDorado
Copy link
Contributor

@DanielDorado DanielDorado commented Aug 7, 2024

When the annotation rabbitmq.com/disable-default-topology-spread-constraints is set to "true", the default topologySpreadConstraints based on label topology.kubernetes.io/zone is omitted.

As @Zerpet suggested in issue #1687, I added the annotation to skip the default topology constraint configuration because the override was not working as expected ( #1690 ), and @mkuratczyk was not satisfied with the behavior.

This closes #1687

Note to reviewers: Remember to look at the commits in this PR and consider if they can be squashed

Summary Of Changes

When a user adds the annotation rabbitmq.com/disable-default-topology-spread-constraints: "true" in their RabbitMQCluster custom resource, the default topology spread constraint is omitted.

Additional Context

Local Testing

Please ensure you run the unit, integration and system tests before approving the PR.

To run the unit and integration tests:

$ make unit-tests integration-tests

You will need to target a k8s cluster and have the operator deployed for running the system tests.

For example, for a Kubernetes context named dev-bunny:

$ kubectx dev-bunny
$ make destroy deploy-dev
# wait for operator to be deployed
$ make system-tests

@Zerpet
Copy link
Collaborator

Zerpet commented Aug 14, 2024

@DanielDorado the code changes look good. Can you rebase this PR on top of main ?

I just fixed our CI, and GitHub Actions picks the workflow file from the branch-off commit (that has a broken CI).

When the annotation rabbitmq.com/disable-default-topology-spread-constraints is set to "true" the default
topologySpreadConstraints based on label topology.kubernetes.io/zone is ommited.
@DanielDorado DanielDorado force-pushed the GH-1687-disable-default-topology-spread-constraints-annotation branch from e6d16e0 to 82415be Compare August 14, 2024 11:50
@DanielDorado
Copy link
Contributor Author

@Zerpet done.

Copy link
Collaborator

@Zerpet Zerpet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did the following QA:

  • Deploy with the annotation ✅ deploys without the default spread constraint
  • Deploy with annotation + override ✅ deploys with just the spread constraints in the override
  • Deploy without the annotation + override ✅ deploys with both, the default and the override

@Zerpet Zerpet added this to the 2.10.0 milestone Aug 14, 2024
@Zerpet Zerpet merged commit ea66e59 into rabbitmq:main Aug 14, 2024
16 checks passed
@Zerpet
Copy link
Collaborator

Zerpet commented Aug 14, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support override default topologySpreadContraints
2 participants