Reloader icon indicating copy to clipboard operation
Reloader copied to clipboard

[BUG] Restart strategy does not change behaviour of stakater

Open k8soneill opened this issue 3 months ago • 4 comments

Describe the bug When applying the reloader.stakater.com/rollout-strategy: "restart" annotation the docs suggest that the controller will delete the pod directly rather than update the deployment however no pod deletion is happening. We are using an operator backed deployment hence why we can see no restart applied as the operator overwrites any direct changes to the deployment meaning no new pods are deployed.

To Reproduce Deploy a grafana instance via grafana operator. Mount a simple secret in the deployment spec.

Add the reloader.stakater.com/rollout-strategy: "restart" to the deployment, pod and secret (docs aren't clear which resource this should be added to)

Edit the secret value to trigger a stakater update.

Check to see if a new pod is running.

Expected behavior The controller runs a delete operation directly on the pod leading to a new pod being created and the old one terminated. As per this section of the readme:

"By default, Reloader uses the rollout 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 the restart strategy, which simply restarts the pod without changing the pod template."

Screenshots

Environment

  • Operator Version: 1.4.8
  • OpenShift Version: 4.17.29

Additional context Add any other context about the problem here.

k8soneill avatar Sep 18 '25 16:09 k8soneill

I added the reloader.stakater.com/rollout-strategy annotation to creatd Pods of a Deployment. The annotation is there. However, when the underlying ConfigMap changes the Pod is not deleted but rather a new one is deployed. But, in my case this does not get me anywhere .... really need a in-place delete ( restart ) of the Pod as it uses a ReadWriteOnce access mode volume. If not restart/delete is used - then a Multi-Attach error is seen.

larssb avatar Sep 23 '25 18:09 larssb

Hi @k8soneill thanks for reaching us out. In order to facilitate you further, can you share your YAML files you applied reloader annonations upon. If this YAML can be as simple as deployment reproducing the issue, it can help a ton.

Thanks,

mahmadmujtaba avatar Sep 24 '25 09:09 mahmadmujtaba

Same here. I have "restart" as rollout strategy without success.

This are my StatefulSet settings:

template: metadata: annotations: reloader.stakater.com/auto: "true" reloader.stakater.com/search: "true" reloader.stakater.com/rollout-strategy: restart configmap.reloader.stakater.com/reload: vault-ca-bundle secret.reloader.stakater.com/reload: tls-external,tls-internal,tls-internal-ca

The StatefulSet is updated but the pods are never deleted. So, nothing happens.

cristianm avatar Oct 10 '25 14:10 cristianm

https://github.com/stakater/Reloader/issues/1015#issuecomment-3405547643

rollout strategy is only applicable for ArgoCD rollouts.

nielsole avatar Oct 28 '25 10:10 nielsole