Skip to content

[ENHANCE] Implement a new strategy for workloads restarting: delete workload #972

@macrokernel

Description

@macrokernel

The problem
Reloader is working fine for the workloads controlled by Kubernetes, but may fail in a case when pods or Deployments are controlled by an operator. The operator may recreate the workloads immediately after Reloader adds its annotation, which results in the new pods killed and the old pods keep running. This is the case with OpenSearch operator.

I tried using reloader.stakater.com/rollout-strategy: "restart", but it does not seem to make any difference at all:

  template:                 
    metadata:                                
      annotations:           
        checksum/dashboards.yml: cbe720ece5a0fef18e7c640d08a7a9db6b475f4a
        reloader.stakater.com/rollout-strategy: restart
        reloader.stakater.com/search: "true"          
        secret.reloader.stakater.com/reload: opensearch-dashboards-cert

Various versions of Reloader helm chart from 2.1.5 down to 1.0.98 have been tried out selectively - "restart" did not work with OpenSearch Dashboards deployment, there was no any difference from "reload".

BTW, it would be nice if Reloader logged the strategy it actually used in each update.

The proposed solution
Could we have a new method for restarting Deployments, StatefulSets and other supported workloads, that deletes the workload itself, not the pods? After the workload is deleted by Reloader, the operator would notice this and automatically recreate the workload, resulting in the pods restart. I see this new method as an easy to implement way of restarting workloads controlled by operators, which disallow edition/patching of the resources under their control. This is brute-force, but can be used as the last resort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions