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

Topology spread vs pod anti affinity #613

Open
mbyio opened this issue Aug 28, 2024 · 1 comment
Open

Topology spread vs pod anti affinity #613

mbyio opened this issue Aug 28, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@mbyio
Copy link

mbyio commented Aug 28, 2024

Which version of kube-score are you using?

kube-score version: 1.18.0

What did you do?

A deployment has a topology spread constraint like this:

- maxSkew: 4
  minDomains: 3
  topologyKey: kubernetes.io/hostname
  whenUnsatisfiable: DoNotSchedule
  labelSelector:
    matchLabels:
    # ...
  matchLabelKeys:
    - pod-template-hash
- maxSkew: 1
  minDomains: 2
  topologyKey: topology.kubernetes.io/zone
  whenUnsatisfiable: DoNotSchedule
  labelSelector:
    matchLabels:
      # ...
  matchLabelKeys:
    - pod-template-hash

What did you expect to see?

This topology spread constraint will force the deployment to spread pods across multiple nodes and zones. It is about as safe as the pod anti affinity rule, and it is more efficient, because we can have multiple pods on the same node.

What did you see instead?

kube-score fails with a warning about missing a pod anti-affinity rule. In this case, an anti-affinity rule would force every pod to be on its own node, which would be inefficient.

@zegl
Copy link
Owner

zegl commented Oct 13, 2024

Agreed, it would be nice if kube-score supported handling topology spread constraints. PRs are welcome!

@zegl zegl added the help wanted Extra attention is needed label Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants