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

https://github.com/argoproj/argo-cd/blob/master/docs/user-guide/commands/argocd_app_actions_run.md

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 (https://github.com/argoproj/argo-cd/blob/master/docs/user-guide/commands/argocd_app_sync.md):

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

Sorted by: Reset to default

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobmtsZGV%2FeoWOmqmgp5OZeqm71mapnquklr%2B1ecyuo62hoKGybq3PqapmmaRivK%2BvxA%3D%3D