templates/composer: Add podAntiAffinity rule based on hostname
Linter output: Specify anti-affinity in your pod specification to ensure that the orchestrator attempts to schedule replicas on different nodes. Using podAntiAffinity, specify a labelSelector that matches pods for the deployment, and set the topologyKey to kubernetes.io/hostname.
This commit is contained in:
parent
2208cb1122
commit
b91400fd92
1 changed files with 9 additions and 0 deletions
|
|
@ -36,6 +36,15 @@ objects:
|
|||
app: composer
|
||||
spec:
|
||||
serviceAccountName: image-builder
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app: composer
|
||||
topologyKey: kubernetes.io/hostname
|
||||
containers:
|
||||
- image: "${IMAGE_NAME}:${IMAGE_TAG}"
|
||||
name: composer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue