Reloader

stakaterApache-2.0活跃维护

Kubernetes 控制器,监听 ConfigMap 和 Secret 变更后自动触发关联的 Deployment、StatefulSet、DaemonSet 滚动升级,省去手动重启 Pod。

A Kubernetes controller to watch changes in ConfigMap and Secrets and do rolling upgrades on Pods with their associated Deployment, StatefulSet, DaemonSet and DeploymentConfig – [✩Star] if you're using it!

v1.4.23发布于 2026-10-27 10:56 UTC10,557star +5 / 7 天677fork同步于 2026-11-10 05:29 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
helm repo add stakater https://stakater.github.io/stakater-charts
helm repo update
helm install reloader stakater/reloader
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本v1.4.23
  1. chart-v3.0.0-beta.5Helm chart reloader 3.0.0-beta.5pre-release2026-10-29 · 2026-10-29 09:29 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/stakater/Reloader/compare/chart-v3.0.0-beta.4...chart-v3.0.0-beta.5

  2. v2.0.0-beta.2pre-release2026-10-27 · 2026-10-27 15:58 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/stakater/Reloader/compare/v2.0.0-beta.1...v2.0.0-beta.2

  3. chart-v2.2.19Helm chart refs/tags/chart-v2.2.192026-10-27 · 2026-10-27 15:54 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/stakater/Reloader/compare/chart-v2.2.18...chart-v2.2.19

  4. v1.4.23最新正式版2026-10-27 · 2026-10-27 10:56 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/stakater/Reloader/compare/v1.4.22...v1.4.23

  5. chart-v3.0.0-beta.4Helm chart reloader 3.0.0-beta.4pre-release2026-10-22 · 2026-10-22 17:55 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/stakater/Reloader/compare/chart-v3.0.0-beta.3...chart-v3.0.0-beta.4

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    💖 Sponsor Our Work Go Report Card Go Doc Release GitHub tag Docker Pulls GitHub Stars license

    📢 Reloader v2 is here

    Reloader v2, rebuilt on the Operator SDK, has been released. All new development happens on the v2 branch.

    The master branch (Reloader v1) is feature-frozen and will only receive security and critical bug fixes. Please open new feature requests and pull requests against v2, and see the contribution guide for branch and PR title rules.

    🔁 What is Reloader?

    Reloader is a Kubernetes controller that automatically triggers rollouts of workloads (like Deployments, StatefulSets, and more) whenever referenced Secrets, ConfigMaps or optionally CSI-mounted secrets are updated.

    In a traditional Kubernetes setup, updating a Secret or ConfigMap does not automatically restart or redeploy your workloads. This can lead to stale configurations running in production, especially when dealing with dynamic values like credentials, feature flags, or environment configs.

    Reloader bridges that gap by ensuring your workloads stay in sync with configuration changes — automatically and safely.

    📚 Full documentation is available at Stakater documentation site

    🚀 Why Reloader?

    • ✅ Zero manual restarts: No need to manually rollout workloads after config/secret changes.
    • 🔒 Secure by design: Ensure your apps always use the most up-to-date credentials or tokens.
    • 🛠️ Flexible: Works with all major workload types — Deployment, StatefulSet, Daemonset, ArgoRollout, and more.
    • ⚡ Fast feedback loop: Ideal for CI/CD pipelines where secrets/configs change frequently.
    • 🔄 Out-of-the-box integration: Just label your workloads and let Reloader do the rest.

    🔧 How It Works?

    flowchart LR
      ExternalSecret -->|Creates| Secret
      SealedSecret -->|Creates| Secret
      Certificate -->|Creates| Secret
      Secret -->|Watched by| Reloader
      ConfigMap -->|Watched by| Reloader
    
      Reloader -->|Triggers Rollout| Deployment
      Reloader -->|Triggers Rollout| DeploymentConfig
      Reloader -->|Triggers Rollout| Daemonset
      Reloader -->|Triggers Rollout| Statefulset
      Reloader -->|Triggers Rollout| ArgoRollout
      Reloader -->|Triggers Job| CronJob
      Reloader -->|Sends Notification| Slack,Teams,Webhook
    
    • Sources like ExternalSecret, SealedSecret, or Certificate from cert-manager can create or manage Kubernetes Secrets — but they can also be created manually or delivered through GitOps workflows.
    • Secrets and ConfigMaps are watched by Reloader.
    • When changes are detected, Reloader automatically triggers a rollout of the associated workloads, ensuring your app always runs with the latest configuration.

    🏢 Reloader Enterprise

    Reloader OSS is free and production-proven with 24B+ downloads.

    For teams with stricter requirements:

    NeedEnterprise
    CVE-free, signed images with SBOM✅
    SLA-backed support from Kubernetes experts✅
    Artifact provenance for compliance audits✅
    Dedicated escalation path✅

    → Contact Sales for info about Reloader Enterprise.

    ⚡ Quick Start

    1. Install Reloader

    Follow any of this installation options.

    2. Annotate Your Workload

    To enable automatic reload for a Deployment:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: my-app
      annotations:
        reloader.stakater.com/auto: "true"
    spec:
      template:
        metadata:
          labels:
            app: my-app
        spec:
          containers:
            - name: app
              image: your-image
              envFrom:
                - configMapRef:
                    name: my-config
                - secretRef:
                    name: my-secret
    

    This tells Reloader to watch the ConfigMap and Secret referenced in this deployment. When either is updated, it will trigger a rollout.

    🧩 Usage

    Reloader supports multiple annotation-based controls to let you customize when and how your Kubernetes workloads are reloaded upon changes in Secrets or ConfigMaps.

    Kubernetes does not trigger pod restarts when a referenced Secret or ConfigMap is updated. Reloader bridges this gap by watching for changes and automatically performing rollouts — but it gives you full control via annotations, so you can:

    • Reload all resources by default
    • Restrict reloads to only Secrets or only ConfigMaps
    • Watch only specific resources
    • Use opt-in via tagging (search + match)
    • Exclude workloads you don’t want to reload

    1. 🔁 Automatic Reload (Default)

    Use these annotations to automatically restart the workload when referenced Secrets or ConfigMaps change.

    AnnotationDescription
    reloader.stakater.com/auto: "true"Reloads workload when any referenced ConfigMap or Secret changes
    secret.reloader.stakater.com/auto: "true"Reloads only when referenced Secret(s) change
    configmap.reloader.stakater.com/auto: "true"Reloads only when referenced ConfigMap(s) change

    2. 📛 Named Resource Reload (Specific Resource Annotations)

    These annotations allow you to manually define which ConfigMaps or Secrets should trigger a reload, regardless of whether they're used in the pod spec.

    AnnotationDescription
    secret.reloader.stakater.com/reload: "my-secret"Reloads when specific Secret(s) change, regardless of how they're used
    configmap.reloader.stakater.com/reload: "my-config"Reloads when specific ConfigMap(s) change, regardless of how they're used
    Use when
    1. ✅ This is useful in tightly scoped scenarios where config is shared but reloads are only relevant in certain cases.
    2. ✅ Use this when you know exactly which resource(s) matter and want to avoid auto-discovery or searching altogether.

    3. 🎯 Targeted Reload (Match + Search Annotations)

    This pattern allows fine-grained reload control — workloads only restart if the Secret/ConfigMap is both:

    1. Referenced by the workload
    2. Explicitly annotated with match: true
    AnnotationApplies ToDescription
    reloader.stakater.com/search: "true"WorkloadEnables search mode (only reloads if matching secrets/configMaps are found)
    reloader.stakater.com/match: "true"ConfigMap/SecretMarks the config/secret as eligible for reload in search mode
    How it works
    1. The workload must have: reloader.stakater.com/search: "true"
    2. The ConfigMap or Secret must have: reloader.stakater.com/match: "true"
    3. The resource (ConfigMap or Secret) must also be referenced in the workload (via env, volumeMount, etc.)
    Use when
    1. ✅ You want to reload a workload only if it references a ConfigMap or Secret that has been explicitly tagged with reloader.stakater.com/match: "true".
    2. ✅ Use this when you want full control over which shared or system-wide resources trigger reloads. Great in multi-tenant clusters or shared configs.

    ⛔ Resource-Level Ignore Annotation

    When you need to prevent specific ConfigMaps or Secrets from triggering any reloads, use the ignore annotation on the resource itself:

    apiVersion: v1
    kind: ConfigMap  # or Secret
    metadata:
      name: my-config
      annotations:
        reloader.stakater.com/ignore: "true"
    

    This instructs Reloader to skip all reload logic for that resource across all workloads.

    4. ⚙️ Workload-Specific Rollout Strategy (Argo Rollouts Only)

    Note: This is only applicable when using Argo Rollouts. It is ignored for standard Kubernetes Deployments, StatefulSets, or DaemonSets. To use this feature, Argo Rollouts support must be enabled in Reloader (for example via --is-argo-rollouts=true).

    By default, Reloader triggers the Argo Rollout controller to perform a standard rollout by updating the pod template. This works well in most cases, however, because this modifies the workload spec, GitOps tools like ArgoCD will detect this as "Configuration Drift" and mark your application as OutOfSync.

    To avoid that, you can switch to the restart strategy, which simply restarts the pod without changing the pod template.

    metadata:
      annotations:
        reloader.stakater.com/rollout-strategy: "restart"
    
    ValueBehavior
    rollout (default)Updates pod template metadata to trigger a rollout
    restartDeletes the pod to restart it without patching the template

    ✅ Use restart if:

    1. You're using GitOps and want to avoid drift
    2. You want a quick restart without changing the workload spec
    3. Your platform restricts metadata changes

    This setting affects Argo Rollouts behavior, not Argo CD sync settings.

    5. ❗ Annotation Behavior Rules & Compatibility

    • reloader.stakater.com/auto and reloader.stakater.com/search cannot be used together — the auto annotation takes precedence.
    • If both auto and its typed versions (secret.reloader.stakater.com/auto, configmap.reloader.stakater.com/auto) are used, only one needs to be true to trigger a reload.
    • Setting reloader.stakater.com/auto: "false" explicitly disables reload for that workload.
    • If --auto-reload-all is enabled on the controller:
      • All workloads are treated as if they have auto: "true" unless they explicitly set it to "false".
      • Missing or unrecognized annotation values are treated as "false".

    6. 🔔 Alerting on Reload

    Reloader can optionally send alerts whenever it triggers a rolling upgrade for a workload (e.g., Deployment, StatefulSet, etc.).

    These alerts are sent to a configured webhook endpoint, which can be a generic receiver or services like Slack, Microsoft Teams or Google Chat.

    To enable this feature, update the reloader.env.secret section in your values.yaml (when installing via Helm):

    reloader:
      deployment:
        env:
          secret:
            ALERT_ON_RELOAD: "true"                    # Enable alerting (default: false)
            ALERT_SINK: "slack"                        # Options: slack, teams, gchat or webhook (default: webhook)
            ALERT_WEBHOOK_URL: "<your-webhook-url>"    # Required if ALERT_ON_RELOAD is true
            ALERT_ADDITIONAL_INFO: "Triggered by Reloader in staging environment"
    

    7. ⏸️ Pause Deployments

    This feature allows you to pause rollouts for a deployment for a specified duration, helping to prevent multiple restarts when several ConfigMaps or Secrets are updated in quick succession.

    AnnotationApplies ToDescription
    deployment.reloader.stakater.com/pause-period: "5m"DeploymentPauses reloads for the specified period (e.g., 5m, 1h)
    How it works
    1. Add the deployment.reloader.stakater.com/pause-period annotation to your Deployment, specifying the pause duration (e.g., "5m" for five minutes).
    2. When a watched ConfigMap or Secret changes, Reloader will still trigger a reload event, but if the deployment is paused, the rollout will have no effect until the pause period has elapsed.
    3. This avoids repeated restarts if multiple resources are updated close together.
    Use when
    1. ✅ Your deployment references multiple ConfigMaps or Secrets that may be updated at the same time.
    2. ✅ You want to minimize unnecessary rollouts and reduce downtime caused by back-to-back configuration changes.

    8. 🔐 CSI Secret Provider Support

    Reloader supports the Secrets Store CSI Driver, which allows mounting secrets from external secret stores (like AWS Secrets Manager, Azure Key Vault, HashiCorp Vault) directly into pods. Unlike Kubernetes Secret objects, CSI-mounted secrets do not always trigger native Kubernetes update events. Reloader solves this by watching CSI status resources and restarting affected workloads when mounted secret versions change.

    How it works

    When secret rotation is enabled, the Secrets Store CSI Driver updates a Kubernetes resource called: SecretProviderClassPodStatus

    This resource reflects the currently mounted secret versions for a pod. Reloader watches these updates and triggers a rollout when a change is detected.

    Prerequisites
    • Secrets Store CSI Driver must be installed in your cluster
    • Secret rotation enabled in the CSI driver.
    • Enable CSI integration in Reloader: --enable-csi-integration=true
    Annotations for CSI-mounted Secrets
    AnnotationDescription
    reloader.stakater.com/auto: "true"Global Discovery: Automatically discovers and reloads the workload when any mounted ConfigMap or Secret is updated.
    secretproviderclass.reloader.stakater.com/auto: 'true'CSI Discovery: Specifically watches for updates to all SecretProviderClasses used by the workload (CSI driver integration).
    secretproviderclass.reloader.stakater.com/reload: "my-secretproviderclass"Targeted Reload: Only reloads the workload when the specifically named SecretProviderClass(es) are updated.

    Reloader monitors changes at the per-secret level by watching the SecretProviderClassPodStatus. Make sure each secret you want to monitor is properly defined with a secretKey in your SecretProviderClass:

    apiVersion: secrets-store.csi.x-k8s.io/v1
    kind: SecretProviderClass
    metadata:
      name: vault-reloader-demo
      namespace: test
    spec:
      provider: vault
      parameters:
        vaultAddress: "http://vault.vault.svc:8200"
        vaultSkipTLSVerify: "true"
        roleName: "demo-role"
        objects: |
          - objectName: "password"
            secretPath: "secret/data/reloader-demo"
            secretKey: "password"
    

    Important: Reloader tracks changes to individual secrets (identified by secretKey). If your SecretProviderClass doesn't specify secretKey for each object, Reloader may not detect updates correctly.

    Notes & Limitations

    Reloader reacts to CSI status changes, not direct updates to external secret stores Secret rotation must be enabled in the CSI driver for updates to be detected CSI limitations (such as subPath mounts) still apply and may require pod restarts If secrets are synced to Kubernetes Secret objects, standard Reloader behavior applies and CSI support may not be required

    🚀 Installation

    1. 📦 Helm

    Reloader can be installed in multiple ways depending on your Kubernetes setup and preference. Below are the supported methods:

    helm repo add stakater https://stakater.github.io/stakater-charts
    helm repo update
    helm install reloader stakater/reloader
    

    ➡️ See full Helm configuration in the chart README.

    2. 📄 Vanilla Manifests

    Apply raw Kubernetes manifests directly:

    kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloader.yaml
    

    3. 🧱 Vanilla Kustomize

    Use the built-in Kustomize support:

    kubectl apply -k https://github.com/stakater/Reloader/deployments/kubernetes
    

    4. 🛠️ Custom Kustomize Setup

    You can create your own kustomization.yaml and use Reloader’s as a base:

    apiVersion: kustomize.config.k8s.io/v1beta1
    kind: Kustomization
    
    resources:
      - https://github.com/stakater/Reloader/deployments/kubernetes
    
    namespace: reloader
    

    5. ⚖️ Default Resource Requests and Limits

    By default, Reloader is deployed with the following resource requests and limits:

    resources:
      limits:
        cpu: 150m
        memory: 512Mi
      requests:
        cpu: 10m
        memory: 128Mi
    

    6. ⚙️ Optional runtime configurations

    These flags let you customize Reloader's behavior globally, at the Reloader controller level.

    1. 🔁 Reload Behavior
    FlagDescription
    --reload-on-create=trueReload workloads when a watched ConfigMap or Secret is created
    --reload-on-delete=trueReload workloads when a watched ConfigMap or Secret is deleted
    --auto-reload-all=trueAutomatically reload all workloads unless opted out (auto: "false")
    --reload-strategy=env-varsStrategy to use for triggering reload (env-vars or annotations)
    --log-format=jsonEnable JSON-formatted logs for better machine readability
    Reload Strategies

    Reloader supports multiple strategies for triggering rolling updates when a watched ConfigMap or Secret changes. You can configure the strategy using the --reload-strategy flag.

    StrategyDescription
    env-vars (default)Adds a dummy environment variable to any container referencing the changed resource (e.g., Deployment, StatefulSet, etc.). This forces Kubernetes to perform a rolling update.
    annotationsAdds a reloader.stakater.com/last-reloaded-from annotation to the pod template metadata. Ideal for GitOps tools like ArgoCD, as it avoids triggering unwanted sync diffs.
    • The env-vars strategy is the default and works in most setups.
    • The annotations strategy is preferred in GitOps environments to prevent config drift in tools like ArgoCD or Flux.
    • In annotations mode, a ConfigMap or Secret that is deleted and re-created will still trigger a reload (since previous state is not tracked).
    2. 🚫 Resource Filtering
    FlagDescription
    --resources-to-ignore=configmapsIgnore ConfigMaps (only one type can be ignored at a time)
    --resources-to-ignore=secretsIgnore Secrets (cannot combine with configMaps)
    --ignored-workload-types=jobs,cronjobsIgnore specific workload types from reload monitoring
    --resource-label-selector=key=valueOnly watch ConfigMaps/Secrets with matching labels

    ⚠️ Note:

    Only one resource type can be ignored at a time. Trying to ignore both configmaps and secrets will cause an error in Reloader. ✅ Workaround: Scale the Reloader deployment to 0 replicas if you want to disable it completely.

    💡 Workload Type Examples:

    # Ignore only Jobs
    --ignored-workload-types=jobs
    
    # Ignore only CronJobs
    --ignored-workload-types=cronjobs
    
    # Ignore both (comma-separated)
    --ignored-workload-types=jobs,cronjobs
    

    🔧 Use Case: Ignoring workload types is useful when you don't want certain types of workloads to be automatically reloaded.

    3. 🧩 Namespace Filtering
    FlagDescription
    --namespace-selector='key=value' --namespace-selector='key1=value1,key2=value2' --namespace-selector='key in (value1,value2)'Watch only namespaces with matching labels. See LIST and WATCH filtering for more details on label selectors
    --namespaces-to-ignore=ns1,ns2Skip specific namespaces from being watched
    4. 📝 Annotation Key Overrides

    These flags allow you to redefine annotation keys used in your workloads or resources:

    FlagOverrides
    --auto-annotationOverrides reloader.stakater.com/auto
    --secret-auto-annotationOverrides secret.reloader.stakater.com/auto
    --configmap-auto-annotationOverrides configmap.reloader.stakater.com/auto
    --auto-search-annotationOverrides reloader.stakater.com/search
    --search-match-annotationOverrides reloader.stakater.com/match
    --secret-annotationOverrides secret.reloader.stakater.com/reload
    --configmap-annotationOverrides configmap.reloader.stakater.com/reload
    --ignore-annotationOverrides reloader.stakater.com/ignore
    --pause-deployment-annotationOverrides deployment.reloader.stakater.com/pause-period
    --pause-deployment-time-annotationOverrides deployment.reloader.stakater.com/paused-at
    5. ⚖️ High Availability

    When running multiple replicas with --enable-ha, leadership is held through a Kubernetes Lease. These flags tune the client-go leader election timings:

    FlagDescription
    --leader-election-lease-duration=15sDuration non-leader candidates wait before force acquiring leadership
    --leader-election-renew-deadline=10sDuration the acting leader retries refreshing leadership before giving up
    --leader-election-retry-period=2sDuration clients wait between attempting acquisition and renewal of leadership

    The lease duration must be a whole number of seconds of at least 1s, because it is persisted on the Lease as whole seconds and a follower judges expiry from that stored value — a fractional lease is truncated and can expire for followers before the leader reaches its renew deadline, allowing two leaders at once. It must also be greater than the renew deadline, and the renew deadline must be greater than the retry period multiplied by the jitter factor (1.2). Longer values reduce API server traffic and tolerate slower networks; shorter values shorten the failover gap after a leader is lost.

    6. 🕷️ Debugging
    FlagDescription
    --enable-pprofEnables pprof for profiling
    --pprof-addrAddress to start pprof server on. Default is :6060

    Compatibility

    Reloader is compatible with Kubernetes >= 1.19

    🏢 Adopters

    Reloader has 24B+ Docker pulls across thousands of Kubernetes clusters worldwide.

    If you're running Reloader in production, we'd love to hear from you:

    See who's using Reloader →

    Help

    Have a question?

    File a GitHub issue.

    Talk to us on Slack

    Join and talk to us on Slack for discussing Reloader:

    Join Slack Chat

    Contributing

    Branches and PR titles

    • master is in feature freeze and accepts only bug fixes (fix:) and maintenance changes (chore:).
    • v2 is the active development branch. Please open pull requests for new features against v2.

    Pull request titles must follow the Conventional Commits format, for example fix(chart): correct probe port. The following prefixes are accepted on v2: feat, fix, chore, docs, refactor, perf, test, ci, build and revert.

    Bug Reports & Feature Requests

    Please use the issue tracker to report any bugs or file feature requests.

    Developing

    1. Deploy Reloader
    2. Run okteto up to activate your development container
    3. make build
    4. ./Reloader

    PRs are welcome. In general, we follow the "fork-and-pull" Git workflow:

    1. Fork the repo on GitHub
    2. Clone the project to your own machine
    3. Commit changes to your own branch
    4. Push your work back up to your fork
    5. Submit a Pull request so that we can review your changes

    NOTE: Be sure to merge the latest from "upstream" before making a pull request!

    Release Processes

    Repository GitHub releases: As requested by the community in issue 685, Reloader is now based on a manual release process. Releases are no longer done on every merged PR to the main branch, but manually on request.

    To make a GitHub release:

    1. Code owners create a release branch release-vX.Y.Z from master
    2. Code owners run Init Release workflow to automatically generate version and manifests on the release branch
      • Set the TARGET_BRANCH parameter to release branch i.e. release-vX.Y.Z
      • Set the TARGET_VERSION to release version without 'v' i.e. X.Y.Z
    3. A PR is created to bump the image version on the release branch, example: PR-798
    4. Code owners create a GitHub release with tag vX.Y.Z and target branch release-vX.Y.Z, which triggers creation of images
    5. Code owners create another branch from master and bump the helm chart version as well as Reloader image version.
      • Code owners create a PR with release/helm-chart label, example: PR-846

    Repository git tagging: Push to the main branch will create a merge-image and merge-tag named merge-${{ github.event.number }}, for example merge-800 when pull request number 800 is merged.

    Changelog

    View the releases page to see what has changed in each release.

    License

    Apache2 © Stakater

    About Stakater

    Get started with Stakater

    Reloader is maintained by Stakater. Like it? Please let us know at [email protected]

    See our other projects or contact us in case of professional services and queries on [email protected]