Skip to content

Commit f13c1e9

Browse files
committed
CSPL-663 Optimize deployment of Splunk apps on SHC
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.
1 parent a49a9a2 commit f13c1e9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pkg/apis/enterprise/v1beta1/common_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ type CommonSplunkSpec struct {
5858
// Full path or URL for one or more default.yml files, separated by commas
5959
DefaultsURL string `json:"defaultsUrl"`
6060

61+
// Full path or URL for one or more default.yml files specific to App install, separated by commas
62+
// This is meant as a temporary fix until the SHC Deployer has its own CRD. The defaults listed here will
63+
// only be installed on a standalone, or a SHC Deployer or IDC CM to be pushed to SH/IDXs in a cluster.
64+
// This parameter is ignored on individual SHs or IDXs within a cluster
65+
DefaultsURLApps string `json:"defaultsUrlApps"`
66+
6167
// Full path or URL for a Splunk Enterprise license file
6268
LicenseURL string `json:"licenseUrl"`
6369

pkg/splunk/enterprise/configuration.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,13 @@ func updateSplunkPodTemplateWithConfig(client splcommon.ControllerClient, podTem
590590

591591
// prepare defaults variable
592592
splunkDefaults := "/mnt/splunk-secrets/default.yml"
593+
// Check for apps defaults and add it to only the standalone or deployer/cm instances
594+
if spec.DefaultsURLApps != "" &&
595+
(instanceType == SplunkDeployer ||
596+
instanceType == SplunkStandalone ||
597+
instanceType == SplunkClusterMaster) {
598+
splunkDefaults = fmt.Sprintf("%s,%s", spec.DefaultsURLApps, splunkDefaults)
599+
}
593600
if spec.DefaultsURL != "" {
594601
splunkDefaults = fmt.Sprintf("%s,%s", spec.DefaultsURL, splunkDefaults)
595602
}

0 commit comments

Comments
 (0)