Comments (8)
Sorry, preferedDuringSchedulingIgnoredDuringExecution written in the comment is incorrect. preferredDuringSchedulingIgnoredDuringExecution is correct.
Actually, I set the settings in the comments below to agones-system's allocator.
#3533 (comment)
from agones.
The kubernetes scheduler will generally try to best-effort spread the deployment for the allocator / controller / extensions across nodes, but it will not force spreading. If you have something like 3 nodes in the agones system namespace, it would make sense for us to be able to specify constraints to ensure that the pods don't all land on the same node.
I haven't read too much about the topologySpreadConstraints; I'm wondering if that is something that we can add to the installation yaml in a way that will "just work" (e.g. spread the pods if there are multiple nodes but allow them to be packed if there is only one node) or if this is a field we will need to expose as a new helm parameter.
from agones.
I believe that if you set whenUnsatisfiable: ScheduleAnyway
, it allows to be packed if there is only one node.
https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/#spread-constraint-definition
from agones.
We do support setting arbitrary affinity. Could the same thing not be done with kubernetes.io/hostname
podAntiAffinity
- or does that not work for this use case?
from agones.
Confirmed that with the follwoing podAntiAffinity rules, we can make the spread across zone per component.
Note: you can take topology.kubernetes.io/zone as well.
values.yaml
allocator:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: multicluster.agones.dev/role
operator: In
values:
- allocator
topologyKey: topology.gke.io/zone
As a result of Agones instllation into GKE with 3 nodes/zones.
(⎈ |gke-regular-01:agones-system) ❯ k get pods -o custom-columns="Pod name":.metadata.name,"Node":.spec.nodeName
Pod name Node
agones-allocator-7fbb58b9b-6ppkn gke-gke-regular-01-pool-01-14f53d6d-s44k
agones-allocator-7fbb58b9b-gsrtf gke-gke-regular-01-pool-01-f15e50b8-4d0q
agones-allocator-7fbb58b9b-vgmpz gke-gke-regular-01-pool-01-d0308131-mrl6
agones-controller-658488b8c-8hqzj gke-gke-regular-01-pool-01-14f53d6d-s44k
agones-controller-658488b8c-nkblv gke-gke-regular-01-pool-01-d0308131-mrl6
agones-extensions-56cd877688-6glhq gke-gke-regular-01-pool-01-d0308131-mrl6
agones-extensions-56cd877688-mq5kr gke-gke-regular-01-pool-01-14f53d6d-s44k
agones-ping-6dd86d54c8-95gjt gke-gke-regular-01-pool-01-f15e50b8-4d0q
agones-ping-6dd86d54c8-dwrbl gke-gke-regular-01-pool-01-14f53d6d-s44k
from agones.
Thanks for the suggestion!
In the case of podAntiAffinity, if the number of pods is larger than the number of nodes, I think the zones will not be distributed evenly.
On the other hand, if we use maxSkew in topologySpreadConstraints, we can distribute zones evenly, so I thought topologySpreadConstraints is more appropriate.
However, in my environment, the number of each component of agones-system is not large, so I will use podAntiAffinity.
from agones.
There was a problem, so I reopened this issue.
I would like to adopt topologySpreadConstraints instead of preferedDuringSchedulingIgnoredDuringExecution for the following reasons
- preferredDuringSchedulingIgnoredDuringExecution is not a function to ensure zone distribution.
- In my verification, it was sometimes deployed on one server, and if there are more pods than zones, they are not evenly distributed.
- When using requiredDuringSchedulingIgnoredDuringExecution, if there are the same number of pods as zones, rolling updates will not be possible. New pods cannot be started because there are already pods deployed in each zone.
- we use maxSkew in topologySpreadConstraints, we can distribute zones evenly
from agones.
Out of curiosity - what preferedDuringSchedulingIgnoredDuringExecution
configuration did you use?
from agones.
Related Issues (20)
- Support appProtocol HOT 2
- Agones Controller has OOMKilled in version 1.35.0 HOT 4
- Release 1.36.0 HOT 1
- Move PodHostname to Stable HOT 1
- Move ResetMetricsOnDelete to Stable HOT 1
- Move SplitControllerAndExtensions to Stable HOT 2
- Move FleetAllocationOverflow to Beta HOT 1
- Upgrade all Build Tool to use Docker >= 24.x.x HOT 13
- Missing agones_k8s_client_cache_* metrics in GKE Autopilot Cluster HOT 1
- Type is a reserved word in rust HOT 2
- "the object has been modified" errors seen during allocation HOT 3
- gameServerSetCacheEntry doesn`t return updated gs HOT 7
- fleet controller maybe need a state cache HOT 3
- Release 1.37.0 HOT 1
- Service account permissions for logging HOT 1
- Upgrade from Debian Bullseye to Bookworm HOT 10
- Counters: Default capacity should be 0 (max), not 1000 HOT 5
- Change the way we initialize the kubernetes client to prevent spurious log warnings HOT 1
- Simple Game Server: add "\n" to responses to Counters and Lists HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agones.