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

Changed the Deployment strategy to 'Recreate' so multiple external-dns pods don't conflict with each other. #2772

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

mac-chaffee
Copy link
Contributor

Description

Before the new record format rolls out, it would probably be a good idea to ensure only one external-dns pod is running at that time to avoid any risk of conflicts.

Checklist

  • [n/a] Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 26, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @mac-chaffee!

It looks like this is your first PR to kubernetes-sigs/external-dns 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/external-dns has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 26, 2022
@stevehipwell
Copy link
Contributor

@mac-chaffee this change would be detrimental to the chart, the recreate strategy isn't really for this purpose and the split brain behaviour is controlled by the leader election already. I'd be happy to support having a configurable strategy but I'm 100% against defaulting to recreate.

Also the notes on the change you mentioned say that both types will be supported so I'm not sure why we even need to consider a change here?

If you want to continue with this PR I'll do a more in-depth review on the changes?

@mac-chaffee
Copy link
Contributor Author

Oh external-dns has leader election already? I thought it didn't yet: #164 #2430

@stevehipwell
Copy link
Contributor

Oh external-dns has leader election already? I thought it didn't yet: #164 #2430

No you're right, I was thinking about another project.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 14, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 25, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2022
@mac-chaffee
Copy link
Contributor Author

Rebased, should be good to go now, preferably soon so I don't have to update the release note date ;)

@stevehipwell
Copy link
Contributor

@mac-chaffee I don't think that changing the default chart deployment strategy is necessarily a good idea; do you have an example of what you think could happen and what the actual impact would be? I'm happy for the strategy to be configurable, although IMHO implementing #2430 would be a better solution.

@mac-chaffee
Copy link
Contributor Author

I think the reason why #2430 exists at all (instead of just increasing replicas to 2) kinda hints at the reason: We can't know all of the possible race conditions that could appear when running two external-dns pods at the same time. So it's best to just prevent that all together via Recreate or leader election.

I agree doing leader election would be better, but until that's implemented, I think we're subjecting users to unnecessary risk whenever they do upgrades. Regardless, I think the only downside of this change is that there might be an extra few seconds between syncs after an upgrade since we have to wait for the new pod to start. Do you see a bigger downside?

@stevehipwell
Copy link
Contributor

@mac-chaffee I've just checked the YAML in the examples and it looks like the current chart behaviour isn't consistent with this and your PR will align the behaviour. Just to point out that another downside of recreate is that there is no guarantee that there will be a running pod at the end if there aren't enough resources (rollback wont even fix this) or if the new configuration is invalid.

@Raffo could you enable the workflow?

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2022
@stevehipwell
Copy link
Contributor

@mac-chaffee could you please remove the changes to Chart.yaml from this PR as multiple PRs will be combined for the release (#2916).

@stevehipwell
Copy link
Contributor

/remove-approve

@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2022
@stevehipwell
Copy link
Contributor

@mac-chaffee could you please remove the changes to Chart.yaml from this PR as multiple PRs will be combined for the release (#2916).

@mac-chaffee I'd like to get this merged and into the upcoming release, could you take a look a this?

so multiple external-dns pods don't conflict with each other.

Signed-off-by: Mac Chaffee <[email protected]>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Aug 9, 2022
@mac-chaffee
Copy link
Contributor Author

Sorry, work has been busy!

@stevehipwell
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 10, 2022
@Raffo
Copy link
Contributor

Raffo commented Aug 10, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mac-chaffee, Raffo

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit f10948e into kubernetes-sigs:master Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants