Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvind Thirumurugan committed Jan 20, 2025
1 parent 0e327a0 commit 94344fc
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
12 changes: 6 additions & 6 deletions docs/concepts/EvictionAndDisruptionBudget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,24 @@ The `Placement Disruption Budget` object protects against voluntary disruption,

An eviction object is used to remove resources from a member cluster once the resources have already been propagated from the hub cluster.

As mentioned, the creation of an eviction object indicates that resources need to be removed from a member cluster, and once the resources are successfully removed or if eviction cannot be executed, the eviction object won't be reconciled again.
Once the resources are successfully removed or if eviction cannot be executed, the eviction object won't be reconciled again.

To successfully evict resources from a cluster, the user needs to specify:

- The name of the `Placement` object which propagated resources to the target cluster
- The name of the target cluster from which we need to evict resources.
- 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

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 `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 `ClusterResourcePlacement`.
> **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.
## ClusterResourcePlacementDisruptionBudget

The `ClusterResourcePlacementDisruptionBudget` is used to protect resources propagated by a `ClusterResourcePlacement` to a target cluster from voluntary disruption, i.e., `eviction`.
The `ClusterResourcePlacementDisruptionBudget` is used to protect resources propagated by a `ClusterResourcePlacement` to a target cluster from voluntary disruption, i.e., `ClusterResourcePlacementEviction`.

> **Note:** When specifying a `ClusterResourcePlacementDisruptionBudget`, the name should be the same as the `ClusterResourcePlacement` that it's trying to protect.
Expand All @@ -43,5 +43,5 @@ Users are allowed to specify one of two fields in the `ClusterResourcePlacementD
When specifying a disruption budget for a particular `ClusterResourcePlacement`, the user needs to consider the following cases:

- For `PickFixed` CRP, whether a `ClusterResourcePlacementDisruptionBudget` is specified or not, if an eviction is carried out, the user will receive an invalid eviction error message in the eviction status.
- For `PickAll` CRP, if a `ClusterResourcePlacementDisruptionBudget` is specified and the `MaxUnavailable` field is set, the user will receive a misconfigured placement disruption budget error message in the eviction status.
- For `PickAll` CRP, if a `ClusterResourcePlacementDisruptionBudget` is specified and the `MaxUnavailable` field is set, the user will receive a misconfigured placement disruption budget error message in the eviction status because total number of clusters selected is non-deterministic.
- For `PickN` CRP, if a `ClusterResourcePlacementDisruptionBudget` is specified, the user can either set `MaxUnavailable` or `MinAvailable` field since the fields are mutually exclusive.
3 changes: 3 additions & 0 deletions docs/concepts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ Allow slightly different manifests depends on the cluster it lands.

## [PropertyProvider](PropertyProviderAndClusterProperties/README.md)
More ways to select the clusters based on its property.

## [Eviction & Placement Disruption Budget](EvictionAndDisruptionBudget/README.md)
Understand how placements can be evicted and protected from voluntary disruptions in fleet.
24 changes: 12 additions & 12 deletions docs/howtos/eviction-placement-disruption-budget.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How-to Guide: To evict resources from member clusters using ClusterResourcePlacementEviction and protect resources on member clusters from voluntary disruption using ClusterResourcePlacementDisruptionBudget
# 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.

Expand All @@ -10,7 +10,7 @@ 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 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
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
Expand Down Expand Up @@ -122,7 +122,7 @@ status:
version: v1
```
let's now add a taint to the member cluster to ensure this cluster is not picked again one we evict resources from it.
let's now add a taint to the member cluster to ensure this cluster is not picked again by the scheduler once we evict resources from it.
Modify the cluster object to add a taint:
Expand Down Expand Up @@ -151,7 +151,7 @@ spec:
clusterName: kind-cluster-1
```

the eviction status let's us know if the eviction was successful:
the eviction status lets us know if the eviction was successful:

```yaml
status:
Expand All @@ -170,7 +170,7 @@ status:
type: Executed
```

since the eviction is successful, the resources should be removed from the cluster let's take a look at the CRP object's status to confirm:
since the eviction is successful, the resources should be removed from the cluster, let's take a look at the CRP object's status to verify:

```yaml
status:
Expand All @@ -193,9 +193,9 @@ The status shows that the resources have been removed from the cluster and the o

## Protecting resources from voluntary disruptions using ClusterResourcePlacementDisruptionBudget

In this example, we will create a ClusterResourcePlacement object with PickN placement policy to propagate resources to an existing MemberCluster,
then create a ClusterResourcePlacementDisruptionBudget object to protect resources on the MemberCluster from voluntary disruption and
then try to evict resources from the MemberCluster.
In this example, we will create a `ClusterResourcePlacement` object with PickN placement policy to propagate resources to an existing MemberCluster,
then create a `ClusterResourcePlacementDisruptionBudget` object to protect resources on the MemberCluster from voluntary disruption and
then try to evict resources from the MemberCluster using `ClusterResourcePlacementEviction`.

We will first create a namespace that we will propagate to the member cluster

Expand Down Expand Up @@ -306,8 +306,8 @@ 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 at the moment.
>
> **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:

```yaml
Expand All @@ -319,7 +319,7 @@ spec:
minAvailable: 1
```

> **Note:** An eviction object is only reconciled once after which it reaches a terminal state, if the user desires to use the same eviction object they need to delete the existing eviction object and re-create the object for the eviction to occur again.
> **Note:** An eviction object is only reconciled once, after which it reaches a terminal state, if the user desires to use the same eviction object again they need to delete the existing eviction object and re-create the object for the eviction to occur.

Now we will create a `ClusterResourcePlacementEviction` object to evict resources from the member cluster:

Expand Down Expand Up @@ -353,4 +353,4 @@ status:
type: Executed
```

from the eviction status we can clearly see the eviction was blocked by the `ClusterResourcePlacementDisruptionBudget` object which protected resources from being evicted.
from the eviction status we can clearly see the eviction was blocked by the `ClusterResourcePlacementDisruptionBudget` object which protected resources from being evicted from the MemberCluster.

0 comments on commit 94344fc

Please sign in to comment.