applicationset-progressive-sync
applicationset-progressive-sync copied to clipboard
Support maxTargets and maxParallel with % values
The ProgressiveSync CRD is designed as to support maxTargets
and maxParallel
as IntOrString.
Consider the following scenario, when you have 4 clusters and a ProgressiveSync similar to
[...]
stages:
- name: one cluster
maxTargets: 1
maxParallel: 1
targets:
clusters:
selector:
name: cluster-one
- name: everything else
maxTargets: 100%
maxParallel: 25%
targets:
clusters:
selector: {}
In the second stage, we would expect maxTargets to be 3
, but instead we set it to 4
. This is because the scheduler looks at every application matching the label selector - in this case all of them.
We need to change this logic so when we express maxTargets and maxParallel as %, they are scaled against the remaining clusters.