Skip to content

Commit

Permalink
Document to ignore drift detection (#4288)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* Update docs/content/en/docs-dev/user-guide/configuration-reference.md

Co-authored-by: Khanh Tran <[email protected]>

* 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 <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Remove Syntax section

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

* Update docs/content/en/docs-dev/user-guide/managing-application/configuration-drift-detection.md

Co-authored-by: Khanh Tran <[email protected]>

---------

Co-authored-by: Khanh Tran <[email protected]>
  • Loading branch information
funera1 and khanhtc1202 authored Mar 24, 2023
1 parent 923f77f commit b346a76
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 |
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit b346a76

Please sign in to comment.