argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.48k stars 5.32k forks source link

option to temporarily scale down all apps from the ui, then back to normal #11451

Open tooptoop4 opened 1 year ago

tooptoop4 commented 1 year ago

if some apps use a user/pw, a pw rotation can cause the user account to get locked as the apps still trying to use old pw

would be great to have button in the ui to scale down the apps to 0 replicas, do the rotation inc update k8s secrets, click button to rescale up all apps to their original replicas

nabilbendafi commented 1 year ago

@tooptoop4 I don't see how that can't already be possible using simple Restart behavior of Deployment via ArgoCD UI. Click in to see the Restart action menu. This will perform a rollout of the Deployment where your Pods will restart with whatever (new) Secret's value they found.

That assumes one have enough privilege on ArgoCD UI to do so (cf https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac) ex.

          p, role:admin, applications, action/apps/Deployment/restart, */*, allow

ref.:

tooptoop4 commented 1 year ago

the timing is important - I need pods to be down while I rotate pw and update secret (else the pods keep using old pw and lock the account), only after rotate pw/secret is done do I want the pods to start up

also want to apply to all apps with single click, not clicking through 100s of deployments

psibi commented 10 months ago

I also came across this use case recently where I have to temporarily scale down the deployment before doing a database migration.

It would be nice to have a UI feature/Argocd cli way to do it.

crenshaw-dev commented 10 months ago

@tooptoop4 do you need the ability to scale down more than one app, or just one app at a time? If just one app, I think this is a duplicate of https://github.com/argoproj/argo-cd/issues/3039 and could be solved by implementing this suggestion: https://github.com/argoproj/argo-cd/issues/3039#issuecomment-1608527515

jnkxcel commented 5 months ago

So there is actually a way to temporarily scale down a deployment in argocd. You need to go to the workload you want to scale down, select the deployment, find the replica key:value select to edit the deployment, move it to 0 and save. You will want to edit the application in Argo so its set to manual sync and not auto. This will effectively scale it down then you can deploy new stuff via code refresh and sync and it will scale back up to whatever replica count is set in codes. Took me long time to find this work around and is kind of janky but it works.