ArgoCD: How restart multiple Apps at once

My Database was down today and multiple applications in my cluster lost the connection with the database, but the Pod was Healthy (I know, I should have better Health Checks, but I don't). So, when the database was back online, the applications weren't able to connect again. So, I would like to restart all my Deployments. They share a label and are in the same Kubernetes namespace. We use ArgoCD to manage the applications.

In ArgoCD, I know I can restart all Deployments in one ArgoCD Application by typing this command:

argocd app actions run my-app restart --kind Deployment --all

But I do not know how to restart the Deployment of multiple independent applications in ArgoCD. I tried, but none of these work:

argocd app actions run my-app1 my-app2 restart --kind Deployment --all
argocd app actions run -l mylabel=value restart --kind Deployment --all

I wonder how can I restart multiple applications in ArgoCD in one command?

I would like to use same syntax of the sync command ():

argocd app sync [APPNAME... | -l selector] [flags]

I tried to use sync, but it does not restart Deployments, unless I make some change in the Deployment itself (or if I use a configMap Generator, which is not my case).

Thank you in advance.

EDIT: I created a shell script for my needs:

 for i in $(argocd app list -l yourgroup=your.label --output name); do argocd app actions run $i restart --kind Deployment --all;
done

It will fail for those apps which does not have a Deployment, but, for me, restarted everything I wanted.

1 Related questions 5 Restarting pods quickly 3 How to restart multiple spring boot app instances of a kubernetes service 0 Argocd Automatic App Deployment to kubernetes cluster Related questions 5 Restarting pods quickly 3 How to restart multiple spring boot app instances of a kubernetes service 0 Argocd Automatic App Deployment to kubernetes cluster 0 Restarting a kubernetes pod from another pod 6 How to restart a deployment in kubernetes using go-client 2 kubernetes restart all the pods using REST api 5 Starting/Stopping applications in ArgoCD 0 Restart n number of pods in K8s 2 restricting tasks to run multiple times due to multiple pod restarts at same time 0 Kubernetes pod terminating option? Load 7 more related questions Show fewer related questions Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like