ArgoCD Image updater scale Up/Down by release date time.

Jamal Shahverdiev
2 min readNov 20, 2022

--

Before starting go in deep to the article I want to explain how I became to prepare these code files to achieve goal. With my team we agreed on that we will block any of new deployments to production for none working days (Saturday and Sunday) and times (EST time after 16:00 until early morning 09:00).

I started to think write some code which can get 4 environment variable as argument. 2 of them will define Scale Up/Down count and 2 of them will define time range to do ArgoCD image updater scale up/down. I needed to configure these variable dynamic which we can change this any time and my code must work inside of some Cronjob which can get arguments any time. Due that I created secret where will store base64 encoded values for my CronJob as arguments. Then I created ServiceAccount, ClusterRole and ClusterRoleBindings to give an access to my Cronjob to get access to the deployment argocd-imageupdater in the argocd namespace. At the end I wrote small code which will be executed via Cronjob each one hour and Cronjob itself. All code files located in this GitHub repository (just follow README file to achive goal).

I show simulation in the following video. I hope it will be useful.

--

--

Jamal Shahverdiev
Jamal Shahverdiev

Responses (1)