|
1 | 1 | --- |
2 | | -title: ClusterResourcePlacementApplied failure when using ClusterResourcePlacement API object in Azure Kubernetes Fleet Manager |
3 | | -description: Helps you resolve ClusterResourcePlacementApplied failure when you propagate resources by using the ClusterResourcePlacement API object in Azure Kubernetes Fleet Manager APIs. |
4 | | -ms.date: 08/05/2024 |
| 2 | +title: PlacementApplied failure when using placement APIs in Azure Kubernetes Fleet Manager |
| 3 | +description: Helps you resolve ClusterResourcePlacementApplied or ResourcePlacementApplied failure when you propagate resources by using the ClusterResourcePlacement or ResourcePlacement API object in Azure Kubernetes Fleet Manager APIs. |
| 4 | +ms.date: 12/09/2025 |
5 | 5 | ms.reviewer: zhangryan, chiragpa, shasb, ericlucier, arfallas, sachidesai |
6 | 6 | ms.service: azure-kubernetes-fleet-manager |
7 | 7 | ms.custom: sap:Other issue or questions related to Fleet manager |
8 | 8 | --- |
9 | 9 |
|
10 | | -# Resource propagation failure: ClusterResourcePlacementApplied is False |
| 10 | +# Resource propagation failure: PlacementApplied is False |
11 | 11 |
|
12 | | -This article discusses how to troubleshoot `ClusterResourcePlacementApplied` issues when you propagate resources by using the `ClusterResourcePlacement` object API in Microsoft Azure Kubernetes Fleet Manager. |
| 12 | +## Summary |
| 13 | + |
| 14 | +This article discusses how to troubleshoot resource application failures when you propagate resources by using placement APIs in Microsoft Azure Kubernetes Fleet Manager. This issue applies to both `ClusterResourcePlacement` and `ResourcePlacement`, each with their own dedicated custom resource condition types: |
| 15 | + |
| 16 | +- `ClusterResourcePlacementApplied` for ClusterResourcePlacement |
| 17 | +- `ResourcePlacementApplied` for ResourcePlacement |
| 18 | + |
| 19 | +Sample error messages: |
| 20 | + |
| 21 | +# [ClusterResourcePlacement](#tab/clusterresourceplacement) |
| 22 | + |
| 23 | +```yaml |
| 24 | + - lastTransitionTime: "2024-05-07T23:32:40Z" |
| 25 | + message: Failed to apply resources to 1 clusters, please check the `failedPlacements` status |
| 26 | + observedGeneration: 1 |
| 27 | + reason: ApplyFailed |
| 28 | + status: "False" |
| 29 | + type: ClusterResourcePlacementApplied |
| 30 | +``` |
| 31 | +
|
| 32 | +# [ResourcePlacement](#tab/resourceplacement) |
| 33 | +
|
| 34 | +```yaml |
| 35 | + - lastTransitionTime: "2024-05-07T23:32:40Z" |
| 36 | + message: Failed to apply resources to 1 clusters, please check the `failedPlacements` status |
| 37 | + observedGeneration: 1 |
| 38 | + reason: ApplyFailed |
| 39 | + status: "False" |
| 40 | + type: ResourcePlacementApplied |
| 41 | +``` |
| 42 | +
|
| 43 | +--- |
13 | 44 |
|
14 | 45 | ## Symptoms |
15 | 46 |
|
16 | | -When you use the `ClusterResourcePlacement` API object in Azure Kubernetes Fleet Manager to propagate resources, the deployment fails. The `ClusterResourcePlacementApplied` status shows as `False`. |
| 47 | +When you use the `ClusterResourcePlacement` or `ResourcePlacement` API object in Azure Kubernetes Fleet Manager to propagate resources, the deployment fails. The `ClusterResourcePlacementApplied` (for ClusterResourcePlacement) or `ResourcePlacementApplied` (for ResourcePlacement) status shows as `False`. |
| 48 | + |
| 49 | +> [!NOTE] |
| 50 | +> To get more information about why the resources aren't applied, you can check the work applier controller logs. For more information about viewing Fleet agent logs, see [View agent logs in Azure Kubernetes Fleet Manager](/azure/kubernetes-fleet/view-fleet-agent-logs). |
17 | 51 |
|
18 | 52 | ## Cause |
19 | 53 |
|
20 | | -This issue might occur because of one of the following reasons: |
| 54 | +One of the following reasons might cause the issue: |
21 | 55 |
|
22 | | -- The resource already exists on the cluster and isn't managed by the fleet controller. To resolve this issue, update the `ClusterResourcePlacement` manifest YAML file to use `AllowCoOwnership` within `ApplyStrategy` to allow the fleet controller to manage the resource. |
23 | | -- Another `ClusterResourcePlacement` deployment is already managing the resource for the selected cluster by using a different apply strategy. |
24 | | -- The `ClusterResourcePlacement` deployment doesn't apply the manifest because of syntax errors or invalid resource configurations. This might also occur if a resource is propagated through an envelope object. |
| 56 | +- The resource already exists on the cluster and the fleet controller doesn't manage it. |
| 57 | +- Another placement (ClusterResourcePlacement or ResourcePlacement) already manages the resource for the selected cluster by using a different apply strategy. |
| 58 | +- The placement doesn't apply the manifest because of syntax errors or invalid resource configurations. A resource propagated through an envelope object might also cause the issue. |
25 | 59 |
|
26 | 60 | ## Troubleshooting steps |
27 | 61 |
|
28 | | -1. View the `ClusterResourcePlacement` status and locate the `placementStatuses` section. Check the `placementStatuses` value to identify which clusters have the `ResourceApplied` condition set to `False`, and note their `clusterName` value. |
29 | | -2. Locate the `Work` object in the hub cluster. Use the identified `clusterName` to locate the `Work` object that's associated with the member cluster. For more information, see [How to find the correct Work resource associated with `ClusterResourcePlacement`](troubleshoot-clusterresourceplacement-api-issues.md#find-work). |
30 | | -3. Check the status of the `Work` object to understand the specific issues that are preventing successful resource application. |
| 62 | +1. To identify clusters with the `ClusterResourcePlacementApplied` (for ClusterResourcePlacement) or `ResourcePlacementApplied` (for ResourcePlacement) condition set to `False`, inspect the `placementStatuses` in the placement status section and note down their `clusterName`. |
| 63 | +2. To locate the `Work` object associated with the member cluster, use the identified `clusterName`. |
| 64 | + - For ClusterResourcePlacement, see [How to find the correct Work resource associated with `ClusterResourcePlacement`](troubleshoot-clusterresourceplacement-api-issues.md#find-work) |
| 65 | + - For ResourcePlacement, see [How to find the correct Work resource associated with `ResourcePlacement`](troubleshoot-resource-placement-issues.md#find-work) |
| 66 | +3. To understand the specific issues preventing successful resource application, inspect the status of the `Work` object. |
31 | 67 |
|
32 | | -## Case study |
| 68 | +## Case study: ClusterResourcePlacement |
33 | 69 |
|
34 | | -In the following example, `ClusterResourcePlacement` is trying to propagate a namespace that contains a deployment to two member clusters. However, the namespace already exists on one member cluster, specifically `kind-cluster-1`. |
| 70 | +In the following example, a `ClusterResourcePlacement` is trying to propagate a namespace that contains a deployment to two member clusters. However, the namespace already exists on one member cluster, specifically `kind-cluster-1`. |
35 | 71 |
|
36 | 72 | ### ClusterResourcePlacement specifications |
37 | 73 |
|
@@ -191,7 +227,7 @@ status: |
191 | 227 | version: v1 |
192 | 228 | ``` |
193 | 229 |
|
194 | | -In the `failedPlacements` section for `kind-cluster-1`, the `message` fields explain why the resource wasn't applied on the member cluster. In the preceding `conditions` section, the `Applied` condition for `kind-cluster-1` is flagged as `false` and shows the `NotAllWorkHaveBeenApplied` reason. This indicates that the `Work` object that's intended for the member cluster `kind-cluster-1` wasn't applied. For more information, see [How to find the correct Work resource associated with `ClusterResourcePlacement`](troubleshoot-clusterresourceplacement-api-issues.md#find-work). |
| 230 | +In the `failedPlacements` section for `kind-cluster-1`, the `message` fields explain why the resource wasn't applied on the member cluster. In the preceding `conditions` section, the `Applied` condition for `kind-cluster-1` is flagged as `false` and shows the `NotAllWorkHaveBeenApplied` reason. The `Work` object intended for the member cluster `kind-cluster-1` wasn't applied. For more information, see [How to find the correct Work resource associated with `ClusterResourcePlacement`](troubleshoot-clusterresourceplacement-api-issues.md#find-work). |
195 | 231 |
|
196 | 232 | ### Work status of kind-cluster-1 |
197 | 233 |
|
@@ -258,8 +294,19 @@ Check the `Work` status, particularly the `manifestConditions` section. You can |
258 | 294 |
|
259 | 295 | ### Resolution |
260 | 296 |
|
261 | | -In this situation, a potential solution is to set the `AllowCoOwnership` to `true` in the ApplyStrategy policy. However, it's important to notice that this decision should be made by the user because the resources might not be shared. |
| 297 | +In the situation, set the `AllowCoOwnership` to `true` in the ApplyStrategy policy. However, the user must make the decision because the resources might not be shared. |
| 298 | + |
| 299 | +## General troubleshooting notes |
| 300 | + |
| 301 | +The troubleshooting process and Work object inspection are identical for both placement types: |
| 302 | + |
| 303 | +- Both use the same underlying Work API to apply resources to member clusters. |
| 304 | +- The Work object status and manifestConditions have the same structure regardless of the placement type that created them. |
| 305 | +- The main difference is the scope: the cluster-scoped placement can select both cluster-scoped and namespace-scoped resources, while the namespace-scoped placement can only select namespace-scoped resources within its own namespace. |
| 306 | + |
| 307 | +For ResourcePlacement-specific considerations: |
262 | 308 |
|
263 | | -Additionally, you can review the logs for the [Apply Work Controller](https://github.com/Azure/fleet/blob/main/pkg/controllers/work/apply_controller.go) for more insights into why the resources are unavailable. |
| 309 | +- Ensure the target namespace exists on member clusters before the ResourcePlacement tries to apply resources to it |
| 310 | +- ResourcePlacement can only select resources within the same namespace where the ResourcePlacement object itself resides |
264 | 311 |
|
265 | 312 |
|
0 commit comments