Skip to content

Commit

Permalink
ensure db pods live on seperate worker nodes (#620)
Browse files Browse the repository at this point in the history
* ensure db pods live on seperate control-plane nodes

* change to using instance name to help pod sprawl against operator
  • Loading branch information
rackerchris authored Dec 11, 2024
1 parent d26cdb6 commit 5f10f6b
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion base-kustomize/mariadb-cluster/base/mariadb-replication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,33 @@ spec:
database: mariadb
image: mariadb:10.11.7

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/worker
operator: In
values:
- worker
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- mariadb-cluster
topologyKey: kubernetes.io/hostname

storage:
size: 10Gi
storageClassName: general
resizeInUseVolumes: true
waitForVolumeResize: true
volumeClaimTemplate:
accessModes:
- ReadWriteOnce
- ReadWriteOnce
resources:
requests:
storage: 10Gi
Expand Down

0 comments on commit 5f10f6b

Please sign in to comment.