Commit Graph

8 Commits

Author SHA1 Message Date
Stefan Prodan 92ec780c98
Update API version in comments and docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2024-05-06 11:46:16 +03:00
Hidde Beydals 841fca08fe
features: mark drift related flags as deprecated
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-24 18:01:07 +01:00
Hidde Beydals 580c72cd09
controller: adopt release based on v2beta1 state
This allows the controller to be updated from `v2beta1` to `v2beta2`
without triggering a release to settle state.

It does this by looking at the previous successful release as recorded
for the `v2beta1` object, and if found, recording a snapshot for it in
the new `History` field of the status.

This feature can be disabled by setting the `AdoptLegacyReleases`
feature flag to `false`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-11-22 23:14:17 +01:00
Hidde Beydals 0b8b92ba64
Allow opt-out of drift correction
This enhances the drift detection to allow detection without acting on
it by adding a `CorrectDrift` feature gate. When set to `false` (i.e.
`--feature-gates=DetectDrift=true,CorrectDrift=false`), the controller
will only log the difference it detected without acting on it.

This allows for a smoother transition to drift detection, as issues
with a number of existing releases can be solved before the feature
is enabled in full.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-20 13:07:08 +01:00
Hidde Beydals 62456c94ff
Add OOM watcher to allow graceful shutdown
This commit introduces an OOM watcher, which can be enabled using
`--feature-gates=OOMWatch=true`. The OOM watcher watches the current
memory usage as reported by cgroups via `memory.current` and cancels
the context when it reaches a certain threshold compared to
`memory.max` (default `95`%, configurable using
`--oom-watch-memory-threshold`).

This allows ongoing Helm processes to gracefully exit with a failure
before the controller is forcefully OOM killed, preventing a deadlock
of releases in a pending state.

The OOM watcher polls the `memory.current` file on an interval (default
`500ms`, configurable using `--oom-watch-interval`), as subscribing to
file updates using inotify is not possible for cgroups (v2) except for
`*.events` files. Which does provide signals using `memory.events`, but
these will generally be too late for our use case. As for example `high`
equals `max` in most containers, buying us little time to gracefully
stop our processes.

In addition, because we simply watch current usage compared to max
usage in bytes. This approach should work for cgroups v1 as well, given
this has (most of the time) files for these values available, albeit
at times at different locations. For which this commit does not
introduce a flag yet, but the library takes into account that it could
be configured at some point.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-07 10:39:19 +01:00
Hidde Beydals f24cf9dc83
helm: enable DNS with AllowDNSLookups feature gate
This allows install and upgrade actions to use DNS lookups while
rendering Helm templates after it got disabled in Helm due to possible
security risks.

It is enabled (globally) on the controller by configuring
`--feature-gates=AllowDNSLookups=true`.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 13:55:13 +01:00
Hidde Beydals 1240f20183
Enable experimental drift detection
This enables experimental drift detection of cluster state compared to
the current manifest data from the Helm storage's manifest blob.

Drift detection works based on the already proven approach of the
kustomize-controller's SSA package, and utilizes the managed field
configured by the controller since `v0.12.2`.

This feature is planned to go out of experimental once the further
controller rewrite has been finished, and the state of the Helm storage
itself is more fault tolerant.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-03-01 09:36:43 +01:00
Mac Chaffee 9bcf125e2c
Disable caching of secrets and configmaps by default.
You can re-enabled caching of secrets by starting the
controller with the argument '--feature-gates=CacheSecretsAndConfigMaps=true'

Signed-off-by: Mac Chaffee <machaffe@renci.org>
2022-12-19 09:53:01 -05:00