-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add deploy option for Sync jobs #2181
base: master
Are you sure you want to change the base?
Conversation
Hello @eurotux-tec and thank you for contributing! Imagine you've configured that job, update Director and suddenly the job does much more than you expect. Would you like this kind of behavior in your production? (I'd flip my table.)
@Thomas-Gelf Can you confirm this? icingaweb2-module-director/library/Director/Job/ConfigJob.php Lines 31 to 33 in d804448
Best, |
@Al2Klimov: you can have an automated Config Deploy Job scheduled to run every minute or even faster:
If you then also define a grace period you can for example make sure that it deploys at most every X minutes, even if there are changes every few seconds. And when you select a Time Period you can for example make sure that automated Deployments occur only during office hours. Well - and that's it. Works even in large environments with a massive amount of changes and lots of Import Sources and Sync Rules. @eurotux-tec: thanks for your effort, but as @Al2Klimov already pointed out this change would be pretty unexpected. Quite some environments have only automated Import and Sync Jobs, but prefer to deploy manually as they do not trust their various config sources. You wrote:
Are you sure about this? This would be a severe bug. |
Hello. There are situations when having a deploy forced every 5 minutes is undesirable, because then you can't be adding new stuff without it being deployed without wanting yet. So I prefer the alternative proposed by this patch, even knowing I can still have a deploy being made once in a while when I'm editing other stuff, but at least it's not always, and it will be because my very important sync job had to do it. So, maybe not by default, since not everyone wants to have automated deploys, but to have this as an option is a must on certain environments. If it can be made optional, would anyone disagree on it being merged? |
d804448
to
0bf5e0f
Compare
Thank you for your pull request. Before we can look at it, you'll need to sign a Contributor License Agreement (CLA). Please follow instructions at https://icinga.com/company/contributor-agreement to sign the CLA. After that, please reply here with a comment and we'll verify. Contributors that have not signed yet: @araujorm
|
Hello. Patch has been reworked to not affect the default behaviour. Instead, a new option "Deploy" has been added to the Sync Job config. That option is only visible/affects if "Apply changes" is "Yes". By default, the "Deploy" option is "No". Other possible values are:
With these changes, and with the new feature being completely optional, is this pull request now acceptable? Best regards. |
CLA has already been signed by the contributor. |
Hi. I've signed the CLA (with both of my emails) but it is not being recognized (same thing seems to be blocking #2180). Can someone force a re-check, or tell me if I'm doing something wrong? Also, can we have feedback about this patch, and get it merged if it's good? |
@cla-bot check |
Feedback regarding this patch:
I'll add some more thoughts in my next comment. |
Some thoughts: We recently implemented Configuration Branches for the Icinga Director. The code is in place and working, schema changes have already been applied. The related GUI controls are (intentionally) still missing. We're now able to apply changes to Configuration Branches, which are safe different realities - similar to branches in your VCS. Sync runs are part of this whole picture. Plans are to offer a "Sync to a temporary Branch" functionality. This will allow one to navigate all changes applied by a Sync rule directly in the Director UI, and to then merge or reject those changes at will, and all at once. Also related: we implemented Push-only Import Sources, where instead of pulling data, you ship it to the Import Source (HTTP POST or similar). This is somewhat hidden, and leveraged only by some (or at least one) add-on modules. There we also trigger related Sync Rules in case the imported data changed. This will probably ask for some additional flags on the Import and Sync objects themselves. Wanted to mention this, as you might have to expect some delay for this feature. Depending on where they move, we might prefer to shift your setting from the Job to the Sync rule itself. Cheers, |
@Thomas-Gelf Good morning Thomas. Thanks for sharing and for the feedback. Those new features look promising, we'll try to keep up the pace and adapt to them as needed. We'll now work on the changes you mentioned and update this thread when ready. |
0bf5e0f
to
7096885
Compare
Hello. Remade the proposed patch as follows:
@Thomas-Gelf Can you see if it's good? Many thanks. |
7096885
to
6320167
Compare
Sorry, last version missed importing the necessary namespaces for ConditionalConfigRenderer and ConditionalDeployment, and needed to remove some others used in the first version of this patch. Fixed that in latest update to the branch. |
6320167
to
a943079
Compare
Yet another correction... the new logic wasn't working, since one must first check if there are other pending changes before the job eventually makes more. Fixed too, and is now according to:
Sorry again, and thanks for your time to review. |
a943079
to
cf2b8ae
Compare
cf2b8ae
to
7f44890
Compare
Hello. We've refreshed the proposed commit so that it merges with the current master. Could we have any feedback on whether it's acceptable, or if there is any other approach you'd prefer instead? |
@araujorm I just wanted to send you a quick note because it looks like you are still actively using Icinga and need these changes. At the end of this year we will start planning the feature release and will take this PR into account. Please excuse the long wait. |
7f44890
to
8efce40
Compare
Good afternoon. Branch of the merge request was rebased so that the MR is valid for latest release and master branch. |
In our company, we use Icinga Director automations to create the customer infrastructure when it's in the cloud (AWS).
Currently, there is an import source responsible for collecting information about the servers to be monitored and a sync rule in charge of creating the objects (hosts).
Since it's an infrastructure in the cloud it's highly dynamic, so an automation is necessary to keep the monitoring up to date.
For this, we created three jobs to execute periodically (5 minutes) to run the import source, the sync rule and the configuration deployment.
Considering the current approach, configurations are deployed every 5 minutes, regardless of whether there are changes or not. In our scenario where there are many satellites and each deployment implies sending the configuration to all satellites, the impact is significant.
In this PR, a change to Sync Job is proposed so that it is responsible not only for creating the configuration but also for deploying it (when necessary).
Do you think that this makes sense or can we do it in a different way? If you agree, please merge this. If you don't, please let me know how can I improve the patch so that is gets merged.