From 80a50b82570248223af11b41dac7f44edcfa1bed Mon Sep 17 00:00:00 2001 From: Arvind Thirumurugan Date: Tue, 5 Dec 2023 17:59:19 -0800 Subject: [PATCH] chatgpt polish --- .../ClusterResourcePlacement/README.md | 14 ++++++----- docs/howtos/envelope-object.md | 25 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/docs/concepts/ClusterResourcePlacement/README.md b/docs/concepts/ClusterResourcePlacement/README.md index 8f66e1f21..deaa0fe3b 100644 --- a/docs/concepts/ClusterResourcePlacement/README.md +++ b/docs/concepts/ClusterResourcePlacement/README.md @@ -341,18 +341,20 @@ Events: ## Envelope Object -`ClusterResourcePlacement` uses the fleet hub cluster as a staging environment where customer resources are expected to be created and then propagated to the member clusters that have joined fleet based on the ClusterResourcePlacement's spec. -In essence, the plan is not apply/create the resources on the hub cluster to be used on the hub cluster but to propagate the resources to other member clusters in the fleet. +The `ClusterResourcePlacement` leverages the fleet hub cluster as a staging environment from where customer resources. These resources are then propagated to member clusters that are part of the fleet, based on the specifications defined in the `ClusterResourcePlacement`'s spec. + +In essence, the objective is not to apply or create resources on the hub cluster for local use but to propagate these resources to other member clusters within the fleet. + +Certain resources, when created or applied on the hub cluster, may lead to unintended side effects. These include: -There are some resources which cause **unintended side effects** when created/applied on the hub cluster. - Validating/Mutating Webhook Configurations - Cluster Role Bindings -- Resource Quotas +- Resource Quotas - Storage Classes - Flow Schemas - Priority Classes - Ingress Classes - Ingresses -- Network policies +- Network Policies -So we support using `ConfigMap` with a fleet reserved annotation to allow users to embed resources that may have side effects on the hub cluster within it. For more details please refer to this [document](../../howtos/envelope-object.md). +To address this, we support the use of `ConfigMap` with a fleet-reserved annotation. This allows users to encapsulate resources that might have side effects on the hub cluster within the `ConfigMap`. For detailed instructions, please refer to the [document on envelope objects](../../howtos/envelope-object.md). \ No newline at end of file diff --git a/docs/howtos/envelope-object.md b/docs/howtos/envelope-object.md index 2b47a2a31..fe5e23fc4 100644 --- a/docs/howtos/envelope-object.md +++ b/docs/howtos/envelope-object.md @@ -1,10 +1,20 @@ # How-to Guide: To propagate resources using ClusterResourcePlacement API without unintended side effects on the hub clusters -This guide discusses how to propagate a set of resources from the hub cluster to joined member clusters within an envelope object. +# Propagating Resources with Envelope Objects -Currently, we allow `ConfigMap` to act as an envelope object by using a fleet reserved annotation. +This guide provides instructions on propagating a set of resources from the hub cluster to joined member clusters within an envelope object. -So any configmap that is an envelope object must have this annotation on it `kubernetes-fleet.io/envelope-configmap` which would be set to **true** +## Envelope Object with ConfigMap + +Currently, we support using a `ConfigMap` as an envelope object by leveraging a fleet-reserved annotation. + +To designate a `ConfigMap` as an envelope object, ensure that it contains the following annotation: + +```yaml +metadata: + annotations: + kubernetes-fleet.io/envelope-configmap: "true" +``` ## Example: @@ -65,7 +75,7 @@ data: ## Propagating an envelope configmap from hub cluster to member cluster: -We will now apply the example envelope object above on our hub cluster, the envelope object belongs to a namespace called app hence make sure the namespace app exists on the hub cluster. Then we use a `ClusterResourcePlacement` object to propagate the resource from hub to a member cluster named `kind-cluster-1`. +We will now apply the example envelope object above on our hub cluster, the envelope object belongs to a namespace called `app` hence make sure the namespace `app` exists on the hub cluster. Then we use a `ClusterResourcePlacement` object to propagate the resource from hub to a member cluster named `kind-cluster-1`. ### CRP spec: ``` @@ -140,9 +150,10 @@ status: version: v1 ``` -**Note:**In the `selectedResources` section within the `placementStatus` for `kind-cluster-1` we only show that the envelope object got propagated, we don't include all the resources within the envelope object in the status. +# Note: +In the `selectedResources` section within the `placementStatus` for `kind-cluster-1`, we specifically display the propagation of the envelope object. Please note that we do not individually list all the resources contained within the envelope object in this status. -From the `selectedResources` section within the `placementStatus` for `kind-cluster-1` we see that the namespace `app` along with the configmap `envelope-configmap` got propagated. And the user can also verify with resources mentioned within in the `envelope-configmap` object are also propagated in this case a `ResourceQuota` object and `MutatingWebhookConfigurations` object. +Upon inspection of the `selectedResources` section for `kind-cluster-1`, it indicates that the namespace `app` and the configmap `envelope-configmap` have been successfully propagated. Users can further verify the successful propagation of resources mentioned within the `envelope-configmap` object by ensuring that the `failedPlacements` section in the `placementStatus` for `kind-cluster-1` does not appear in the status. ## Example of using an Envelope object where resource failed to apply: @@ -324,7 +335,7 @@ status: version: v1 ``` -In `ClusterResourcePlacement` status, `placementStatuses` section for `kind-cluster-1` in the `failedPlacements` section we see that the ResourceQuota object had failed to apply with the following error message "**Failed to apply manifest: namespaces "app" not found**", we also see the envelope object `envelope-configmap` which tried to propagate this resource. +In `ClusterResourcePlacement` status, `placementStatuses` section for `kind-cluster-1` in the `failedPlacements` section we see that the ResourceQuota object had failed to apply with the following error message "**Failed to apply manifest: namespaces "app" not found**", we also see the envelope object `envelope-configmap` which tried to propagate this resource mentioned in the `failedPlacements` section. We see this message because we tried to propagate the namespace `test-ns` which contains the envelope object. But the envelope object contains resources belonging to another namespace called `app` which doesn't exist on the member cluster.