Utilizing tolerations and the default PodAntiAffinity that comes with the chart, we can only use tolerations to force the chart to only run on our eu-central-1 nodes. Tolerations depend on node taints, so for our first step, we will need to taint each node with its specific label.
For node 1a, I will be applying a taint named “dedicated=node-eu-a:NoSchedule”:
kubectl taint nodes ip-10-0-0-5.eu-central-1.compute.internal dedicated=node-eu-a:NoSchedule
For node 1b, I will be applying a taint named “dedicated=node-eu-b:NoSchedule”:
kubectl taint nodes ip-10-0-1-168.eu-central-1.compute.internal dedicated=node-eu-b:NoSchedule
Now in our values.yaml, we can apply a Toleration rule where our Pods will only be able to schedule on both of our nodes, based on the taints that we gave them.
For example:
artifactory: replicatCount: 2 tolerations: - key: "dedicated" operator: "Equal" value: "node-eu-a" effect: "NoSchedule" - key: "dedicated" operator: "Equal" value: "node-eu-b" effect: "NoSchedule"
With the above configurations, we only limit our pods to schedule specifically on both of our nodes based on the taints that we gave, and with the flexibility of the default PodAntiAffinity, each pod will deploy on a separate node.
If you are using the bundled Nginx and Postgresql that comes with the chart, and you want it on one of the nodes, we will have to also configure it’s tolerations as well:
artifactory: replicaCount: 2 tolerations: - key: "dedicated" operator: "Equal" value: "node-eu-a" effect: "NoSchedule" - key: "dedicated" operator: "Equal" value: "node-eu-b" effect: "NoSchedule" postgresql: primary: tolerations: - key: "dedicated" operator: "Equal" value: "node-eu-a" effect: "NoSchedule" nginx: tolerations: - key: "dedicated" operator: "Equal" value: "node-eu-b" effect: "NoSchedule"
The above example will force Postgres to deploy on 1a, and Nginx on 1b, but you can configure it however you like.