Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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!

License

NotificationsYou must be signed in to change notification settings

Michkov/Reloader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reloader

Go Report CardGo DocReleaseGitHub tagDocker PullsDocker Starslicense

🔁 What is Reloader?

Reloader is a Kubernetes controller that automatically triggers rollouts of workloads (like Deployments, StatefulSets, and more) whenever referencedSecrets orConfigMaps are updated.

In a traditional Kubernetes setup, updating aSecret orConfigMap 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.

🚀 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
Loading
  • Sources likeExternalSecret,SealedSecret, orCertificate fromcert-manager can create or manage KubernetesSecrets — but they can also be created manually or delivered through GitOps workflows.
  • Secrets andConfigMaps 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.

⚡ Quick Start

1. Install Reloader

Follow any of thisinstallation options.

2. Annotate Your Workload

To enable automatic reload for a Deployment:

apiVersion:apps/v1kind:Deploymentmetadata:name:my-appannotations:reloader.stakater.com/auto:"true"spec:template:metadata:labels:app:my-appspec:containers:        -name:appimage:your-imageenvFrom:            -configMapRef:name:my-config            -secretRef:name:my-secret

This tells Reloader to watch theConfigMap andSecret referenced in this deployment. When either is updated, it will trigger a rollout.

🏢 Enterprise Version

Stakater offers an enterprise-grade version of Reloader with:

  1. SLA-backed support
  2. Certified images
  3. Private Slack support

Contactsales@stakater.com for info about Reloader Enterprise.

🧩 Usage

Reloader supports multiple annotation-based controls to let youcustomize when and how your Kubernetes workloads are reloaded upon changes inSecrets orConfigMaps.

Kubernetes does not trigger pod restarts when a referencedSecret orConfigMap 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:

  • Reloadall resources by default
  • Restrict reloads to onlySecrets or onlyConfigMaps
  • Watch onlyspecific resources
  • Useopt-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 referencedSecrets orConfigMaps 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 withmatch: 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 withreloader.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.

4. ⚙️ Workload-Specific Rollout Strategy

By default, Reloader uses therollout strategy — it updates the pod template to trigger a new rollout. This works well in most cases, but it can cause problems if you're using GitOps tools like ArgoCD, which detect this as configuration drift.

To avoid that, you can switch to therestart 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

✅ Userestart 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

5. ❗ Annotation Behavior Rules & Compatibility

  • reloader.stakater.com/auto andreloader.stakater.com/searchcannot be used together — theauto annotation takes precedence.
  • If bothauto 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.
  • Settingreloader.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 haveauto: "true" unless they explicitly set it to"false".
    • Missing or unrecognized annotation values are treated as"false".

6. 🔔 Alerting on Reload

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

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

To enable this feature, update thereloader.env.secret section in yourvalues.yaml (when installing via Helm):

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

🚀 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-chartshelm repo updatehelm install reloader stakater/reloader

➡️ See full Helm configuration in thechart 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 ownkustomization.yaml and use Reloader’s as a base:

apiVersion:kustomize.config.k8s.io/v1beta1kind:Kustomizationresources:  -https://github.com/stakater/Reloader/deployments/kubernetesnamespace:reloader

5. ⚖️ Default Resource Requests and Limits

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

resources:limits:cpu:150mmemory:512Mirequests:cpu:10mmemory: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 orannotations)
--log-format=jsonEnable JSON-formatted logs for better machine readability
Reload Strategies

Reloader supports multiple strategies for triggering rolling updates when a watchedConfigMap orSecret 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 areloader.stakater.com/last-reloaded-from annotation to the pod template metadata. Ideal for GitOps tools like ArgoCD, as it avoids triggering unwanted sync diffs.
  • Theenv-vars strategy is the default and works in most setups.
  • Theannotations strategy is preferred inGitOps environments to prevent config drift in tools like ArgoCD or Flux.
  • Inannotations mode, aConfigMap orSecret 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)
--resource-label-selector=key=valueOnly watch ConfigMaps/Secrets with matching labels

⚠️ Note:
Onlyone resource type can be ignored at a time.
Trying to ignorebothconfigmaps andsecrets will cause an error in Reloader.
Workaround: Scale the Reloader deployment to0 replicas if you want to disable it completely.

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. SeeLIST 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-annotationOverridesreloader.stakater.com/auto
--secret-auto-annotationOverridessecret.reloader.stakater.com/auto
--configmap-auto-annotationOverridesconfigmap.reloader.stakater.com/auto
--auto-search-annotationOverridesreloader.stakater.com/search
--search-match-annotationOverridesreloader.stakater.com/match
--secret-annotationOverridessecret.reloader.stakater.com/reload
--configmap-annotationOverridesconfigmap.reloader.stakater.com/reload

Compatibility

Reloader is compatible with Kubernetes >= 1.19

Help

Documentation

The Reloader documentation can be viewed fromthe doc site. The doc source is in thedocs folder.

Have a question?

File a GitHubissue.

Talk to us on Slack

Join and talk to us on Slack for discussing Reloader:

Join SlackChat

Contributing

Bug Reports & Feature Requests

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

Developing

  1. Deploy Reloader
  2. Runokteto 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 aPull 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 inissue 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 branchrelease-vX.Y.Z
  2. Code owners run a dispatch mode workflow to automatically generate version and manifests on the release branch
  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 tagvX.Y.Z and target branchrelease-vX.Y.Z, which triggers creation of images
  5. Code owners create a PR to update the Helm chart version, example:PR-846

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

Changelog

View thereleases page to see what has changed in each release.

License

Apache2 ©Stakater

About Stakater

Get started with Stakater

Reloader is maintained byStakater. Like it? Please let us know athello@stakater.com

Seeour other projects or contact us in case of professional services and queries onhello@stakater.com

About

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!

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go98.2%
  • Makefile1.1%
  • Other0.7%

[8]ページ先頭

©2009-2025 Movatter.jp