r/Splunk • • 3d ago

CI/CD

Not sure how other people are doing this but I just thought I would put forward the approach that I am taking with my team towards our Splunk Environment... my previous managers came from a Network/Infrastructure background so would do everything via CLI. As we were growing our environment all of the .conf files were done in /system/local/ - this was before we had a deployment server, cluster manager and search head cluster deployer.

All of our custom JS applications were built on a standalone search head and we are now migrating these across into the search head cluster, so I am curious about the approaches others have used...

We are using Gitlab, and here is my structure

Splunk

- CI Templates

-- ds.yml (deployment server /deployment-apps)

-- shcd.yml (search head cluster manager /shcbundle)

- DS Apps

-- (individual splunk apps containing .conf files, scripts and relevant JS for indexers, HFs and UFs)

- SHC Apps

-- (custom JS applications containing .conf files, appserver/static/css, js and image files)

All applications include a .yml file that references the relevant CI template where I am looking to introduce:

- When my developers create a branch and commit then as part of the template yml files the updates are applied to the standalone search head, triggering a reload of the app via API.

- When they request a merge to main and it is approved, this then triggers the updates to the relevant DS or SHCD, triggering a push via API.

Where passwords are required in the .conf files, I hash the passwords in gitlab and then replace the passwords when the apps are pushed out. We are also using 'rsync' and gitlab runners installed on the DS, SHDC and the standalone search head.

Curious what approaches other people are using with CI/CD and if others are using an IaC approach for their environment with Ansible or any other automation platform?

17 Upvotes

6 comments sorted by

1

u/brain112233 2d ago

We only use CI/CD to track and approve changes to conf files between team members. I don’t recommend auto pushing to clusters but some people think thats a good idea. 🤷‍♂️

1

u/oO0NeoN0Oo 1d ago

Just curious as to why you wouldn't recommend that? If its because of restarting after apps then I agree, we will have to look at scheduling those app installations.

I'm pushing towards ServiceManagement-as-code so treating Splunk as a sandbox, for example having custom JS apps trigger app creation from a custom template. Then use that as a 'navigation' app that points to other apps that contain dashboards usin the app context to determine the visible data.

Before I start getting too far into this fantasy, hearing other people's concerns/considerations would be a massive benefit.

1

u/Accurate_Bag9012 1d ago

One trap with this migration: anything still in etc/system/local beats app-level settings, so configs you move into deployment server or SHC apps can silently lose to the old system/local copies. Before you cut each host over, run `splunk btool <conf> list --debug | grep system/local` to see what still wins from there, then empty it out on purpose. The SHC has the same problem: changes people make in the UI land in each member's app local/ and override what the deployer pushes (by default the deployer merges your local/ into default/). So "I pushed it but nothing changed" is usually that. How are you handling changes your devs make in the SHC UI? Do they get pulled back into Git, or blocked?

1

u/oO0NeoN0Oo 14h ago

Xml dashboards are managed locally, this approach is mainly going to be used for custom apps. All development work is done in Gitlab so really only appserver/static/ is done unless it's a configuration app where the relevant conf files are included, but all of the apps are hidden and referenced from other apps. This way we can use the app context to determine what data is visible to the user.

3

u/In_Tech_WNC 2d ago

Add app inspect

0

u/sith4life88 1d ago

Look up Appetite. It's older but works well