@@ -214,7 +214,6 @@ func ApplyIngestorCluster(ctx context.Context, client client.Client, cr *enterpr
214214
215215 // No need to requeue if everything is ready
216216 if cr .Status .Phase == enterpriseApi .PhaseReady {
217- // TODO: Make it work when HPA scales replicas - all new pods should get the configuration
218217 _ , err = handlePushBusOrPipelineConfigChange (ctx , cr , client )
219218 if err != nil {
220219 scopedLog .Error (err , "Failed to update conf file for PushBus/Pipeline config change after pod creation" )
@@ -264,8 +263,8 @@ func ApplyIngestorCluster(ctx context.Context, client client.Client, cr *enterpr
264263// validateIngestorClusterSpec checks validity and makes default updates to a IngestorClusterSpec and returns error if something is wrong
265264func validateIngestorClusterSpec (ctx context.Context , c splcommon.ControllerClient , cr * enterpriseApi.IngestorCluster ) error {
266265 // We cannot have 0 replicas in IngestorCluster spec since this refers to number of ingestion pods in an ingestor cluster
267- if cr .Spec .Replicas == 0 {
268- cr .Spec .Replicas = 1
266+ if cr .Spec .Replicas < 3 {
267+ cr .Spec .Replicas = 3
269268 }
270269
271270 if ! reflect .DeepEqual (cr .Status .AppContext .AppFrameworkConfig , cr .Spec .AppFrameworkConfig ) {
@@ -280,7 +279,15 @@ func validateIngestorClusterSpec(ctx context.Context, c splcommon.ControllerClie
280279
281280// getIngestorStatefulSet returns a Kubernetes StatefulSet object for Splunk Enterprise ingestors
282281func getIngestorStatefulSet (ctx context.Context , client splcommon.ControllerClient , cr * enterpriseApi.IngestorCluster ) (* appsv1.StatefulSet , error ) {
283- return getSplunkStatefulSet (ctx , client , cr , & cr .Spec .CommonSplunkSpec , SplunkIngestor , cr .Spec .Replicas , make ([]corev1.EnvVar , 0 ))
282+ ss , err := getSplunkStatefulSet (ctx , client , cr , & cr .Spec .CommonSplunkSpec , SplunkIngestor , cr .Spec .Replicas , []corev1.EnvVar {})
283+ if err != nil {
284+ return nil , err
285+ }
286+
287+ // Setup App framework staging volume for apps
288+ setupAppsStagingVolume (ctx , client , cr , & ss .Spec .Template , & cr .Spec .AppFrameworkConfig )
289+
290+ return ss , nil
284291}
285292
286293// Checks if only PushBus or Pipeline config changed, and updates the conf file if so
0 commit comments