From b7fd384aaf7ba1d6470dd590ea866b76c64126f9 Mon Sep 17 00:00:00 2001 From: michaelawyu Date: Sat, 23 Nov 2024 08:49:23 +0800 Subject: [PATCH] docs: add the report diff mode how-to doc (preview) (#968) --- docs/howtos/reportdiff.md | 175 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 docs/howtos/reportdiff.md diff --git a/docs/howtos/reportdiff.md b/docs/howtos/reportdiff.md new file mode 100644 index 000000000..83c42ad20 --- /dev/null +++ b/docs/howtos/reportdiff.md @@ -0,0 +1,175 @@ +# How-to Guide: Using the `ReportDiff` Apply Mode + +This guide provides an overview on how to use the `ReportDiff` apply mode, which allows one to +easily evaluate how things will change in the system without the risk of incurring unexpected +changes. In this mode, Fleet will check for configuration differences between the hub cluster +resource templates and their corresponding resources on the member clusters, but will not +perform any apply op. This is most helpful in cases of experimentation and drift/diff analysis. + +# How the `ReportDiff` mode can help + +To use this mode, simply set the `type` field in the apply strategy part of the CRP API +from `ClientSideApply` (the default) or `ServerSideApply` to `ReportDiff`. Configuration +differences are checked per `comparisonOption` setting, in consistency with the behavior +documented in the drift detection how-to guide; see the document for more information. + +The steps below might help explain the workflow better; it assumes that you have a fleet +of two member clusters, `member-1` and `member-2`: + +* Switch to the hub cluster and create a namespace, `work-3`, with some labels. + + ```sh + kubectl config use-context hub-admin + kubectl create ns work-3 + kubectl label ns work-3 app=work-3 + kubectl label ns work-3 owner=leon + ``` + +* Create a CRP object that places the namespace to all member clusters: + + ```sh + cat <