Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Eviction controller #942

Merged
merged 29 commits into from
Dec 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8c739d6
Eviction controller
Arvindthiru Oct 31, 2024
e7acdc2
handle multiple CRB
Arvindthiru Nov 13, 2024
0b76225
minor changes
Arvindthiru Nov 13, 2024
9a2a9e2
fix test name
Arvindthiru Nov 14, 2024
2748aef
address comment
Arvindthiru Nov 15, 2024
deeef0f
address comments
Arvindthiru Nov 19, 2024
fef7ccc
address comments
Arvindthiru Nov 21, 2024
eaaa882
add more logs
Arvindthiru Nov 21, 2024
c94ee87
address offline comment
Arvindthiru Nov 22, 2024
258fa86
revert logic change, handle deleting binding
Arvindthiru Nov 22, 2024
d6e1f48
fix spelling
Arvindthiru Nov 22, 2024
0c203d8
minor changes
Arvindthiru Nov 22, 2024
d56286d
minor changes, add more UTs
Arvindthiru Nov 22, 2024
47c9264
fix test obj
Arvindthiru Nov 22, 2024
d9cf280
address comment
Arvindthiru Nov 26, 2024
452e745
remove ordered marker
Arvindthiru Nov 26, 2024
1408051
address minor comments
Arvindthiru Nov 27, 2024
7c15612
refactor validation, address comments
Arvindthiru Dec 3, 2024
3d53ee8
fix ITs
Arvindthiru Dec 3, 2024
cb1320d
add UTs
Arvindthiru Dec 3, 2024
17de1c4
add validation UT, remove validation IT
Arvindthiru Dec 4, 2024
e42bc47
add resourceVersion check for delete
Arvindthiru Dec 4, 2024
adbd2f4
address comment, refactor code, tests
Arvindthiru Dec 6, 2024
e10538c
minor changes
Arvindthiru Dec 6, 2024
e00459a
fix UT name
Arvindthiru Dec 6, 2024
73a673b
fix special check
Arvindthiru Dec 6, 2024
4e37470
minor changes
Arvindthiru Dec 6, 2024
d8e77f6
address comments
Arvindthiru Dec 6, 2024
19e0287
make manifests
Arvindthiru Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions apis/placement/v1alpha1/disruptionbudget_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ type PlacementDisruptionBudgetSpec struct {
// * if the linked Placement object is of the PickFixed placement type,
// the percentage is against the number of clusters specified in the placement (i.e., the
// length of ClusterNames field in the placement policy);
// * if the linked Placement object is of the PickAll placement type,
// the percentage is against the total number of clusters being selected by the scheduler
// at the time of the evaluation of the disruption budget;
// * if the linked Placement object is of the PickAll placement type, MaxUnavailable cannot
// be specified since we cannot derive the total number of clusters selected.
// * if the linked Placement object is of the PickN placement type,
// the percentage is against the number of clusters specified in the placement (i.e., the
// value of the NumberOfClusters fields in the placement policy).
Expand Down Expand Up @@ -77,9 +76,8 @@ type PlacementDisruptionBudgetSpec struct {
// * if the linked Placement object is of the PickFixed placement type,
// the percentage is against the number of clusters specified in the placement (i.e., the
// length of ClusterNames field in the placement policy);
// * if the linked Placement object is of the PickAll placement type,
// the percentage is against the total number of clusters being selected by the scheduler
// at the time of the evaluation of the disruption budget;
// * if the linked Placement object is of the PickAll placement type, MinAvailable can be
// specified but only as an integer since we cannot derive the total number of clusters selected.
// * if the linked Placement object is of the PickN placement type,
// the percentage is against the number of clusters specified in the placement (i.e., the
// value of the NumberOfClusters fields in the placement policy).
Expand Down
13 changes: 13 additions & 0 deletions apis/placement/v1alpha1/eviction_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Licensed under the MIT license.
package v1alpha1

import (
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -118,6 +119,18 @@ type ClusterResourcePlacementEvictionList struct {
Items []ClusterResourcePlacementEviction `json:"items"`
}

// SetConditions set the given conditions on the ClusterResourcePlacementEviction.
func (e *ClusterResourcePlacementEviction) SetConditions(conditions ...metav1.Condition) {
for _, c := range conditions {
meta.SetStatusCondition(&e.Status.Conditions, c)
}
}

// GetCondition returns the condition of the given ClusterResourcePlacementEviction.
func (e *ClusterResourcePlacementEviction) GetCondition(conditionType string) *metav1.Condition {
return meta.FindStatusCondition(e.Status.Conditions, conditionType)
}

func init() {
SchemeBuilder.Register(
&ClusterResourcePlacementEviction{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ spec:
* if the linked Placement object is of the PickFixed placement type,
the percentage is against the number of clusters specified in the placement (i.e., the
length of ClusterNames field in the placement policy);
* if the linked Placement object is of the PickAll placement type,
the percentage is against the total number of clusters being selected by the scheduler
at the time of the evaluation of the disruption budget;
* if the linked Placement object is of the PickAll placement type, MaxUnavailable cannot
be specified since we cannot derive the total number of clusters selected.
* if the linked Placement object is of the PickN placement type,
the percentage is against the number of clusters specified in the placement (i.e., the
value of the NumberOfClusters fields in the placement policy).
Expand Down Expand Up @@ -113,9 +112,8 @@ spec:
* if the linked Placement object is of the PickFixed placement type,
the percentage is against the number of clusters specified in the placement (i.e., the
length of ClusterNames field in the placement policy);
* if the linked Placement object is of the PickAll placement type,
the percentage is against the total number of clusters being selected by the scheduler
at the time of the evaluation of the disruption budget;
* if the linked Placement object is of the PickAll placement type, MinAvailable can be
specified but only as an integer since we cannot derive the total number of clusters selected.
* if the linked Placement object is of the PickN placement type,
the percentage is against the number of clusters specified in the placement (i.e., the
value of the NumberOfClusters fields in the placement policy).
Expand Down
Loading
Loading