-
Notifications
You must be signed in to change notification settings - Fork 126
CSPL-663 Optimize deployment of Splunk apps on SHC #211
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
Conversation
f13c1e9 to
12393d6
Compare
|
|
||
| // prepare defaults variable | ||
| splunkDefaults := "/mnt/splunk-secrets/default.yml" | ||
| // Check for apps defaults and add it to only the standalone or deployer/cm instances |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if I have understood this right, to install apps on Standalones, CM & Deployer, setup defaultsUrlApps
- Am I right in saying that on LM, we still need to use
defaultsUrl? For consistency purposes, should LM also be included? - If both
defaultsUrlApps&defaultsUrlare configured withapps_locaton, wonder how Ansible would treat this? I am guessing it would be much more efforts to expect operator to be smart enough to parse & detect this duplicate, & strip off one of the duplicates. Completely droppingapps_locationfromdefaultsUrlwould also need parsing logic. - We should document the new argument & best practices in Examples.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right in saying that on LM, we still need to use defaultsUrl? For consistency purposes, should LM also be included?
So currently yes, but I can add LM to this list as well. Or probably better, just exclude Indexer and SearchHead types since they will always be in the cluster.
If both defaultsUrlApps & defaultsUrl are configured with apps_locaton, wonder how Ansible would treat this? I am guessing it would be much more efforts to expect operator to be smart enough to parse & detect this duplicate, & strip off one of the duplicates. Completely dropping apps_location from defaultsUrl would also need parsing logic.
I will test this and verifiy that ansible behaves correctly.
We should document the new argument & best practices in Examples.md
We can add this to the documentation. Though if we plan on making the Deployer its own CRD, we may not need this parameter. So it maybe a temporary fix and might not need documenting if it's going away soon. However we can pull the docs once that occurs. I'll make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validated in testing the use of multiple defaults.yml files works correctly, including with overlapping apps.
docs/Examples.md
Outdated
|
|
||
| Unlike `defaultsUrl` which is applied at every instance created by the CR, the | ||
| `defaultsUrlApps` will be applied on instances that will **not** get the application | ||
| installed via a bundle push. earch head and indexer cluster members will not have |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
docs/Examples.md
Outdated
| the `defaultsUrlApps` parameter applied. This means: | ||
|
|
||
| - For standalones the apps will be installed as normal. | ||
| - For SHC these applications will be installed in the SHC Deployer and push it out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Just so that both statements are consistent
- For SHC, these applications will only be installed on the SHC Deployer and pushed to the members via SH Bundle push.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
docs/Examples.md
Outdated
| installed via a bundle push. earch head and indexer cluster members will not have | ||
| the `defaultsUrlApps` parameter applied. This means: | ||
|
|
||
| - For standalones the apps will be installed as normal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: For standalone & License Master, the apps will be installed as normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
docs/Examples.md
Outdated
| pushed to the indexers in the cluster via CM Bundle push. | ||
|
|
||
| Application and other ansible defaults can be still be installed via `defaultsUrl` | ||
| and both options can be used in conjunction: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Installing Applications via defaultsUrl, while continues to work, is not going to be a recommended practice anymore, right? Especially to avoid what this PR is fixing (the double pod resets).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes while technically you can still have apps in the defaultsUrl this would not be preferred but would be left in for backward compatibility. The new block would be:
For application installation the preferred method will be through the
defaultsUrlApps
while other ansible defaults can be still be installed viadefaultsUrl. For backwards
compatibility applications could be installed viadefaultsUrlthough this is not
recommended. Both options can be used in conjunction:
kashok-splunk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good :)
5ff389b to
85e3a16
Compare
|
Squashing commits |
Add a new parameter defaultsUrlApps to install apps listed here only on Standalone, SHC Deployer, and IDC CM. This parameter would be ignored on individual SHs and indexers in a clustered environment as the install of app there would be handled by bundle push from the deployer or CM.
17aa7a1 to
ab35bb7
Compare
Problem
As part of #126 it mentions an optimization for installing apps on a SHC since there is not separate CRD for the deployer.
On SearchHeadClusters CRDs, the defaultsUrl property of the CRD is shared by the deployer and the search-heads. When the defaultsUrl is updated with new applications, this would trigger a rolling rebuild of the search-head pods and deployer. However the deployer would trigger an apply shcluster-bundle, potentially triggering a rolling restart of the searchhead cluster in parallel. Rebuilding the SH pods is not necessary and can lengthen the downtime of the the SHC.
This problem does not exist on the IndexerCluster CRD since the applications are handled by the cluster-master which has a dedicated CRD. So the defaultsUrl from indexers in the cluster can be different. If a separate CRD is implement for the SHC Deployer, this would be the same case for SHC as well. However until that CRD is created, this problem exists.
Solution
Add a
defaultsUrlAppsparameter to the CRDs for Standalone, IndexerClusters, and SearchHeadClusters. This parameter would be used specifically for app installs and used on Standalones, SH Deployer, and IDC CM only. Individual SHs and indexers in clusters would ignore this parameter. This would allow the applications for a clustered env to be changed without rebuilding the SH member pods. The SH Deployer would then push out the bundle and install the apps on all SH members.This could have been implement specific to SH Deployer (since the SHC is the only deployment with this issue), however keeping it more generic allows for future optimizations, potentially installing apps without the need pod rebuilds.
Testing
Create a SHC using a defaults.yml in
defaultsUrlApps:shc.yml:
Then adjust the
defaultsUrlAppsparameter and verify that only the shc deployer gets rebuilt and that the correct apps from the respective defaults_apps.yml are installed.Apply changes and validate only deployer is rebuilt: