Should we use CronJob instead of Deployments for sync scripts? #569
-
Checks
QuestionHas it ever been discussed to use CronJobs rather than Deployments for the long running scripts? When I'm using all the available features I'm running a full Python pod for Collectively everything uses about 2 GB (not including Using CronJobs would allow the same interval based sync without the cost of running the pods forever. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
@aodj this is an interesting idea, but please realize that I worry that including lots of CronJobs is worse for a few reasons:
If you are really concerned about resources, and don't want the benefits that come from automatically updating/reverting the connections/pools/users/variables automatically, you can set:
|
Beta Was this translation helpful? Give feedback.
-
You are correct that with fast jobs that run frequently there would be a cost paid in terms of starting and stopping, and I hadn't dug into the code enough to identify the different frequencies. 10s is very fast, and my gut feel is that it might be too fast for most use cases but as always YMMV. I did see the one-shot alternative you mention, but I still feel as if there's some middle ground that would allow a lighter footprint without losing the declarative nature of the current solution. Thanks for your input, I'll put my thinking cap on ;) |
Beta Was this translation helpful? Give feedback.
@aodj this is an interesting idea, but please realize that
sync-connections
,sync-pools
,sync-users
,sync-variables
are constantly reverting any changes people make using the Airflow UI, which has the benefit of forcing you to be declarative with your connections/pools/users/variables (and not discover weeks later during your nexthelm upgrade
that someone has updated a connection's password but not updated the values for it).I worry that including lots of CronJobs is worse for a few reasons:
airflow.connectionsTemplates
won't be updated as quickly (right now we do this every 10 seconds!)