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 topologySpreadConstraints to Deployment #859

Merged
merged 4 commits into from
Jul 24, 2023
Merged

Conversation

sgametrio
Copy link
Contributor

@sgametrio sgametrio commented Jul 1, 2023

Description of changes: When using a single replica, it can happen that the Node on which the aws-node-termination-handler Pod is running gets terminated. If this happens then, the Pod can't listen for the event and detect it to handle it gracefully.

Running a HA aws-node-termination-handler helps in dealing with this by reducing probability that all the replicas gets terminated at the same time, but doesn't guarantee that the replicas are scheduled on different nodes.

By introducing .Values.topologySpreadConstraints field we allow optional forcing of scheduling pods on different nodes, therefore reducing to ~0 the possibility that no Pods are available to listen for events.

Example of using topologySpreadConstraints

topologySpreadConstraints:
    - maxSkew: 1
      topologyKey: kubernetes.io/hostname
      whenUnsatisfiable: DoNotSchedule

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@sgametrio sgametrio marked this pull request as ready for review July 1, 2023 05:37
@sgametrio sgametrio requested a review from a team as a code owner July 1, 2023 05:37
@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want this PR to never become stale, please ask a maintainer to apply the "stalebot-ignore" label.

@github-actions github-actions bot added the stale Issues / PRs with no activity label Jul 16, 2023
@jillmon jillmon added stalebot-ignore To NOT let the stalebot update or close the Issue / PR and removed stale Issues / PRs with no activity labels Jul 19, 2023
@cjerad cjerad self-requested a review July 19, 2023 18:07
Copy link
Contributor

@cjerad cjerad left a comment

Choose a reason for hiding this comment

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

Hi @sgametrio! Thanks for the PR. Please add the new value to the list in config/helm/aws-node-termination-handler/README.md.

@sgametrio
Copy link
Contributor Author

Hi @cjerad Thanks for the comment. I updated the file as you suggested. Please feel free to suggest any re-wording or further changes.

Copy link
Contributor

@cjerad cjerad left a comment

Choose a reason for hiding this comment

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

Thanks!

@cjerad cjerad merged commit 2e82ab1 into aws:main Jul 24, 2023
11 checks passed
@sgametrio sgametrio deleted the patch-1 branch July 25, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stalebot-ignore To NOT let the stalebot update or close the Issue / PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants