-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: Redis as (distributed) cache #999
Conversation
Relates to: #17 |
@tk-innoq: Thank you very much for the PR. Would you please fix the style and test issues? I'll take a closer look at the PR as soon as this is done. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #999 +/- ##
==========================================
+ Coverage 89.13% 89.21% +0.07%
==========================================
Files 254 266 +12
Lines 8504 8771 +267
==========================================
+ Hits 7580 7825 +245
- Misses 683 699 +16
- Partials 241 247 +6 ☔ View full report in Codecov by Sentry. |
The PR is complete from functionality point of view. Waiting for finalization of #1075 to add the new cache related content to |
Related issue(s)
closes #17
Checklist
Description
Before this PR, there was just the in-memory cache. This PR makes cache configurable by introducing a
cache
property on the top level of heimdall configuration, like shown below:As also shown in the snipped above, there are a couple of cache types one can now configure:
noop
- Caching is disabled completely. That means any cache settings on mechanism level do not have any effect. No configuration is supported for this type.in-memory
- This is the default setting, which implements the behavior used by heimdall so far. No configuration is supported for this type.redis
- A Redis single instance can be used as a cache store. Configuration is required (see below).redis-cluster
- A Redis cluster can be used as a distributed cache store. Configuration is required (see below).redis-sentinel
- A Redis sentinel can be used as a distributed cache store. Configuration is required (see below)Common configuration options for all redis cache types
Additional configuration properties per redis type:
redis
:redis-cluster
:redis-sentinel
:Additional Information
If Redis (Standalone/Cluster/sentinel) is not available at start up, heimdall will refuse to start. At run time however, only warnings will be emitted if communication to Redis is not possible, but the functionality will be preserved with, depending on your rules, some performance degradation. Corresponding metrics are exposed as well.
Same credentials and TLS settings are used for sentinel and master nodes connections if sentinel is configured.
Values to be cached may contain highly sensible information. For that reason, TLS is enabled by default (see configuration options above). You should however also ensure your Redis setup has data encryption configured as well.
As shown in the configuration snippet above, this PR implements support for short living DB credentials. To make use of that, configure a valid path to the corresponding yaml/json file with
username
andpassword
managed externally.Example:
And the contents of the
credentials.yaml
from above would look likeIn addition, you have to allow reloading of externally managed secrets by setting
secrets_reload_enabled
totrue
on the top level of heimdall configuration.Example:
the below lines are for release please to clean up the changelog as this dependency is either new in this release, not used any more, or there are new commits with more recent versions
BEGIN_COMMIT_OVERRIDE
feat: Redis as (distributed) cache (#999) by @tk-innoq
END_COMMIT_OVERRIDE