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

feat: Add new cacheTtlMinutes and cacheJitterMaxMinutes configuration options #847

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ahatzz11
Copy link

@ahatzz11 ahatzz11 commented Nov 26, 2024

Add configurable cache TTL and jitter settings.

Problem

Currently, the image existence cache has a hardcoded TTL of 24 hours with a 3-hour jitter. This can be problematic for users who:

  • Need to adjust cache duration based on potential artifact cleanup policies
  • Want to disable caching entirely
  • Need to tune jitter settings to prevent cache stampede in their environment

Solution

Added two new configuration options:

  • cacheTtlMinutes (default: 1440 - 24 hours): Controls how long image existence information is cached
  • cacheJitterMaxMinutes (default: 180 - 3 hours): Controls the maximum random time added to prevent cache stampede

Both settings are configurable via the .k8s-image-swapper.yaml config file. Once this gets reviewed I'll make some updates to the helm-chart to support these new configuration values.

Fixes #843

@ahatzz11 ahatzz11 changed the title Add new cacheTtlMinutes and cacheJitterMaxMinutes configuration options feat: Add new cacheTtlMinutes and cacheJitterMaxMinutes configuration options Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not replacing pruned images
1 participant