Move constraints to the controller only

This commit is contained in:
Daniel Berteaud 2024-04-03 09:12:44 +02:00
parent 38bd6e04c9
commit 7a2d1fe9a6
4 changed files with 12 additions and 24 deletions

View File

@ -1,6 +1,6 @@
job "[[ .instance ]]-controller" {
[[ $c := merge .democratic_csi.controller .democratic_csi . -]]
[[ $c := merge .democratic_csi . -]]
[[- template "common/job_start" $c ]]
@ -8,6 +8,8 @@ job "[[ .instance ]]-controller" {
group "[[ $proto ]]-controller" {
[[ $c := merge $c.controller $c ]]
count = [[ $c.count ]]
[[ template "common/constraints" $c ]]

View File

@ -6,15 +6,12 @@ job "democratic-csi-controller" {
priority = 90
constraint {
operator = "distinct_hosts"
value = "true"
}
group "iscsi-controller" {
count = 1
@ -163,6 +160,8 @@ _EOF
group "nfs-controller" {
count = 1

View File

@ -6,22 +6,12 @@ job "democratic-csi-node" {
priority = 90
constraint {
operator = "distinct_hosts"
value = "true"
}
group "iscsi-node" {
constraint {
operator = "distinct_hosts"
value = "true"
}
service {
name = "democratic-csi-iscsi-node"
@ -139,11 +129,6 @@ _EOF
constraint {
operator = "distinct_hosts"
value = "true"
}
service {
name = "democratic-csi-nfs-node"

View File

@ -18,15 +18,17 @@ democratic_csi:
nomad:
# Set a high priority as CSI controllers and nodes are required for a lot of jobs
priority: 90
constraints:
- operator: distinct_hosts
value: true
# Settings for controllers
controller:
# Number of controler instances
count: 1
nomad:
constraints:
- operator: distinct_hosts
value: true
# Resource allocation for controllers
resources:
cpu: 100