Skip to content

Conversation

@krupanshi-itpl
Copy link

Description

When upgrading the Frappe/ERPNext Docker image via the Helm chart, the application may continue to serve stale frontend assets (JS/CSS) or cached data. This can result in UI breakages, mismatched assets, or unexpected behavior even though the new image is running successfully.

This PR adds an optional cache-clearing Job, implemented as a post-upgrade Helm hook, that runs after an upgrade to ensure cache consistency.

Keypoints

  • The Job is disabled by default
  • Cleans up automatically after successful execution
  • An initContainer is available to wait for the ERPNext deployment rollout which is disabled by default to avoid additional upgrade delayes. Can be enabled explicitly if required.

Job responsibilites

  1. Clear website cache:
    bench --site all clear-website-cache
  2. Clear application cache:
    bench --site all clear-cache
  3. Optionally flush Redis cache:
    bench --site all execute "frappe.cache.flushdb"

Configuration

Example of values.yaml:

jobs:
  clearCache:
    enabled: true
    initContainer:
      enabled: false
    redisFlush:
      enabled: true

Backward Compatibility

  • Disabled by default
  • No behavior changes unless explicitly enabled

Fixes

Closes #274

@revant
Copy link
Collaborator

revant commented Feb 12, 2026

I did that with annotation change in values:

redis-cache:
  image:
    registry: docker.io
    repository: bitnamilegacy/redis
  master:
    podAnnotations:
      deployed-at: "2025-12-03 18:00:00"

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.

Enhancement request: Add Helm Job to Clear Frappe Cache After Image Upgrade

2 participants