3

How to Stop/Start application deployed in the ArgoCD?

I see only Delete or Sync or deploy/redeploy options. I got running server applications and I'd like to stop (shutdown) temporarily their functionality in the cluster. Or I'm missing something in the concept?

Do I need to implement some kind of custom interface for my server applications to make start/stop functionality possible and communicate with my apps directly? (so it is out of ArgoCD responsibility - i.e. it is not like Linux service management system - I need to implement this by myself at application level)

rook
  • 5,880
  • 4
  • 39
  • 51
  • Looks like your understanding is correct. Only I was able to find in `argocd` github project are: [Ability to suspend an argo application](https://github.com/argoproj/argo-cd/issues/3039) and [stop an Application but keep the application definition](https://github.com/argoproj/argo-cd/issues/6079) which leads to the only delete/sync and deploy/redeploy options left. Also as an option, you can raise a question in their Github project, it will have more chances to be answered. – moonkotte Aug 18 '21 at 12:41
  • 1
    Stopping an application in kubernetes is done by setting the replicas of a deployment to 0. Commit the deployment manifest to git for argo to apply the change and stop the application. – razboy Dec 07 '21 at 00:41

1 Answers1

6

You can set the replica count to 0 so no pod will be created, without having to update your application code or remove the application from argocd.

You need to edit the definition of your deployment, setting the replicas to 0 like so:

apiVersion: ...
kind: Deployment
spec:
  replicas: 0
  ...

This can be done in 2 ways:

  • You can commit the changes in your config and sync argocd so they get applied,
  • Or you can do this directly from the argocd UI:
    • First disable the auto-sync (App Details > Summary > Disable auto-sync) so your changes don't get overwritten
    • Then edit the desired manifest of your deployment directly in the UI
    • When you want to rollback this change and re-deploy your app, simply sync and you will get your old config back
benterris
  • 634
  • 7
  • 15