Commit f743dbb
authored
Merge pull request juju#23105 from SimonRichardson/rollout-pods
juju#23105
When reconciling the units during scaling, we previously always scaled from top down - so if you had 0,1,2 and scaled down by one at a time, it would do 0,1 and then 0. This is normally fine, but it doesn't allow you to rollout the oldest unit (or pod in this instance). For instance, if you had new constraints (think affinities) then you'd have to scale to zero, thus removing all pods. This is very unfortunate. Instead, if we scale from bottom up, we can then roll in new units (pods) with new constraints, allowing for a more fluid system.
This was spotted when testing juju#23076 and wanting to scale back down.
## QA steps
```sh
$ juju bootstrap microk8s test
$ juju add-model foo
$ juju deploy prometheus-k8s prom -n 3
$ juju remove-unit prom --num-units=2
```
Removes 0, 1.
## Links
**Jira card:** [JUJU-10258](https://warthogs.atlassian.net/browse/JUJU-10258)
[JUJU-10258]: https://warthogs.atlassian.net/browse/JUJU-10258?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ4 files changed
Lines changed: 440 additions & 23 deletions
File tree
- apiserver
- internal/worker/caasapplicationprovisioner
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
634 | 635 | | |
635 | 636 | | |
636 | 637 | | |
637 | | - | |
| 638 | + | |
638 | 639 | | |
| 640 | + | |
639 | 641 | | |
640 | 642 | | |
641 | | - | |
642 | | - | |
| 643 | + | |
643 | 644 | | |
644 | 645 | | |
645 | 646 | | |
| |||
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
679 | 683 | | |
680 | 684 | | |
681 | 685 | | |
| |||
729 | 733 | | |
730 | 734 | | |
731 | 735 | | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
| 736 | + | |
741 | 737 | | |
742 | 738 | | |
743 | 739 | | |
| |||
773 | 769 | | |
774 | 770 | | |
775 | 771 | | |
| 772 | + | |
776 | 773 | | |
777 | 774 | | |
778 | | - | |
779 | | - | |
| 775 | + | |
780 | 776 | | |
781 | 777 | | |
782 | 778 | | |
| |||
802 | 798 | | |
803 | 799 | | |
804 | 800 | | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
805 | 823 | | |
806 | 824 | | |
807 | 825 | | |
| |||
0 commit comments