From b346a7614bef19376febaf244246f10e77b9125c Mon Sep 17 00:00:00 2001 From: funera1 <60760935+funera1@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:35:48 +0900 Subject: [PATCH] Document to ignore drift detection (#4288) * Document for ignore fields of drift detection * Fix wrong change * Add ignoreFields' description * Update docs/content/en/docs-dev/user-guide/configuration-reference.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/configuration-reference.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/configuration-reference.md * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Remove Syntax section * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> * Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> --------- Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com> --- .../user-guide/configuration-reference.md | 7 ++++ .../configuration-drift-detection.md | 41 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/docs/content/en/docs-dev/user-guide/configuration-reference.md b/docs/content/en/docs-dev/user-guide/configuration-reference.md index a33bd574aa..58d938b14c 100644 --- a/docs/content/en/docs-dev/user-guide/configuration-reference.md +++ b/docs/content/en/docs-dev/user-guide/configuration-reference.md @@ -37,6 +37,7 @@ spec: | postSync | [PostSync](#postsync) | Additional configuration used as extra actions once the deployment is triggered. | No | | variantLabel | [KubernetesVariantLabel](#kubernetesvariantlabel) | The label will be configured to variant manifests used to distinguish them. | No | | eventWatcher | [][EventWatcher](#eventwatcher) | List of configurations for event watcher. | No | +| driftDetection | [DriftDetection](#driftdetection) | Configuration for drift detection. | No | ## Terraform application @@ -666,3 +667,9 @@ A wrapper of type `int` to represent percentage data. Basically, you can pass `1 |-|-|-|-| | commitMessage | string | The commit message used to push after replacing values. Default message is used if not given. | No | | replacements | [][EventWatcherReplacement](#eventwatcherreplacement) | List of places where will be replaced when the new event matches. | Yes | + +### DriftDetection + +| Field | Type | Description | Required | +|-|-|-|-| +| ignoreFields | []string | List of fields path in manifests, which its diff should be ignored. | No | diff --git a/docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md b/docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md index 9c48ca9305..f3d72bfcc1 100644 --- a/docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md +++ b/docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md @@ -53,3 +53,44 @@ This status means the application is deploying and the configuration drift detec This feature is automatically enabled for all applications. You can change the checking interval as well as [configure the notification](../../managing-piped/configuring-notifications/) for these events in `piped` configuration. + +### Ignore drift detection for specific fields + +> Note: This feature is currently supported for only Kubernetes application. + +You can also ignore drift detection for specified fields in your application manifests. In other words, even if the selected fields have different values between live state and Git, the application status will not be set to `Out of Sync`. + + +For example, suppose you have the application's manifest as below +```yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: simple +spec: + replicas: 2 + template: + spec: + containers: + - args: + - hi + - hello + image: gcr.io/pipecd/helloworld:v1.0.0 + name: helloworld +``` + +If you want to ignore the drift detection for the two sceans +- pod's replicas +- `helloworld` container's args + +Add the following statements to `app.pipecd.yaml` to ignore diff on those fields. +```yaml +spec: + ... + driftDetection: + ignoreFields: + - spec.replicas + - spec.template.spec.containers.0.args +``` +For more information, see the [configuration reference](../../configuration-reference/#driftdetection). +