File tree Expand file tree Collapse file tree 3 files changed +6
-17
lines changed
pkg/repository/maintenance Expand file tree Collapse file tree 3 files changed +6
-17
lines changed Original file line number Diff line number Diff line change 1+ Maintenance Job only uses the first element of the LoadAffinity array
Original file line number Diff line number Diff line change @@ -671,7 +671,8 @@ func buildJob(
671671 }
672672
673673 if config != nil && len (config .LoadAffinities ) > 0 {
674- affinity := kube .ToSystemAffinity (config .LoadAffinities )
674+ // Maintenance job only takes the first loadAffinity.
675+ affinity := kube .ToSystemAffinity ([]* kube.LoadAffinity {config .LoadAffinities [0 ]})
675676 job .Spec .Template .Spec .Affinity = affinity
676677 }
677678
Original file line number Diff line number Diff line change 7777 },
7878 "keepLatestMaintenanceJobs": 1,
7979 "loadAffinity": [
80- {
81- "nodeSelector": {
82- "matchExpressions": [
83- {
84- "key": "cloud.google.com/machine-family",
85- "operator": "In",
86- "values": [
87- "e2"
88- ]
89- }
90- ]
91- }
92- },
9380 {
9481 "nodeSelector": {
9582 "matchExpressions": [
@@ -119,10 +106,10 @@ data:
119106 }
120107EOF
121108` ` `
122- This sample showcases two affinity configurations :
123- - matchLabels : maintenance job runs on nodes with label key `cloud.google.com/machine-family` and value `e2`.
109+ Notice : although loadAffinity is an array, Velero only takes the first element of the array.
110+
111+ This sample showcases how to use affinity configuration :
124112- matchLabels : maintenance job runs on nodes located in `us-central1-a`, `us-central1-b` and `us-central1-c`.
125- The nodes matching one of the two conditions are selected.
126113
127114To create the configMap, users need to save something like the above sample to a json file and then run below command :
128115` ` `
You can’t perform that action at this time.
0 commit comments