Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document to ignore drift detection #4288

Merged
merged 16 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,54 @@ 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.

### Enable to ignore drift detection for specific fields
funera1 marked this conversation as resolved.
Show resolved Hide resolved

> Note: This feature is currently supported for only kubernetes application.
funera1 marked this conversation as resolved.
Show resolved Hide resolved

This feature ignores drift detection for the specified fields. In other words, even if the specified fields are different between live state and Git, the application status will not be `Out of Sync`.
funera1 marked this conversation as resolved.
Show resolved Hide resolved

To use this feature, set parameters in the application configuration. For more information, see the [configuration reference](../../configuration-reference/#driftdetection) and the following `Syntax` section.

#### Syntax
There are two kinds of block collection in yaml.

Sequence: This block collection is indicated each entry with a dash and space ("`- `").
Mapping: This block collection is indicated each entry with a colon and space("`: `").

Mapping indexes are specified, for example `.foo`.
Sequence indexes are specified, for example `.2`.
However, the first index doesn't need the `.`.

funera1 marked this conversation as resolved.
Show resolved Hide resolved
##### Example
```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

you may add the follow statements to `app.pipe.yaml`.
funera1 marked this conversation as resolved.
Show resolved Hide resolved
```yaml
spec:
...
driftDetection:
ignoreFields:
- spec.replicas
- spec.template.spec.containers.0.args
```

funera1 marked this conversation as resolved.
Show resolved Hide resolved