From 63ff9890699e0a852d5030015b4b7906686a5782 Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Tue, 21 Jan 2025 20:20:43 +0530 Subject: [PATCH] address minor comments --- .../EvictionAndDisruptionBudget/README.md | 24 +++++++++++++++---- .../eviction-placement-disruption-budget.md | 11 ++++----- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/docs/concepts/EvictionAndDisruptionBudget/README.md b/docs/concepts/EvictionAndDisruptionBudget/README.md index 8a1361571..65cb0d2d7 100644 --- a/docs/concepts/EvictionAndDisruptionBudget/README.md +++ b/docs/concepts/EvictionAndDisruptionBudget/README.md @@ -6,13 +6,26 @@ This document explains the concept of `Eviction` and `Placement Disruption Budge `Eviction` pertains to the act of removing resources from a target cluster propagated by a resource placement object from the hub cluster. -The `Placement Disruption Budget` object protects against voluntary disruption, and in the case of the fleet, the only allowed voluntary disruption as of now is eviction. +The `Placement Disruption Budget` object protects against voluntary disruptions. + +The only voluntary disruption that can occur in the fleet is the eviction of resources from a target cluster which can be achieved by creating the `ClusterResourcePlacementEviction` object + +Some cases of involuntary disruptions in the context of fleet, +- The removal of resources from a member cluster by the scheduler due to scheduling policy changes +- Users manually deleting workload resources running on a member cluster +- Users manually deleting the `ClusterResourceBinding` object which is an internal resource the represents the placement of resources on a member cluster +- Workloads failing to run properly on a member cluster due to misconfiguration or cluster related issues. + +For all the cases of involuntary disruptions described above, the `Placement Disruption Budget` object does not protect against them. ## ClusterResourcePlacementEviction An eviction object is used to remove resources from a member cluster once the resources have already been propagated from the hub cluster. -Once the resources are successfully removed or if eviction cannot be executed, the eviction object won't be reconciled again. +The eviction object is only reconciled once after which it reaches a terminal state. List of terminal states for `ClusterResourcePlacementEviction`, +- `ClusterResourcePlacementEviction` is valid and it's executed successfully +- `ClusterResourcePlacementEviction` is invalid +- `ClusterResourcePlacementEviction` is valid but it's not executed To successfully evict resources from a cluster, the user needs to specify: @@ -21,11 +34,12 @@ To successfully evict resources from a cluster, the user needs to specify: When specifying the `ClusterResourcePlacement` object in the eviction's spec, the user needs to consider the following cases: -- For `PickFixed` CRP, eviction is not allowed because if users wanted to remove resources from a cluster, they could choose to remove the cluster name from the `ClusterResourcePlacement` spec or pick a different cluster. +- For `PickFixed` CRP, eviction is not allowed it is recommended that one directly edit the list of target clusters on the CRP object. - For `PickAll` & `PickN` CRPs, eviction is allowed because the users cannot deterministically pick or unpick a cluster based on the placement strategy; it's up to the scheduler. -> **Note:** After an eviction is executed, there is no guarantee that the cluster won't be picked again by the scheduler to propagate resources for a `Placement` resource. -> The user needs to specify a taint on the cluster to prevent the scheduler from picking the cluster again. +> **Note:** After an eviction is executed, there is no guarantee that the cluster won't be picked again by the scheduler to propagate resources for a `ClusterResourcePlacement` resource. +> The user needs to specify a [taint](../../howtos/taint-toleration.md) on the cluster to prevent the scheduler from picking the cluster again. This is especially true for `PickAll ClusterResourcePlacement` because +> the scheduler will try to propagate resources to all the clusters in the fleet. ## ClusterResourcePlacementDisruptionBudget diff --git a/docs/howtos/eviction-placement-disruption-budget.md b/docs/howtos/eviction-placement-disruption-budget.md index e74678ee1..ce26aa837 100644 --- a/docs/howtos/eviction-placement-disruption-budget.md +++ b/docs/howtos/eviction-placement-disruption-budget.md @@ -1,17 +1,17 @@ # Using ClusterResourcePlacementEviction and ClusterResourcePlacementDisruptionBudget -This how-to guide discusses how to create ClusterResourcePlacementEviction objects and ClusterResourcePlacementDisruptionBudget objects to evict resources from member clusters and protect resources on member clusters from voluntary disruption, respectively. +This how-to guide discusses how to create `ClusterResourcePlacementEviction` objects and `ClusterResourcePlacementDisruptionBudget` objects to evict resources from member clusters and protect resources on member clusters from voluntary disruption, respectively. ## Evicting Resources from Member Clusters using ClusterResourcePlacementEviction -The ClusterResourcePlacementEviction object is used to remove resources from a member cluster once the resources have already been propagated from the hub cluster. +The `ClusterResourcePlacementEviction` object is used to remove resources from a member cluster once the resources have already been propagated from the hub cluster. To successfully evict resources from a cluster, the user needs to specify: -- The name of the ClusterResourcePlacement object which propagated resources to the target cluster +- The name of the `ClusterResourcePlacement` object which propagated resources to the target cluster - The name of the target cluster from which we need to evict resources. -In this example, we will create a `ClusterResourcePlacement` object with PickAll placement policy to propagate resources to an existing MemberCluster, add a taint to the member cluster -resource and then create a ClusterResourcePlacementEviction object to evict resources from the MemberCluster. +In this example, we will create a `ClusterResourcePlacement` object with PickAll placement policy to propagate resources to an existing `MemberCluster`, add a taint to the member cluster +resource and then create a `ClusterResourcePlacementEviction` object to evict resources from the `MemberCluster`. We will first create a namespace that we will propagate to the member cluster @@ -306,7 +306,6 @@ status: name: test-ns version: v1 ``` -> **Note:** The `ClusterResourcePlacementDisruptionBudget` object is only used as an information source by the eviction controller and hence it doesn't have a status associated to it. Now we will create a `ClusterResourcePlacementDisruptionBudget` object to protect resources on the member cluster from voluntary disruption: