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

Admission controller missing topology spread or pod Anti affinity to avoid scheduling webhook controllers on the same node #250

Open
sidewinder12s opened this issue Feb 8, 2023 · 2 comments

Comments

@sidewinder12s
Copy link

This can cause outages if the node goes down

@blang9238
Copy link
Contributor

Hey @sidewinder12s the deployment template actually has the affinity, we just don't have a placeholder in the values.yaml.

https://github.com/anchore/anchore-charts/blob/main/stable/anchore-admission-controller/templates/deployment.yaml#L81C7-L81C32

https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#more-practical-use-cases

You should be able to assign antiAffinity with something like the following in your values.yaml:

affinity:
  podAntiAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
    - labelSelector:
        matchExpressions:
        - key: app
          operator: In
          values:
          - store
      topologyKey: "kubernetes.io/hostname"

@sidewinder12s
Copy link
Author

TopologySpreadConstraint is the Kubernetes recommended configuration for this type requirement.

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

No branches or pull requests

2 participants