-
Notifications
You must be signed in to change notification settings - Fork 163
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
Allow configuration of drift detection on HelmRelease
#815
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hiddeco
added
enhancement
New feature or request
area/drift
Drift detection/correction related issues and pull requests
labels
Nov 24, 2023
hiddeco
force-pushed
the
new-drift-detection
branch
from
November 24, 2023 10:04
50f751e
to
d6dd500
Compare
This adds the option to enable drift detection for a specific `HelmRelease` instance using `.spec.driftDetection.mode`. Supported configurations are `enabled` (detect and correct), `warn` (detect) and `disabled`. In addition to this, it allows defining a set of ignore rules using `.spec.driftDetection.ignore`. Which can be used to ignore (portions of) a resource using JSON pointers and target selectors. Signed-off-by: Hidde Beydals <[email protected]>
The `Diff` action can be used to detect changes between the manifest from a Helm release and the current cluster state. Compared to the previous diff functionality, it allows for ignoring specific fields in a resource using the newly introduced ignore rules in the API. Signed-off-by: Hidde Beydals <[email protected]>
hiddeco
force-pushed
the
new-drift-detection
branch
2 times, most recently
from
November 24, 2023 12:41
9705c95
to
dd92f46
Compare
14 tasks
This allows `DetermineReleaseState` to determine if the cluster state has drifted from the manifest defined in the Helm storage. This allows the atomic reconciler to determine if an upgrade should happen based on the configuration of the `HelmRelease`. If drift detection is `enabled` (or set to `warn`), it will report drift via the controller logs and a Kubernetes Event. In addition, when correction is enabled, it will instruct to perform a Helm upgrade to correct the drift. To summarize the detected drift in a compact message, summarize utilities have been introduced to the `diff` package. Signed-off-by: Hidde Beydals <[email protected]>
In favor of the new `Diff` action. Signed-off-by: Hidde Beydals <[email protected]>
hiddeco
force-pushed
the
new-drift-detection
branch
from
November 24, 2023 15:41
dd92f46
to
6b1effc
Compare
stefanprodan
approved these changes
Nov 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I've tested drift detection with kube-prometheus-stack for exclusion & various in-cluster edits that were promptly corrected.
Thanks @hiddeco 🏅
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/drift
Drift detection/correction related issues and pull requests
enhancement
New feature or request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the option to enable drift detection for a specific
HelmRelease
instance using.spec.driftDetection.mode
.Supported configurations are
enabled
(detect and correct),warn
(detect) and
disabled
.In addition to this, it allows defining a set of ignore rules using
.spec.driftDetection.ignore
. Which can be used to ignore (portionsof) a resource using JSON pointers and target selectors.
Example
Simple Deployment
kube-prometheus-stack